kapa76 / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

OpenGL Core Profile ContextAttribs not supported, correctly #545

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
this I'm posting here, because it really should be addressed as a bug or at 
worst, enhancement request. It's not getting any attention on the forum. 
Original " 
http://jmonkeyengine.org/groups/graphics/forum/topic/jme-lwjgl-opengl-3-2-core-p
rofile-and-mac-osx-10-7-contextattribs-issue/ "

The essence of the issue is that point releases of the gl profile are not 
supported; jme just drops to 2.x

More from the post:
OpenGL 3.2 is supported under the core profile with OSX 10.7+. In the 
LwjglContext if JME can’t find OpenGL 3.3 then it will fall all the way back 
to OpenGL 2. The “else” case does not set the core profile nor try 3.2, 
3.1, etc. So…  Just because JME shaders don’t currently use OpenGL 3 or 4 
features yet… does that mean it shouldn’t let others use those features? I 
am not sure how you would like to add the finer granularity do to the 
coarseness of the LWJGL_OPENGLX constants in AppSettings. (I suppose you could 
go with LWJGL_OPENGL3_2 or something like that) This is not a problem just for 
the mac, since PC users who want OpenGL 4.x features are going to have similar 
difficulty. 

From AppSettings.java:

/**
 * Set the graphics renderer to use, one of:<br>
 * <ul>
 * <li>AppSettings.LWJGL_OPENGL1 - Force OpenGL1.1 compatability</li>
 * <li>AppSettings.LWJGL_OPENGL2 - Force OpenGL2 compatability</li>
 * <li>AppSettings.LWJGL_OPENGL3 - Force OpenGL3.3 compatability</li>
 * <li>AppSettings.LWJGL_OPENGL_ANY - Choose an appropriate
 * OpenGL version based on system capabilities</li>
 * <li>null - Disable graphics rendering</li>
 * </ul>
 * @param renderer The renderer to set
 * (Default: AppSettings.LWJGL_OPENGL2)
 */
public void setRenderer(String renderer) {
    putString("Renderer", renderer);
}

And from LwjglContext.java...

protected ContextAttribs createContextAttribs(){
    if (settings.getBoolean("GraphicsDebug") || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
        ContextAttribs attr;
        if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)){
            attr = new ContextAttribs(3, 3);
            attr = attr.withProfileCore(true).withForwardCompatible(true).withProfileCompatibility(false);
        }else{
            attr = new ContextAttribs();
        }
        if (settings.getBoolean("GraphicsDebug")){
            attr = attr.withDebug(true);
        }
        return attr;
    }else{
        return null;
    }
}

Original issue reported on code.google.com by hca...@gmail.com on 10 Oct 2012 at 8:27

GoogleCodeExporter commented 9 years ago
Fixed in r9875

Original comment by ShadowIs...@gmail.com on 10 Nov 2012 at 8:52