Re: raylibshim - A shim library for Euphoria and Raylib
- Posted by ghaberek (admin) Jul 20, 2019
- 1236 views
Here's something I did to make passing structures-by-value a bit easier.
First, create a sequence containing the required types:
constant C_STRING = C_POINTER constant C_IMAGE = { C_POINTER, -- void* data C_INT, -- int width C_INT, -- int height C_INT, -- int mipmaps C_INT -- int format }
Then, instead of passing the types as {C_TYPE,C_TYPE,...} append them together, like this:
constant shimLoadTexture = define_c_proc( raylibshim, "+shimLoadTexture", C_STRING & C_POINTER ), shimLoadTextureFromImage = define_c_proc( raylibshim, "+shimLoadTextureFromImage", C_IMAGE & C_POINTER ), $
This makes it a lot easier to read and manage.
-Greg