Re: raylibshim - A shim library for Euphoria and Raylib

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu