diff options
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | asset/bmp/FLAG_B24.BMP | bin | 46182 -> 0 bytes | |||
| -rw-r--r-- | asset/font.psf | bin | 29728 -> 0 bytes | |||
| -rw-r--r-- | asset/font_2.ttf | bin | 120240 -> 0 bytes | |||
| -rw-r--r-- | asset/tga_textures/doom.tga | bin | 0 -> 1440018 bytes | |||
| -rw-r--r-- | asset/tr.tga | bin | 4367378 -> 0 bytes | |||
| -rw-r--r-- | example/.gitignore | 2 | ||||
| -rw-r--r-- | example/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | example/texture.c | 4 | ||||
| -rw-r--r-- | fbgl.h | 5 |
10 files changed, 9 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a1f6fec --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +fbgl-test-env/ diff --git a/asset/bmp/FLAG_B24.BMP b/asset/bmp/FLAG_B24.BMP Binary files differdeleted file mode 100644 index b61d368..0000000 --- a/asset/bmp/FLAG_B24.BMP +++ /dev/null diff --git a/asset/font.psf b/asset/font.psf Binary files differdeleted file mode 100644 index 071330e..0000000 --- a/asset/font.psf +++ /dev/null diff --git a/asset/font_2.ttf b/asset/font_2.ttf Binary files differdeleted file mode 100644 index af3f57c..0000000 --- a/asset/font_2.ttf +++ /dev/null diff --git a/asset/tga_textures/doom.tga b/asset/tga_textures/doom.tga Binary files differnew file mode 100644 index 0000000..4f7a447 --- /dev/null +++ b/asset/tga_textures/doom.tga diff --git a/asset/tr.tga b/asset/tr.tga Binary files differdeleted file mode 100644 index 86f10ae..0000000 --- a/asset/tr.tga +++ /dev/null diff --git a/example/.gitignore b/example/.gitignore index 4a6e1b0..567609b 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1 +1 @@ -build/core.* +build/ diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 3051dfc..411945a 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -21,4 +21,4 @@ endfunction() add_example(empty_example) -add_folders(Example)
\ No newline at end of file +add_folders(Example) diff --git a/example/texture.c b/example/texture.c index da614d4..d1c25bd 100644 --- a/example/texture.c +++ b/example/texture.c @@ -32,7 +32,8 @@ int main(int argc, char **argv) int dy = 3; // Vertical speed (adjust for desired marquee speed) // Main rendering loop - while (1) { + int framesize = 30 * 30; + while (framesize) { // Clear the framebuffer (set background) fbgl_set_bg(&framebuffer, 0x000000); @@ -56,6 +57,7 @@ int main(int argc, char **argv) } usleep(50000); // Delay to make the marquee effect visible (adjust as needed) + framesize--; } // Wait for the user to press the escape key before exiting @@ -296,6 +296,7 @@ void fbgl_set_bg(fbgl_t *fb, uint32_t color) void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb) { +#ifdef FBGL_VALIDATE_PUT_PIXEL if (!fb || !fb->pixels) { fprintf(stderr, "Error: framebuffer not initialized.\n"); return; @@ -304,7 +305,7 @@ void fbgl_put_pixel(int x, int y, uint32_t color, fbgl_t *fb) if (x < 0 || x >= fb->width || y < 0 || y >= fb->height) { return; // Ignore out-of-bound coordinates } - +#endif // FBGL_VALIDATE_PUT_PIXEL size_t index = y * fb->width + x; fb->pixels[index] = color; } @@ -685,4 +686,4 @@ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------ -*/
\ No newline at end of file +*/ |
