Hi, I am busy writing shaders. I need to check which version of openGL is available in purebasic and found no info on that at all. Can someone clarify that please?
I use PB 6.21 (x64) on linux Zorin. I need a minimum of openGL 4.5 . The hardware goes up to 4.6 .
glfw has GLFW_VERSION_MAJOR and GLFW_VERSION_MINOR, at context creation. Can we access that from PB ?
opengl version
Re: opengl version
Up to PB 6.12 it was possible to let Ogre generate a debug log and read the Ogre version from that log. I have already posted a cross-platform example here which gets the Ogre version and displays it.
Unfortunately beginning with PB 6.20 the Ogre debug log always remains empty. I therefore have already posted this bug report.
Unfortunately beginning with PB 6.20 the Ogre debug log always remains empty. I therefore have already posted this bug report.
Collection of cross-platform examples with API functions to extend PureBasic
Re: opengl version
If you're using PBs OpenGLgadget(), then you could try the code below (from Win x64, but may work in Linux):
Code: Select all
OpenWindow(0,0,0,640,480,"")
OpenGLGadget(0,0,0,640,480)
Define version.s, major.l, minor.l
version = PeekS(glGetString_(#GL_VERSION),-1,#PB_Ascii)
#GL_MAJOR_VERSION = $821B
#GL_MINOR_VERSION = $821C
glGetIntegerv_(#GL_MAJOR_VERSION, @major);
glGetIntegerv_(#GL_MINOR_VERSION, @minor);
Debug version
Debug major
Debug minorRe: opengl version
You can use any available opengl shader version, the restriction will be on the hardware that runs it. Is it necessary to be able to execute on older cards, or you are fine with only with the latest/more recent cards.


