GL4 not working in JOGL macbook pro

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

GL4 not working in JOGL macbook pro

Felipe
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.

Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

kai.bachmann
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);


Am 05.09.2019 um 06:55 schrieb Felipe [via jogamp] <[hidden email]>:

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.




If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/GL4-not-working-in-JOGL-macbook-pro-tp4040031.html
To start a new topic under jogl, [hidden email]
To unsubscribe from jogamp, click here.
NAML

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







Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

gouessej
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
Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

kai.bachmann
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.

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 | Website



If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/GL4-not-working-in-JOGL-macbook-pro-tp4040031p4040033.html
To start a new topic under jogl, [hidden email]
To unsubscribe from jogamp, click here.
NAML

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







Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

Sven Gothel
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/>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

Felipe
In reply to this post by kai.bachmann
Thanks for the help. This fixed it.
Reply | Threaded
Open this post in threaded view
|

Re: GL4 not working in JOGL macbook pro

gouessej
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