27 lines
642 B
C
27 lines
642 B
C
/**
|
|
* mlx_init.c
|
|
* for the project "MinilibX for 3DS"
|
|
* by Zy
|
|
* at https://github.com/frzysk/mlx3ds
|
|
*/
|
|
|
|
#include "mlx_init.h"
|
|
|
|
#include "mlx_internal.h"
|
|
#include <stdlib.h>
|
|
#include "3ds.h"
|
|
#include <citro2d.h>
|
|
|
|
static t_internal_mlx g_internal_mlx;
|
|
|
|
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;
|
|
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);
|
|
}
|