Crates.io | lexsdl |
lib.rs | lexsdl |
version | 0.3.0 |
source | src |
created_at | 2023-01-27 19:18:25.67843 |
updated_at | 2023-02-06 21:14:00.102148 |
description | A wrapper for SDL2 to abstract away annoying parts |
homepage | |
repository | https://gitlab.com/Alexevier/lexsdl |
max_upload_size | |
id | 769855 |
size | 194,552 |
A SDL2 wrapper (under development) for C and Rust.
Once SDL3 is stable it will be used.
The documentation can be found as a download in the releases page <a href=https://gitlab.com/Alexevier/lexsdl/-/releases>here.
Some functions are implemented in rust but there is no need for a rust compiler as in the releases page are compiled libs available for Linux 32/64 bits and Windows 32/64 bits.
The .a might be big but it doesn't affect the final binary size.
For linux a install script is available.
It is still necessary to have SDL installed and a C compiler even on Rust.
On Rust a safe wrapper is in progress, use of unsafe still necessary.
It can be used in existing projects without beeing disruptive. (in the documentation is more info and full examples)
// the easiest is to set the window and the renderer
SDL_Window *yourSdlWindow = SDL_CreateWindow(..);
SDL_Renderer *yourSdlRenderer = SDL_CreateRenderer(..);
LEXSDL_SetWindow(yourSdlWindow);
LEXSDL_SetRenderer(youtSdlRenderer);
// now it can be used with the rest of the lib
LEXSDL_NewFrame();
/* draw textures and stuff */
LEXSDL_ShowFrame();