How can i use unsigned bytes ?

Everything else that doesn't fall into one of the other PB categories.
Progs
User
User
Posts: 21
Joined: Sun Sep 19, 2004 12:42 pm
Location: Russia/Moscow

How can i use unsigned bytes ?

Post 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 ?
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post by KarLKoX »

ubyte.b = value & $FF
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post 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
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Progs
User
User
Posts: 21
Joined: Sun Sep 19, 2004 12:42 pm
Location: Russia/Moscow

Post by Progs »

Txs !!
:!:
Post Reply