• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

Detecting OpenGL compatibility?

Started by Patrice Terrier, October 23, 2007, 11:28:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

Do you know how to detect if host computer is able to run OpenGL?

I would like to add this feature to BassBox, to avoid infamous GPF when people are using shared video memory or when the hardware is not OpenGL compatible.

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

#1
Hi Patrice,

try to use glGetString(%GL_VENDOR), UCASE$ result and if word "MICROSOFT" is present, than OpenGL is running in mode provided by Windows, which means very slow software mode ( to be fair, not so slow as long as no textures ). But unless you go higher than OpenGL 1.1 specs ( just gl.h, not glext.h ), GPF should not occur in either case!

We have notebook with onboard Intel card at home, and altough it is not killer one, OpenGL runs pretty well althought it has shared memory.
The same my onboard GeForce 6150: 128 own + 128 MB shared and no problems.

I think problem of William Burns could be buggy drivers. I started OpenGL coding on "Trident Blade 3D" card, with NO OpenGL support, but it still ran ( slow ) on software. Even my friend had Voodoo2 with old drivers, and it did not GPFed, just ran very slow.

Last option is that there is a bug in GL code, some hard to reveal. You could try to profile your program with GLIntercept. It is fantastic diagnostic tool. You just copy new OpenGL32.DLL to directory with your proggie + ini file with debug config, then run program and voila - log files are created :) It reports undeleted textures and lists, and all kind of very valuable information.

I get on my PC following ( for BassBox ), but it won't cause GPF on my PC, on other maybe yes:
Quote
GL Intercept Log. Version : 0.5    Compile Date: Dec  3 2005    Run on: Tue Oct 23 12:54:53 2007

===================================================
Function glViewport is being called before context creation
Call to glViewport made outside of context/init
Function glMatrixMode is being called before context creation
Call to glMatrixMode made outside of context/init
Function glLoadIdentity is being called before context creation
Call to glLoadIdentity made outside of context/init
Function glMatrixMode is being called before context creation
Call to glMatrixMode made outside of context/init
===================================================
Log End.

Bye,
Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

Petr,

Thank you very much for the provided informations, very useful!

glilog.txt helped me to solve errors in %WM_SIZE , because OpenGL was called before the control itself was created.

To fix it, just add the two lines in red below:

    CASE %WM_SIZE
         IF zComposited() THEN lRes& = zBeginDeferWindowPos(hWnd, 0)
         CALL zDrawBackground()
         CALL EnumChildWindows(hWnd, CODEPTR(AnchorEnum), lRes&)
         IF glRC THEN
            CALL ResizeGLwindow(zGetMainItem(%ID_OpenGL))
            CALL RenderOpenGL(zGetMainItem(%ID_OpenGL))
         END IF
         'CALL zUpdateWindow(hWnd, 0)
         IF zComposited() THEN CALL zEndDeferWindowPos(hWnd, lRes&)

the log file reports this extra error:
GL ERROR - Function wglGetPixelFormat generated error GL_INVALID_OPERATION
however BassBox doesn't use wglSetPixelFormat but zSetupPixelFormat
do you think this would cause havoc?
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

#3
Hi Patrice,

after the WM_SIZE modification I get no errors on my PC.

wglGetPixelFormat is action which GLIntercept adds on its own, to check if function really succeeded.
It is like checking ERR value in PB.

On which graphic card did you get this errror ?


Thanks,
Petr

P.S. 16 bit Z-Buffer should be faster, and for smaller scene like visualisations it should not hurt quality too much. For example older onboard Intels (i810) were lot slower in any mode higher than 16bit for depth.
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

#4
I have it on my notebook:
nVidia GeForce Go 7600 with video DDR 512 Mb
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

That is good beast,

do you have latest drivers ? ::) ( I know, I know )


Petr


AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

Yes you know, you know  ;)
and even the beta version...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com