I have been using dglopengl to support GLSL shaders a while now.
Most of the time it all works as expected, but I have a strange issue on a few PCs. This also seems to only happen with dual monitor setups it seems, but when I got a second monitor for my development PC it didn't show the issue. When I check for GLSL support their screen flickers black for a second. If the person has their desktop scaled to 150% this also causes windows to move around and is annoying.
This is the code I use when checking if the PC can support GLSL
Code: try GLSL_DC:=form1.canvas.handle; InitOpenGL; GLSL_RC := CreateRenderingContext(GLSL_DC, [opDoubleBuffered,opGDI], 32, 24, 0, 0, 0, 0); ActivateRenderingContext(GLSL_DC, GLSL_RC); ReadImplementationProperties; ReadOpenGLCore; parselst:=tstringlist.create; versionstr:=string(glGetString(GL_SHADING_LANGUAGE_VERSION)); parse(versionstr,' ',parselst,true); if strtofloat(parselst[0])<3 then GLSL_Available:=false else GLSL_Available:=true; parselst.free; GLSL_Available:=true; except GLSL_Available:=false; end;
InitOpenGL, ReadImplementationProperties and ReadOpenGLCore are all the default code from dglopengl. GLSL_DC is a Windows.HDC GLSL_RC is a Windows.HGLRC
Is there anything I am doing wrong there? Is there a more bullet proof way of checking for GLSL support?
|