mlx3ds/source/mlx_internal.cpp
Zy 13b93106ee part: implement some functions (windows & display)
part:
- remove mlx3ds_3dskey.h, instead use hid.h
- add definitions of:
  - mlx_init()
  - mlx_new_window()
  - mlx_clear_window()
  - mlx_destroy_window()
  - mlx_pixel_put()
  - mlx_new_image()
  - mlx_get_data_addr()
  - mlx_put_image_to_window()
  - mlx_destroy_image()

dev:
- Makefile: add rule check_headers
- Makefile: add variable FLAGS
    (call 'make rule FLAGS=flags'
	to add flags to compilation)
- add /dev/norm.sh: nicer norminette
- add tester in main(), and related utilsconsole.*

docs:
- make clear mlx_get_data_addr() docs
2024-10-06 16:53:59 +02:00

35 lines
727 B
C++

/**
* mlx_internal.cpp
* for the project "MinilibX for 3DS"
* by Zy
* at https://github.com/frzysk/mlx3ds
*/
#include "utilsconsole.hpp"
extern "C" {
#include "mlx_internal.h"
#include "3ds.h"
void mlx3ds_internal_fatalerror(const char *msg)
{
consoleInit(GFX_BOTTOM, NULL);
printf("\e[0;31m[mlx3ds] Fatal error:\e[0m\n%s\n", msg);
uc_pause();
}
void mlx3ds_internal_drawstart(
t_internal_mlx *mlx_ptr, t_internal_win *win_ptr)
{
win_ptr->framebuffer = gfxGetFramebuffer(GFX_TOP, GFX_LEFT,
&win_ptr->framebuffer_height, &win_ptr->framebuffer_width);
gspWaitForVBlank();
}
void mlx3ds_internal_drawend(
t_internal_mlx *mlx_ptr, t_internal_win *win_ptr)
{
gfxFlushBuffers();
gfxSwapBuffers();
}
}