aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChien Yang <[email protected]>2007-03-09 21:31:45 +0000
committerChien Yang <[email protected]>2007-03-09 21:31:45 +0000
commitc1ad5aac9f0ad6e1bed67c7a588c9463be71edf0 (patch)
treea617d3601efbba676b162acf3db518e43156477f /src
parenta84d004aa9539731b5d5daa382c1ca20c5c2b2c2 (diff)
Fixed a logic bug setting gl version flags.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@794 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r--src/classes/jogl/javax/media/j3d/JoglPipeline.java27
-rw-r--r--src/native/ogl/Canvas3D.c26
2 files changed, 26 insertions, 27 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglPipeline.java b/src/classes/jogl/javax/media/j3d/JoglPipeline.java
index 9d8a678..1d7d36a 100644
--- a/src/classes/jogl/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/jogl/javax/media/j3d/JoglPipeline.java
@@ -8414,23 +8414,24 @@ class JoglPipeline extends Pipeline {
boolean gl20 = false;
boolean gl14 = false;
boolean gl13 = false;
- if (major > 1) {
- // OpenGL 2.x -- set flags for 1.3 and 2.0 or greater
- gl20 = true;
- gl14 = true;
- gl13 = true;
- } else {
+
+ if (major == 1) {
if (minor == 2) {
System.err.println("JAVA 3D: OpenGL 1.2 detected; will run with reduced functionality");
- } else if ( minor == 4 ) {
- gl14 = true;
- gl13 = true;
- }
- else {
- gl13 = true;
+ } else {
+ if (minor >= 3) {
+ gl13 = true;
+ }
+ if (minor >= 4) {
+ gl14 = true;
+ }
}
+ } else /* major >= 2 */ {
+ gl13 = true;
+ gl14 = true;
+ gl20 = true;
}
-
+
if (gl20) {
assert gl13;
assert gl14;
diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c
index 0d50ff1..0b412f4 100644
--- a/src/native/ogl/Canvas3D.c
+++ b/src/native/ogl/Canvas3D.c
@@ -604,25 +604,23 @@ getPropertiesFromCurrentContext(
}
if (versionNumbers[0] > 1) {
- /* OpenGL 2.x -- set flags for 1.3, 1.4 and 2.0 or greater */
- ctxInfo->gl20 = JNI_TRUE;
- ctxInfo->gl14 = JNI_TRUE;
- ctxInfo->gl13 = JNI_TRUE;
- }
- else {
if (versionNumbers[1] == 2) {
fprintf(stderr,
- "JAVA 3D: OpenGL 1.2 detected; will run with reduced functionality\n");
- } else if (versionNumbers[1] == 4) {
- ctxInfo->gl14 = JNI_TRUE;
- ctxInfo->gl13 = JNI_TRUE;
+ "JAVA 3D: OpenGL 1.2 detected; will run with reduced functionality\n");
} else {
- // OpenGL 1.x (1.3 or greater)
- ctxInfo->gl13 = JNI_TRUE;
+ if (versionNumbers[1] >= 3) {
+ ctxInfo->gl13 = JNI_TRUE;
+ }
+ if (versionNumbers[1] >= 4) {
+ ctxInfo->gl14 = JNI_TRUE;
+ }
}
+ } else /* major >= 2 */ {
+ ctxInfo->gl20 = JNI_TRUE;
+ ctxInfo->gl14 = JNI_TRUE;
+ ctxInfo->gl13 = JNI_TRUE;
}
-
-
+
/* Setup function pointers for core OpenGL 1.3 features */
ctxInfo->textureExtMask |= javax_media_j3d_Canvas3D_TEXTURE_3D;