Abstract, software accelerated (CPU-only) engine for older hardware
Go to file
2023-05-14 17:26:33 +02:00
assets First commit 2023-05-14 12:21:03 +02:00
modules/engine First commit 2023-05-14 12:21:03 +02:00
engine First commit 2023-05-14 12:21:03 +02:00
main.c First commit 2023-05-14 12:21:03 +02:00
README.txt Add events 2023-05-14 17:26:33 +02:00
run First commit 2023-05-14 12:21:03 +02:00
test.c First commit 2023-05-14 12:21:03 +02:00

A software accelerated (CPU-only) game engine for older computers. It uses a layer of abstraction, so different implementations can be ported to it. It primarily uses SDL2. This can also be used to more easily port the engine to different consoles.

>>> FUNCTIONS
>> WINDOW
> void engine_init(int width,int height,char * title)
> void engine_setColor(char r,char g,char b,char a)
> void engine_drawPixel(int x,int y)
> void engine_render()

>> TIME
> long long engine_time_get()
> void engine_sleep(long long ms)

>> LOGIC
> struct ENGINE_EVENT engine_get_event()

>> TEXTURES
struct ENGINE_TEXTURE engine_createTexture(int width,int height)
> void engine_textureSetColor(char r,char g,char b,char a)
> void engine_textureDrawPixel(struct ENGINE_TEXTURE * texture,int x,int y)
> void engine_textureDestroy(struct ENGINE_TEXTURE * texture)
> void engine_renderTexture2D(struct ENGINE_TEXTURE * texture,int sx,int sy)
> void engine_fileToTexture(struct ENGINE_TEXTURE * texture,char * fpath)

>>> EVENTS
ENGINE_EVENT contains a char denoting the type (ENGINE_EVENT_TYPE_*), and a void * containing the content of the event data, which should be cast to one of the ENGINE_EVENT_* structs:
> ENGINE_EVENT_TYPE_UNKNOWN: ENGINE_EVENT_UNKNOWN{}
> ENGINE_EVENT_TYPE_NONE:    ENGINE_EVENT_NONE{}
> ENGINE_EVENT_TYPE_EXIT:    ENGINE_EVENT_EXIT{}