Commit 6f2ac5d1b8049a2e23b97301ff2a6badf0bff835

Thomas de Grivel 2023-12-14T22:17:37

fix toasters

diff --git a/libc3/window/sdl2/demo/toasters.c b/libc3/window/sdl2/demo/toasters.c
index 5be170d..9543772 100644
--- a/libc3/window/sdl2/demo/toasters.c
+++ b/libc3/window/sdl2/demo/toasters.c
@@ -86,7 +86,7 @@ static void toaster_render (s_tag *toaster, s_window_sdl2 *window,
     y = &toaster->data.map.value[1].data.f64;
     *x += seq->dt * g_speed_x;
     *y += seq->dt * g_speed_y;
-    if (*x > window->w || *y < -g_sprite_toaster.h) {
+    if (*x > window->w || *y < -300) {
       tag_clean(toaster);
       toaster->type = TAG_VOID;
       return;
diff --git a/libc3/window/sdl2/sdl2_sprite.c b/libc3/window/sdl2/sdl2_sprite.c
index 5d07bdc..00f3837 100644
--- a/libc3/window/sdl2/sdl2_sprite.c
+++ b/libc3/window/sdl2/sdl2_sprite.c
@@ -330,4 +330,13 @@ void sdl2_sprite_render (const s_sdl2_sprite *sprite, uw frame)
     glTexCoord2f(1, 1);
     glVertex2d(sprite->w, sprite->h);  
   } glEnd();
+  /*
+  glDisable(GL_TEXTURE_2D);
+  glBegin(GL_LINE_LOOP); {
+    glVertex2d(0, sprite->h);
+    glVertex2i(0, 0);
+    glVertex2i(sprite->w, 0);
+    glVertex2d(sprite->w, sprite->h);  
+  } glEnd();
+  */
 }