User Tools

Site Tools


development:csdk:1.0:graphics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:csdk:1.0:graphics [2024/11/08 01:57] – removed - external edit (Unknown date) 127.0.0.1development:csdk:1.0:graphics [2024/11/08 01:59] (current) – ↷ Links adapted because of a move operation clyde
Line 1: Line 1:
 +====== Graphics on the GameTank ======
 +
 +In most systems, a sprite is a graphical resource of limited size that can be moved across the screen without modifying the playfield. Not so on the GameTank. A "sprite" here can have any size (up to 127x127 pixels) but cannot be moved. It //will// modify the playfield.
 +
 +**The GameTank approach is to completely redraw the entire screen for every frame**. This is achieved thanks to the the system's blitter which is theoretically fast enough to update the screen 2 to 3 times per screen refresh, thus maintaining a 60 FPS animation (note: the Atari Lynx follows a similar approach).
 +
 +===== VRAM =====
 +
 +In order to achieve maximum efficiency, graphical assets need to be loaded in VRAM using ''load_spritesheet()''. This function specifies a VRAM bank. Sprites can then be drawn by calling ''draw_sprite()'', referencing the bank where the asset was loaded. See [[development:csdk:1.0:sprites|Importing and Drawing Sprites]] for further information.
 +
 +===== Double Buffer =====
 +
 +The C SDK provides easy double buffering to avoid any flickering. A typical animation loop in C looks like this:
 +
 +  while(1) {
 +    // Draw stuff
 +    await_draw_queue();
 +    sleep(1);
 +    flip_pages();
 +    // Business logic
 +  }
 +