2022-10-23 03:00:51 +02:00
|
|
|
#pragma once
|
|
|
|
|
2022-11-09 02:14:49 +01:00
|
|
|
#include <SDL.h>
|
2022-10-23 03:00:51 +02:00
|
|
|
|
|
|
|
struct Screen;
|
|
|
|
|
2022-10-23 03:50:51 +02:00
|
|
|
typedef void (*ScreenDrawF)(struct Screen *screen);
|
2022-10-24 02:18:05 +02:00
|
|
|
typedef void (*ScreenKeyPressedF)(int sdl_scancode);
|
|
|
|
typedef void (*ScreenKeyReleasedF)(int sdl_scancode);
|
|
|
|
typedef void (*ScreenMousePressedF)(int button);
|
|
|
|
typedef void (*ScreenMouseReleasedF)(int button);
|
|
|
|
typedef void (*ScreenMouseMovedF)(int dx, int dy);
|
2022-10-23 03:00:51 +02:00
|
|
|
|
|
|
|
struct Screen {
|
|
|
|
int Width;
|
|
|
|
int Height;
|
|
|
|
SDL_Texture *Texture;
|
|
|
|
|
|
|
|
ScreenDrawF Draw;
|
|
|
|
ScreenKeyPressedF KeyPressed;
|
|
|
|
ScreenKeyReleasedF KeyReleased;
|
|
|
|
ScreenMousePressedF MousePressed;
|
|
|
|
ScreenMouseReleasedF MouseReleased;
|
|
|
|
ScreenMouseMovedF MouseMoved;
|
|
|
|
};
|
|
|
|
|
|
|
|
void ScreenInit();
|
|
|
|
|
|
|
|
void ScreenDraw();
|
|
|
|
|
|
|
|
int ScreenProcessEvents();
|
|
|
|
|
2022-10-23 03:50:51 +02:00
|
|
|
struct SDL_Texture *ScreenGetTexture(struct Screen *screen);
|
2022-10-23 03:00:51 +02:00
|
|
|
|
2022-10-23 22:16:40 +02:00
|
|
|
void ScreenCreate(
|
|
|
|
int w, int h,
|
2022-10-23 03:00:51 +02:00
|
|
|
ScreenDrawF draw,
|
|
|
|
ScreenKeyPressedF keypressed,
|
|
|
|
ScreenKeyReleasedF keyreleased,
|
|
|
|
ScreenMousePressedF mousepressed,
|
|
|
|
ScreenMouseReleasedF mousereleased,
|
|
|
|
ScreenMouseMovedF mousemoved
|
|
|
|
);
|