04-16-2005, 03:59 AM
04-16-2005, 04:59 AM
Quote:How do I use the PUT command to draw a sprite in an off-screen buffer (virtual screen, whatever)?
examples/gfx/rel-sprites.bas :bounce:
v13b is aviable
Joshy
04-16-2005, 05:29 AM
I already saw that example, but it doesn't use the PUT command. I already know how to plot 1 pixel at a time. I was looking for a built-in sub. Oh well.
04-16-2005, 05:52 AM
Gfx commands like PSET and PUT can draw to GET/PUT buffers. I forget the syntax - but I'm sure that was added recently.
EDIT: Yep, it's in docs/gfxlib.txt.
PUT [buffer,][STEP](x,y), arrayname[(idx)] [,mode]
And buffer would be a GET/PUT format array.
Or you can still do QB-style page flipping with the SCREENSET command, if that's what you mean by off-screen buffer.
EDIT: Yep, it's in docs/gfxlib.txt.
PUT [buffer,][STEP](x,y), arrayname[(idx)] [,mode]
And buffer would be a GET/PUT format array.
Or you can still do QB-style page flipping with the SCREENSET command, if that's what you mean by off-screen buffer.
04-16-2005, 10:03 AM
Quote:Gfx commands like PSET and PUT can draw to GET/PUT buffers. I forget the syntax - but I'm sure that was added recently.
EDIT: Yep, it's in docs/gfxlib.txt.
PUT [buffer,][STEP](x,y), arrayname[(idx)] [,mode]
And buffer would be a GET/PUT format array.
Or you can still do QB-style page flipping with the SCREENSET command, if that's what you mean by off-screen buffer.
I tried that PUT syntax, but it didn't seem to work... Maybe because of tiny_ptc or sdl?
04-16-2005, 12:05 PM
nop gfx lib is directX or GDI it all low level stuff thanks to the geniuse that is lillo.
04-16-2005, 03:20 PM
The buffer needs to be a valid GET/PUT buffer before you can use any primitive (including PUT) on it.
You can also request to SCREEN any number of offscreen pages. A page is the same size as the visible screen, and at any time you can work on a page while displaying another one.
Use SCREENSET/SCREENCOPY to deal with this; have a look at docs/gfxlib.txt for details.
Code:
DIM buffer(64004) AS UBYTE
SCREEN 13
GET(0,0)-(319,199),buffer
'' suppose you have a valid "sprite" array holding your sprite (also in GET/PUT format)
PUT buffer, (0,0), sprite
Use SCREENSET/SCREENCOPY to deal with this; have a look at docs/gfxlib.txt for details.
04-16-2005, 10:43 PM
Quote:The buffer needs to be a valid GET/PUT buffer before you can use any primitive (including PUT) on it.
Ohhhhhh...! I didn't know that. Thanks.