aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/jogl
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-12-20 23:30:11 +0000
committerKenneth Russel <[email protected]>2006-12-20 23:30:11 +0000
commitd8417f988a85f91d8f2a73106dbc8d4c10c67b98 (patch)
treed7c6113daa8afb42e29b7c19a0ee94b5eeca422d /src/native/jogl
parent00623c28f49789b0f9d891c3cf049e844ff65d6c (diff)
Added parameter validation for stereo bit in particular to fix problem
with Java 3D QueryProperties demo; unclear, however, if that demo is returning correct results, as it always seems to report that stereo is available when it seems it isn't. Probably need to use new getChosenGLCapabilities() method to implement this more correctly in the Java 3D/JOGL pipeline. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1035 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/native/jogl')
-rw-r--r--src/native/jogl/MacOSXWindowSystemInterface.m56
1 files changed, 25 insertions, 31 deletions
diff --git a/src/native/jogl/MacOSXWindowSystemInterface.m b/src/native/jogl/MacOSXWindowSystemInterface.m
index 5cf975c10..e7250b420 100644
--- a/src/native/jogl/MacOSXWindowSystemInterface.m
+++ b/src/native/jogl/MacOSXWindowSystemInterface.m
@@ -350,33 +350,26 @@ void getRendererInfo()
#endif
}
-long validateParameter(NSOpenGLPixelFormatAttribute atttribute, long value)
+long validateParameter(NSOpenGLPixelFormatAttribute attribute, long value)
{
- bool done = false;
- int i;
- for (i=0; i<gRenderersCount; i++)
- {
- RendererInfo renderer = gRenderers[i];
- if (renderer.accelerated != 0)
- {
- switch (atttribute)
- {
- case NSOpenGLPFAStencilSize:
- value = MIN(value, renderer.stencilSizeMAX);
- done = true;
- break;
- default:
- break;
- }
- }
-
- if (done == true)
- {
- break;
- }
- }
+ int i;
+ for (i=0; i<gRenderersCount; i++) {
+ RendererInfo* renderer = &gRenderers[i];
+ if (renderer->accelerated != 0) {
+ switch (attribute) {
+ case NSOpenGLPFAStereo:
+ return renderer->stereo;
+
+ case NSOpenGLPFAStencilSize:
+ return MIN(value, renderer->stencilSizeMAX);
+
+ default:
+ break;
+ }
+ }
+ }
- return value;
+ return value;
}
void* createPixelFormat(int* iattrs, int niattrs, int* ivalues) {
@@ -411,7 +404,7 @@ void* createPixelFormat(int* iattrs, int niattrs, int* ivalues) {
break;
case NSOpenGLPFAStereo:
- if (ivalues[i] != 0) {
+ if (ivalues[i] != 0 && (validateParameter(NSOpenGLPFAStereo, 0 /* dummy */) != 0)) {
attribs[idx++] = NSOpenGLPFAStereo;
}
break;
@@ -520,11 +513,12 @@ void* createContext(void* shareContext,
initWithFormat: (NSOpenGLPixelFormat*) pixelFormat
shareContext: (NSOpenGLContext*) shareContext];
- if (nsView != nil)
- {
- [nsContext setView:nsView];
- [nsView unlockFocus];
- }
+ if (nsContext != nil) {
+ if (nsView != nil) {
+ [nsContext setView:nsView];
+ [nsView unlockFocus];
+ }
+ }
[pool release];
return nsContext;