Abstract, software accelerated (CPU-only) engine for older hardware
Go to file
mrtuxa_openbsd 1b9e028e75 added run but better 2023-08-10 19:47:28 +02:00
mods/main Make t local 2023-08-10 02:28:04 +02:00
patches/openbsd added OpenBSD Patch and make it runable 2023-08-09 20:02:47 +02:00
src Add function: engine_position_2d_to_tex 2023-08-10 05:31:29 +02:00
.gitignore Remove /src/lua.c 2023-08-09 21:15:10 +02:00
LICENSE Add LICENSE 2023-05-14 17:53:18 +02:00
README.txt Add prerequisite info 2023-08-09 20:56:58 +02:00
lua_translate Use unsigned char for colors 2023-06-13 06:06:42 +02:00
run added run but better 2023-08-10 19:47:28 +02:00

README.txt

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.

Compiles for Linux. If you want to compile for OpenBSD, run: git apply patches/openbsd/generic.patch

> Prerequisites, Debian/Ubuntu:
sudo apt install python3-toml libsdl2-dev liblua5.3-dev

> Prerequisites, OpenBSD:
* Enable ports: https://www.openbsd.org/faq/ports/ports.html
doas pkg_add py3-toml
cd /usr/ports/devel/sdl2
doas make
doas make install
cd /usr/ports/lang/lua/5.3
doas make
doas make install

>>> FUNCTIONS
>> WINDOW
> void engine_window_init(int width,int height,char * title)
> void engine_window_present()

>> SURFACE
> void engine_surface_color_set(char r,char g,char b,char a)
> void engine_surface_draw_pixel(int x,int y)

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

>> LOGIC
> struct ENGINE_EVENT * engine_event_get()

>> TEXTURES
> struct ENGINE_TEXTURE * engine_texture_create(int width,int height)
> void engine_texture_color_set(char r,char g,char b,char a)
> void engine_texture_draw_pixel(struct ENGINE_TEXTURE * texture,int x,int y)
> void engine_texture_destroy(struct ENGINE_TEXTURE * texture)
> void engine_texture_render_2d(struct ENGINE_TEXTURE * texture,int sx,int sy)
> void engine_texture_from_file(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{}