glSelectBuffer float value for depth
BlitzMax Forums/OpenGL Module/glSelectBuffer float value for depth
| ||
in glSelectBuffer the buffer is an int ptr, where really, it should be a bank ptr so you can peekint the name and peekfloat the depth (is this a bug?) I can't seem to cast a bank ptr to an int ptr giving it an array of ints works but the depth comes back as a very large -tive value for near getting nearer zero as the distance increases any ideas? |
| ||
turns out its suposed to be an int... 0-1 * 2^32-1 try as I might I cant convert this to a float 0-1... help! |
| ||
to pass multiple values you can do this,local val:int[2] val[0]=32 val[1]=16 local cast:int ptr cast = int ptr(var ptr val[0]) |
| ||
?? how would this help? |
| ||
Oh well, it was what you asked so I assumed it was what you wanted to know..:) Your second post seems to be asking how to convert an int into a floating range of 0.1? If so, this'll do it, Function IntToFloat:Float( IntVal:Int,MaxVal:Int ) return float(maxVal)/float(intVal) end function Max range being the highest value an int will reach.(This'll result in 1) Sorry if I'm mis-understood again, i'm not all that good at maths... |
| ||
its not quite that simple have a look @ my bsp loader, you'll see what I mean... |