Page 1 of 1

How can i use unsigned bytes ?

Posted: Tue Nov 02, 2004 8:33 am
by Progs
It is possible ?
I need them to store OpenGL color values..
so i have vertex

Code: Select all

Structure mae_2dvertex  
    ;GL_T2F_C4UB_V3F
    uv.f[2]
    color.b[4]
    pos.f[3]
EndStructure
i cant use floats in this vertex type (GL_T2F_C4UB_V3F) and i dont want to use different type.

and i have troubles with colors :(
any ideas ?

Posted: Tue Nov 02, 2004 9:08 am
by KarLKoX
ubyte.b = value & $FF

Posted: Tue Nov 02, 2004 9:26 am
by tinman
KarLKoX wrote:ubyte.b = value & $FF
You need to use a bigger size of variable to store the unsigned result or manipulate it.

ubyte.w = value & $FF

Posted: Tue Nov 02, 2004 9:44 am
by Progs
Txs !!
:!: