This commit is contained in:
zy 2024-12-29 19:25:51 +01:00
parent dd4edcd397
commit 2514d4da7b
5 changed files with 12 additions and 4 deletions

View file

@ -10,6 +10,7 @@
#include "mlx_internal.h"
#include <stdlib.h>
#include "3ds.h"
#include <citro2d.h>
static t_internal_mlx g_internal_mlx;
@ -18,9 +19,9 @@ t_mlx mlx_init(void)
if (g_internal_mlx.is_init_called)
mlx3ds_internal_fatalerror("mlx_init() must be called only once");
g_internal_mlx.is_init_called = true;
gfxInitDefault();
gfxSetDoubleBuffering(GFX_TOP, false);
gfxSetDoubleBuffering(GFX_BOTTOM, false);
gfxInit(FRAMEBUFFER_FORMAT, FRAMEBUFFER_FORMAT, false);
consoleInit(GFX_BOTTOM, NULL);
C2D_Init(SIZE_MAX); // TODO C2D use SIZE_MAX?
C2D_Prepare(); // TODO C2D overrides gfxInit??
return (&g_internal_mlx);
}

View file

@ -16,6 +16,10 @@
# include "3ds.h"
# include "mlx_events.h"
# define FRAMEBUFFER_FORMAT GSP_RGBA8_OES // GSPGPU_FramebufferFormat
# define FRAMEBUFFER_BPP 32 // must be coherent with above
# define FRAMEBUFFER_ENDIAN 0 // ??? // must be coherent with above
/// @brief Write an error message and exit the program.
///
/// @param msg Message to write. Must use less than 38 colons.