diff --git a/TODO b/TODO index 8451048..2a45ae2 100644 --- a/TODO +++ b/TODO @@ -8,3 +8,4 @@ TODO mlx_exit() TODO hook functions should be compatible again TODO mlx_init: use GSP_RGBA8_OES, and change mlx_get_data_addr accordingly +TODO use GSPGPU diff --git a/include/mlx_init.h b/include/mlx_init.h index 64ab72d..aebcb74 100644 --- a/include/mlx_init.h +++ b/include/mlx_init.h @@ -34,6 +34,6 @@ /// NULL if failed. t_mlx mlx_init(void); // TODO should call this before REALLY anything else? -// TODO mlx_end() or something? mlx_destroy_display()? +// TODO mlx_end() or something? mlx_destroy_display()? (with C2D_Fini()) #endif diff --git a/source/mlx_init.c b/source/mlx_init.c index 4876ac5..b8dfa28 100644 --- a/source/mlx_init.c +++ b/source/mlx_init.c @@ -10,6 +10,7 @@ #include "mlx_internal.h" #include #include "3ds.h" +#include 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); } diff --git a/source/mlx_internal.h b/source/mlx_internal.h index db5018d..510998f 100644 --- a/source/mlx_internal.h +++ b/source/mlx_internal.h @@ -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. diff --git a/wiki/BASICS.mc b/wiki/BASICS.mc index 3090d9b..d50611c 100644 --- a/wiki/BASICS.mc +++ b/wiki/BASICS.mc @@ -6,3 +6,5 @@ How to change a original MinilibX project to a 3DS one: - main must be main(void) - new inputs - use assets instead of files +- change big malloc/free to linearAlloc/linearFree +- change color format and adapt everything