Shop OBEX P1 Docs P2 Docs Learn Events
Graphics Driver — Parallax Forums

Graphics Driver

Hello,
Finally got my hands on LaMothe's Game Programming for the propeller Powered Hydra. Luckily, to get the demo and examples running only requires a slight touch-up to get it working on my board. Some drivers and OBJ's seem to have been superseded as well.
I am a little lost with the graphics driver and would like to know, with the double-buffered architecture and all, rendering to the offscreen_buffer, does the bitmap get erased for each super-frame? Let's say you have a cursor, as in the mouse demo program. The cursor is actually a custom character because it's defined in the DAT section as a ROM Character would be, or maybe a "sprite" in game lingo. The program simply calls a method passing the new mouse coordinates and the image of the cursor moves to the new location. But, what happens to the data already in the bitmap, as the "game" loop repeats. No sign of this in the spin code, so maybe this happens in assembly, not sure.
I would think that with each loop a copy of the image is written to the bitmap, and the bitmap fills with more and more sprites. Not that we would want that, but it would be helpful to know.
As, a side note, the book says when drawing pixels, lines, polygons you don't have to worry about pre-clipping. Not sure what clipping means in this context?

Comments

  • The buffer only gets cleared when you call the function to do so. The mouse demo does it..

    By clipping it means confining the drawing coordinates to the screen area (so it doesn't start drawing into unrelated memory). As said, the graphics engine does it automatically.

  • Now I see... It gets interesting in the next section when you plot pixels and lines, and the use of buffers is apparent. I guess it's better to try all the demos first. Pretty Cool. Has anyone read the book? What are your thoughts?

Sign In or Register to comment.