diff options
| author | 2019-04-10 15:14:00 -0400 | |
|---|---|---|
| committer | 2019-04-10 15:14:00 -0400 | |
| commit | 60699af63f92f43cc4b4b9e3050fcdd2a8468281 (patch) | |
| tree | 20a18af2774daa43ae7f4352dd032a24f7e06075 /frontends/calculator/CEdev/examples/gfx_template/src | |
| parent | 4527bc20241068731c62101d0467d416119ec0c4 (diff) | |
| download | cetris-60699af63f92f43cc4b4b9e3050fcdd2a8468281.tar.gz cetris-60699af63f92f43cc4b4b9e3050fcdd2a8468281.tar.bz2 cetris-60699af63f92f43cc4b4b9e3050fcdd2a8468281.zip | |
add opengl fronend, remove sdl frontend, refactor build system
Diffstat (limited to 'frontends/calculator/CEdev/examples/gfx_template/src')
| -rw-r--r-- | frontends/calculator/CEdev/examples/gfx_template/src/main.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/frontends/calculator/CEdev/examples/gfx_template/src/main.c b/frontends/calculator/CEdev/examples/gfx_template/src/main.c new file mode 100644 index 0000000..2904b0a --- /dev/null +++ b/frontends/calculator/CEdev/examples/gfx_template/src/main.c @@ -0,0 +1,64 @@ +/* + *-------------------------------------- + * Program Name: + * Author: + * License: + * Description: + *-------------------------------------- +*/ + +/* Keep these headers */ +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <tice.h> + +/* Standard headers (recommended) */ +#include <math.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include <graphx.h> + +/* Put your function prototypes here */ +void begin(); +void end(); +bool step(); +void draw(); + +/* Put all your globals here */ +bool partial_redraw; + +void main() { + begin(); // No rendering allowed! + gfx_Begin(); + gfx_SetDrawBuffer(); // Draw to the buffer to avoid rendering artifats + + while (step()) { // No rendering allowed in step! + if (partial_redraw) // Only want to redraw part of the previous frame? + gfx_BlitScreen(); // Copy previous frame as a base for this frame + draw(); // As little non-rendering logic as possible + gfx_SwapDraw(); // Queue the buffered frame to be displayed + } + + gfx_End(); + end(); +} + +/* Put other functions here */ +void begin() { + /* Implement me! */ +} + +void end() { + /* Implement me! */ +} + +bool step() { + /* Implement me! */ +} + +void draw() { + /* Implement me! */ +} |