Commit 41c2d7a1cd3cb36a13ede871a19868f874244465

Thomas de Grivel 2024-01-24T11:46:12

inspect point per pixel

diff --git a/libc3/io.c b/libc3/io.c
index 615fc7f..8f495b1 100644
--- a/libc3/io.c
+++ b/libc3/io.c
@@ -107,6 +107,7 @@ sw io_write_1 (const char *x)
 DEF_ERR_IO_INSPECT(array,      const s_array *)
 DEF_ERR_IO_INSPECT(call,       const s_call *)
 DEF_ERR_IO_INSPECT(character,  const character *)
+DEF_ERR_IO_INSPECT(f32,        const f32 *)
 DEF_ERR_IO_INSPECT(fact,       const s_fact *)
 DEF_ERR_IO_INSPECT(fn_pattern, const s_list *)
 DEF_ERR_IO_INSPECT(list,       const s_list **)
diff --git a/libc3/window/sdl2/demo/window_sdl2_demo.c b/libc3/window/sdl2/demo/window_sdl2_demo.c
index 45ccbef..c207186 100644
--- a/libc3/window/sdl2/demo/window_sdl2_demo.c
+++ b/libc3/window/sdl2/demo/window_sdl2_demo.c
@@ -146,6 +146,9 @@ bool window_sdl2_demo_load (s_window_sdl2 *window)
   assert(window);
   assert(glGetError() == GL_NO_ERROR);
   point_per_pixel = (f32) window->w / window->gl_w;
+  err_write_1("point_per_pixel: ");
+  err_inspect_f32(&point_per_pixel);
+  err_write_1("\n");
   if (window->sequence_count != WINDOW_SDL2_DEMO_SEQUENCE_COUNT) {
     fprintf(stderr, "window_sdl2_demo_load: "
             "window->sequence_count = %lu\n", window->sequence_count);
diff --git a/libc3/window/sdl2/gl_sprite.c b/libc3/window/sdl2/gl_sprite.c
index d28dd60..a6d96f8 100644
--- a/libc3/window/sdl2/gl_sprite.c
+++ b/libc3/window/sdl2/gl_sprite.c
@@ -71,8 +71,8 @@ static bool png_info_to_gl_info (s32 png_color_type,
     *components = 4;
     *gl_format = GL_RGBA;
     switch (png_bit_depth) {
-    case 8:  *gl_internal_format = GL_RGBA8;  break;
-    case 16: *gl_internal_format = GL_RGBA16; break;
+    case 8:  *gl_internal_format = GL_RGBA;  break;
+    case 16: *gl_internal_format = GL_RGBA; break;
     default: *gl_internal_format = 0; return false;
     }
     break;