I'm running the following code in a 2015 13'' macbook pro:
public void display(GLAutoDrawable drawable) { try { GL4 gl=(GL4)GLContext.getCurrentGL(); String glVersion=gl.glGetString(GL_VERSION) ; System.out.println("glVersion="+glVersion); float bkg[] = { 0f, .5f, 0f, 0f }; FloatBuffer bkgBuffer = Buffers.newDirectFloatBuffer(bkg); gl.glClearBufferfv(GL_COLOR, 0, bkgBuffer); checkGLError(gl); }catch(Throwable th) { Log.printCaughtExceptionMsg(th); throw new Error(th); } } The result for the line System.out.println("glVersion="+glVersion); is: glVersion=2.1 INTEL-12.8.38 My question is how can I force the glVersion to be 4.0 instead of 2.1? I know I have to force JOGL to use the core profile but I do not know how. Your help is greatly appreciated. |
Hi,
by default the graphic driver of OSX will be started in compatibility mode which is 2.1 you have to request the higher version explicit final GLProfile profile = GLProfile.get(GLProfile.GL4); final GLCapabilities glcapabilities = new GLCapabilities(profile); final GLJPanel gljpanel = new GLJPanel(glcapabilities);
Mit freundlichen Grüßen Kai Uwe Bachmann E-mail Disclaimer: Diese Email wurde von BKA, NSA und GCHQ auf Freiheit gefährdende Inhalte untersucht und zur späteren Verwendung in Geheimprozesse archiviert. Bombe, Attentat, Sprengstoff, Terrorism, Nuclear, Infrastructure, Security, Safety, Attack, Toxic, Bacteria, Ebola, Influenza, Resistant, Airport, Telecommunications, Smart Power, Bridge, Pirates, Schweinefleisch, Trojan, Bart, Southwest, bridge, china, mexico, agro, car, incident |
Administrator
|
Hello
Your solution should work and is correct if your program requires at least OpenGL4 (core, forward compatible) but GLProfile.getMaxProgrammable(true) or GLProfile.getMaximum(true) would be safer if you require the highest core profile or the most capable profile.
Julien Gouesse | Personal blog | Website
|
Hi,
theoretically is getMaxProgrammable or getMaximum the better solution but it doesn’t work with actual OSX versions. As I’ve told, OSX starts in compatibility mode which is 2.1 and the max-calls returns exactly this.
Mit freundlichen Grüßen Kai Uwe Bachmann E-mail Disclaimer: Diese Email wurde von BKA, NSA und GCHQ auf Freiheit gefährdende Inhalte untersucht und zur späteren Verwendung in Geheimprozesse archiviert. Bombe, Attentat, Sprengstoff, Terrorism, Nuclear, Infrastructure, Security, Safety, Attack, Toxic, Bacteria, Ebola, Influenza, Resistant, Airport, Telecommunications, Smart Power, Bridge, Pirates, Schweinefleisch, Trojan, Bart, Southwest, bridge, china, mexico, agro, car, incident |
Administrator
|
On 9/5/19 5:44 PM, kai.bachmann [via jogamp] wrote:
> Hi, > > theoretically is getMaxProgrammable or getMaximum the better solution but it > doesn’t work with actual OSX versions. As I’ve told, OSX starts in > compatibility mode which is 2.1 and the max-calls returns exactly this. Thank you Kai, you are probably aware of the current 2.4.0 work. Still working on the AWT related crash (OSX) and some other issues using Mesa Software Renderer (Linux, but should be others too). I will test your issue here as well, even though I haven't seen this test to fail (a few GLProfile unit tests selecting the profile). If you feel adventurous, checkout the Java11 branch (gluegen, joal and jogl) and test yourself. For this please follow the <product>/doc/HowToBuild.html in Gluegen + JOGL. Thank you. ~Sven > >> Am 05.09.2019 um 12:31 schrieb gouessej [via jogamp] <[hidden email]>: >> >> Hello >> >> Your solution should work and is correct if your program requires at least >> OpenGL4 (core, forward compatible) but GLProfile.getMaxProgrammable(true) or >> GLProfile.getMaximum(true) would be safer if you require the highest core >> profile or the most capable profile. >> Julien Gouesse | Personal blog <http://gouessej.wordpress.com/> | Website >> <http://tuer.sourceforge.net/> >> >> |
In reply to this post by kai.bachmann
Thanks for the help. This fixed it.
|
Administrator
|
In reply to this post by kai.bachmann
Ok, it's not the expected behaviour and should be fixed within JOGL. Would you like to fill a bug report so that we don't forget this problem?
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |