Page 1 of 1

[Implemented] Double floats for 3.92

Posted: Thu Oct 14, 2004 9:53 pm
by Moonshine
Firstly, I know this subject has been discussed many times before and everything, but my question is:

Is there ANY possibility that double floats will be included in the full release of v3.92?

Only I'm doing some work in OpenGL and am having to resort to wrappers (which only cover a handfull of the supported OGL functions, no extensions) and I'm coming to a standstill.

Ive already tried userlibs such as F64 but OpenGL doesnt accept it.

Cheers :)

Posted: Thu Oct 14, 2004 10:00 pm
by Codemonger
Hi Moonshine,

Curious what parts of opengl do you need doubles for ? you can probably write the needed code in PB without doubles.

Posted: Thu Oct 14, 2004 10:28 pm
by Moonshine
glClearDepth() for one, and also gluPerspective(). If the F64 userlib couldnt do it, then I doubt it could be emulated in code. It complained of invalid number of parameters or somesuch. Theres also a speed issue when not using native types.

Posted: Fri Oct 15, 2004 4:55 am
by Progs
Just download glWrapper and use
glClearDepth__()
a dunno why you need 64 bit for 1.0 :)
glClearDepth__( 1.0 )

Posted: Fri Oct 15, 2004 11:00 am
by Moonshine
Progs wrote:Just download glWrapper and use
glClearDepth__()
a dunno why you need 64 bit for 1.0 :)
glClearDepth__( 1.0 )
Thats the thing, I am already using glWrapper, but when it comes to using extensions that require doubles then Im screwed :?

I cant understand the need for doubles with glClearDepth, but it wont take a regular float so Im guessing thats why it was wrapped :lol:

Posted: Fri Oct 15, 2004 1:14 pm
by Progs
Dunno...
Im making small 3d engine and have no problems...

here part of init function

Code: Select all

    glEnable_(#GL_DEPTH_TEST)
    glDepthFunc_(#GL_LESS) 
    glClearDepth__( 1.0 ) ;no problems here !    
    glBlendFunc_(#GL_SRC_ALPHA, #GL_ONE_MINUS_SRC_ALPHA)
And what extention whants double floats :?:

Posted: Fri Oct 15, 2004 1:22 pm
by Karbon
I think it has already been said that doubles will appear in 4.0 and not before..

Posted: Fri Oct 15, 2004 1:23 pm
by Dare2
Regardless of why, double precision float native to PB is a very desirable thing.

Essential for some things.

I have several finance company's running (very old) apps and the precision is important, as is the total value. With PB handling doubles, the old dos code could be converted to PB.

(Sorry to hijack, just really keen for double precision)

PS: If PB has a 4-byte legacy bias that makes this difficult, I could live with doubles being handled same way as strings, eg, 4 byte pointer to the real value. As long as it looks and behaves like part of PB.

Posted: Fri Oct 15, 2004 1:23 pm
by wilbert
I don't know anything about OpenGL but taking a quick look at it, it seems that the glClearDepth_() and gluPerspective_() require a double float to be specified as two seperate values so you have to specify 2 values for glClearDepth and 8 for gluPerspective.

You could try if the code below will help you. Since I don't know how these functions should work, I don't know if they expect the parameters this way.

Code: Select all

Procedure.l dfHigh(value.f)
 ! fld dword [esp]
 ! push eax
 ! push eax
 ! fstp qword [esp]
 ! add esp,4
 ! pop eax
 ProcedureReturn
EndProcedure

Procedure.l dfLow(value.f)
 ! fld dword [esp]
 ! push eax
 ! push eax
 ! fstp qword [esp]
 ! pop eax
 ! add esp,4
 ProcedureReturn
EndProcedure

gluPerspective_(dfLow(fovy.f), dfHigh(fovy.f), dfLow(aspect.f), dfHigh(aspect.f), dfLow(zNear.f), dfHigh(zNear.f), dfLow(zFar.f), dfHigh(zFar.f))

Posted: Sun Oct 17, 2004 1:07 am
by Moonshine
Ive also just hit a point where a high resolution timer is required, yet there is no way to store the data with an equally high resolution of accuracy. Hmmm.

Posted: Sun Oct 17, 2004 5:54 pm
by geoff
Karbon wrote:I think it has already been said that doubles will appear in 4.0 and not before..
Does anyone know when?
I've been holding my breath for a couple of years now.

Posted: Sun Oct 17, 2004 6:13 pm
by Karbon
All I've ever heard the developer(s) say is that it will happen when it happens.. I don't think they have set any kind of release date. I'd say you better be prepared to hold your breath for a while longer.