mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
adding graphics support class, refactoring the code
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 17:35:20 by maldavid #+# #+# */
|
||||
/* Updated: 2023/04/01 17:48:21 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/04/02 15:10:44 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -25,12 +25,12 @@ extern "C"
|
||||
|
||||
void* mlx_new_window(void* mlx, int w, int h, const char* title)
|
||||
{
|
||||
return static_cast<mlx::core::Application*>(mlx)->new_window(w, h, title);
|
||||
return static_cast<mlx::core::Application*>(mlx)->newGraphicsSuport(w, h, title);
|
||||
}
|
||||
|
||||
int mlx_loop_hook(void* mlx, int (*f)(void*), void* param)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->loop_hook(f, param);
|
||||
static_cast<mlx::core::Application*>(mlx)->loopHook(f, param);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ extern "C"
|
||||
|
||||
int mlx_loop_end(void* mlx)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->loop_end();
|
||||
static_cast<mlx::core::Application*>(mlx)->loopEnd();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -58,48 +58,48 @@ extern "C"
|
||||
|
||||
int mlx_mouse_move(void* mlx, void* win_ptr, int x, int y)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->mouse_move(win_ptr, x, y);
|
||||
static_cast<mlx::core::Application*>(mlx)->mouseMove(win_ptr, x, y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx_mouse_get_pos(void* mlx, int* x, int* y)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->get_mouse_pos(x, y);
|
||||
static_cast<mlx::core::Application*>(mlx)->getMousePos(x, y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx_put_image_to_window(void* mlx_ptr, void* win_ptr, void* img_ptr, int x, int y)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->texture_put(win_ptr, img_ptr, x, y);
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->texturePut(win_ptr, img_ptr, x, y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx_destroy_image(void* mlx_ptr, void* img_ptr)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->destroy_texture(img_ptr);
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->destroyTexture(img_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* mlx_png_file_to_image(void* mlx_ptr, char* filename, int* width, int* height)
|
||||
{
|
||||
return static_cast<mlx::core::Application*>(mlx_ptr)->new_stb_texture(filename, width, height);
|
||||
return static_cast<mlx::core::Application*>(mlx_ptr)->newStbTexture(filename, width, height);
|
||||
}
|
||||
|
||||
int mlx_pixel_put(void* mlx, void* win_ptr, int x, int y, int color)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->pixel_put(win_ptr, x, y, color);
|
||||
static_cast<mlx::core::Application*>(mlx)->pixelPut(win_ptr, x, y, color);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx_clear_window(void* mlx_ptr, void* win_ptr)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->clear_window(win_ptr);
|
||||
static_cast<mlx::core::Application*>(mlx_ptr)->clearGraphicsSupport(win_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mlx_destroy_window(void* mlx, void* win_ptr)
|
||||
{
|
||||
static_cast<mlx::core::Application*>(mlx)->destroy_window(win_ptr);
|
||||
static_cast<mlx::core::Application*>(mlx)->destroyGraphicsSupport(win_ptr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user