diff options
author | Sven Gothel <[email protected]> | 2023-01-15 03:46:18 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-01-15 03:46:18 +0100 |
commit | 7f9c117d01f5eba1af5bf5843480f7d9ff7ce4a0 (patch) | |
tree | 47c0ad122e2d74c90ae48ad53abdfeb11855e104 /src/jogl/classes/jogamp | |
parent | 0df8f2042a1bcb1c5995c3546f1ea9ab3e844170 (diff) |
Moved GlueGen's PlatformPropsImpl's static OSXVersion to GLContextImpl.MacOSVersion
Diffstat (limited to 'src/jogl/classes/jogamp')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLContextImpl.java | 29 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java | 6 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index 6baae35f9..d97e0e201 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -86,6 +86,29 @@ import com.jogamp.opengl.GLPipelineFactory; import com.jogamp.opengl.GLProfile; public abstract class GLContextImpl extends GLContext { + + /** Selected {@link Platform.OSType#MACOS} or {@link Platform.OSType#IOS} {@link VersionNumber}s. */ + public static class MacOSVersion { + /** OSX Lion, i.e. 10.7.0 */ + public static final VersionNumber Lion; + /** OSX Mavericks, i.e. 10.9.0 */ + public static final VersionNumber Mavericks; + /** OSX Mojave, i.e. 10.14.0 */ + public static final VersionNumber Mojave; + + static { + if( Platform.getOSType() == Platform.OSType.MACOS ) { + Lion = new VersionNumber(10,7,0); + Mavericks = new VersionNumber(10,9,0); + Mojave = new VersionNumber(10,14,0); + } else { + Lion = null; + Mavericks = null; + Mojave = null; + } + } + } + /** * Context full qualified name: display_type + display_connection + major + minor + ctp. * This is the key for all cached GL ProcAddressTables, etc, to support multi display/device setups. @@ -1227,7 +1250,7 @@ public abstract class GLContextImpl extends GLContext { // ensuring proper user behavior across platforms due to different feature sets! // if( Platform.OSType.MACOS == Platform.getOSType() && - Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Mavericks) >= 0 ) { + Platform.getOSVersionNumber().compareTo(MacOSVersion.Mavericks) >= 0 ) { /** * OSX 10.9 GLRendererQuirks.GL4NeedsGL3Request, quirk is added as usual @ setRendererQuirks(..) */ @@ -2324,7 +2347,7 @@ public abstract class GLContextImpl extends GLContext { } quirks.addQuirk( quirk ); } - if( Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Mavericks) >= 0 && 3==reqMajor && 4==hasMajor ) { + if( Platform.getOSVersionNumber().compareTo(MacOSVersion.Mavericks) >= 0 && 3==reqMajor && 4==hasMajor ) { final int quirk = GLRendererQuirks.GL4NeedsGL3Request; if(DEBUG) { System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", OS Version "+Platform.getOSVersionNumber()+", req "+reqMajor+"."+reqMinor); @@ -2340,7 +2363,7 @@ public abstract class GLContextImpl extends GLContext { } quirks.addQuirk( quirk ); } - if( Platform.getOSVersionNumber().compareTo(Platform.OSXVersion.Lion) < 0 ) { // < OSX 10.7.0 w/ NV has unstable GLSL + if( Platform.getOSVersionNumber().compareTo(MacOSVersion.Lion) < 0 ) { // < OSX 10.7.0 w/ NV has unstable GLSL final int quirk = GLRendererQuirks.GLSLNonCompliant; if(DEBUG) { System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: OS "+Platform.getOSType()+", OS Version "+Platform.getOSVersionNumber()+", Renderer "+glRenderer); diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java index cf9924b26..2c200b664 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java @@ -108,15 +108,15 @@ public class MacOSXCGLContext extends GLContextImpl static { final VersionNumber osvn = Platform.getOSVersionNumber(); - if( osvn.compareTo(Platform.OSXVersion.Mojave) >= 0 ) { + if( osvn.compareTo(MacOSVersion.Mojave) >= 0 ) { isLionOrLater = true; isMavericksOrLater = true; isMojaveOrLater = true; - } else if( osvn.compareTo(Platform.OSXVersion.Mavericks) >= 0 ) { + } else if( osvn.compareTo(MacOSVersion.Mavericks) >= 0 ) { isLionOrLater = true; isMavericksOrLater = true; isMojaveOrLater = false; - } else if( osvn.compareTo(Platform.OSXVersion.Lion) >= 0 ) { + } else if( osvn.compareTo(MacOSVersion.Lion) >= 0 ) { isLionOrLater = true; isMavericksOrLater = false; isMojaveOrLater = false; |