Re: Type check failure (New problem now)

new topic     » goto parent     » topic index » view thread      » older message » newer message
Icy_Viking said...

Ok now I can't figure out why the color won't work. I have them assigned as r,g,b,a values, but only red appears to be working.

--Wrapper code 
public constant xClearBackground = define_c_proc(ray,"+ClearBackground",{C_UCHAR,C_UCHAR,C_UCHAR,C_UCHAR}) 

I'm pretty sure that this method still passes the arguments to the function as 4-byte values. It's just going to ensure they're the lower 8 bits and strip the upper 24 bits.

Try packing the values into a single C_UINT value instead. Use bytes_to_int({ r, g, b, a }) and pass that as a single argument to ClearBackground.

typedef struct Color { 
    unsigned char r; 
    unsigned char g; 
    unsigned char b; 
    unsigned char a; 
} Color; 
 
RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) 

-Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu