Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PUTting to a buffer
#1
How do I use the PUT command to draw a sprite in an off-screen buffer (virtual screen, whatever)?
Reply
#2
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
sorry about my english
Reply
#3
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.
Reply
#4
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.
Reply
#5
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?
Reply
#6
nop gfx lib is directX or GDI it all low level stuff thanks to the geniuse that is lillo.
Reply
#7
The buffer needs to be a valid GET/PUT buffer before you can use any primitive (including PUT) on it.
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
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.
ngelo Mottola - EC++
Reply
#8
Quote:The buffer needs to be a valid GET/PUT buffer before you can use any primitive (including PUT) on it.

Ohhhhhh...! Big Grin I didn't know that. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)