summaryrefslogtreecommitdiffstats
path: root/make/stub_includes
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2006-11-19 20:51:57 +0000
committerKenneth Russel <[email protected]>2006-11-19 20:51:57 +0000
commita303cd13ff62f94a0459978735620e37d72bbb77 (patch)
tree32b580af4e878d479890c12b8eae9c98e10a4874 /make/stub_includes
parentbf82eceb6f78d5ee6e4c0f9f02590d2a58e647d3 (diff)
Fixed Issue 213: Expose GLCaps from GLDrawable
Added getChosenGLCapabilities() to the GLDrawable interface. Implemented on Windows, Unix and Mac OS X platforms with various techniques. Attempts to provide correct answers in all cases, even when the GLCapabilitiesChooser mechanism is not supported. Required addition of new platform-specific Java code in most cases to either re-convert existing PIXELFORMATDESCRIPTORS / XVisualInfos, or to query the pixel format or visual chosen for drawables like pbuffers for which the chooser mechanism is not (yet) implemented. Tested on Windows, Solaris/x86, and Mac OS X with on-screen, off-screen and pbuffer drawables. (Full support for the Java2D/JOGL bridge is not yet in place; the answer returned from the GLJPanel in this case is currently the default GLCapabilities, and it is likely that "external" GLDrawables will return null.) git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@989 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'make/stub_includes')
-rw-r--r--make/stub_includes/macosx/window-system.c46
-rw-r--r--make/stub_includes/opengl/macosx-window-system.h24
2 files changed, 53 insertions, 17 deletions
diff --git a/make/stub_includes/macosx/window-system.c b/make/stub_includes/macosx/window-system.c
index f2738b454..787d265ed 100644
--- a/make/stub_includes/macosx/window-system.c
+++ b/make/stub_includes/macosx/window-system.c
@@ -1 +1,47 @@
#include "macosx-window-system.h"
+
+/* These can not show up in the header file above because they must not be visible during the real build */
+
+/*
+** Attribute names for [NSOpenGLPixelFormat initWithAttributes]
+** and [NSOpenGLPixelFormat getValues:forAttribute:forVirtualScreen].
+*/
+typedef enum {
+ NSOpenGLPFAAllRenderers = 1, /* choose from all available renderers */
+ NSOpenGLPFADoubleBuffer = 5, /* choose a double buffered pixel format */
+ NSOpenGLPFAStereo = 6, /* stereo buffering supported */
+ NSOpenGLPFAAuxBuffers = 7, /* number of aux buffers */
+ NSOpenGLPFAColorSize = 8, /* number of color buffer bits */
+ NSOpenGLPFAAlphaSize = 11, /* number of alpha component bits */
+ NSOpenGLPFADepthSize = 12, /* number of depth buffer bits */
+ NSOpenGLPFAStencilSize = 13, /* number of stencil buffer bits */
+ NSOpenGLPFAAccumSize = 14, /* number of accum buffer bits */
+ NSOpenGLPFAMinimumPolicy = 51, /* never choose smaller buffers than requested */
+ NSOpenGLPFAMaximumPolicy = 52, /* choose largest buffers of type requested */
+ NSOpenGLPFAOffScreen = 53, /* choose an off-screen capable renderer */
+ NSOpenGLPFAFullScreen = 54, /* choose a full-screen capable renderer */
+ NSOpenGLPFASampleBuffers = 55, /* number of multi sample buffers */
+ NSOpenGLPFASamples = 56, /* number of samples per multi sample buffer */
+ NSOpenGLPFAAuxDepthStencil = 57, /* each aux buffer has its own depth stencil */
+ NSOpenGLPFAColorFloat = 58, /* color buffers store floating point pixels */
+
+ NSOpenGLPFAMultisample = 59, /* choose multisampling */
+ NSOpenGLPFASupersample = 60, /* choose supersampling */
+ NSOpenGLPFASampleAlpha = 61, /* request alpha filtering */
+
+ NSOpenGLPFARendererID = 70, /* request renderer by ID */
+ NSOpenGLPFASingleRenderer = 71, /* choose a single renderer for all screens */
+ NSOpenGLPFANoRecovery = 72, /* disable all failure recovery systems */
+ NSOpenGLPFAAccelerated = 73, /* choose a hardware accelerated renderer */
+ NSOpenGLPFAClosestPolicy = 74, /* choose the closest color buffer to request */
+ NSOpenGLPFARobust = 75, /* renderer does not need failure recovery */
+ NSOpenGLPFABackingStore = 76, /* back buffer contents are valid after swap */
+ NSOpenGLPFAMPSafe = 78, /* renderer is multi-processor safe */
+ NSOpenGLPFAWindow = 80, /* can be used to render to an onscreen window */
+ NSOpenGLPFAMultiScreen = 81, /* single window can span multiple screens */
+ NSOpenGLPFACompliant = 83, /* renderer is opengl compliant */
+ NSOpenGLPFAScreenMask = 84, /* bit mask of supported physical screens */
+ NSOpenGLPFAPixelBuffer = 90, /* can be used to render to a pbuffer */
+ NSOpenGLPFAVirtualScreenCount = 128 /* number of virtual screens in this format */
+} NSOpenGLPixelFormatAttribute;
+
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h
index 1d3df1a08..ed07ce74d 100644
--- a/make/stub_includes/opengl/macosx-window-system.h
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -9,23 +9,13 @@
typedef int Bool;
-void* createContext(void* shareContext, void* nsView,
- int doubleBuffer,
- int stereo,
- int redBits,
- int greenBits,
- int blueBits,
- int alphaBits,
- int depthBits,
- int stencilBits,
- int accumRedBits,
- int accumGreenBits,
- int accumBlueBits,
- int accumAlphaBits,
- int sampleBuffers,
- int numSamples,
- int pbuffer,
- int floatingPoint,
+void* createPixelFormat(int* iattrs, int niattrs, int* ivalues);
+void queryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues);
+void deletePixelFormat(void* pixelFormat);
+
+void* createContext(void* shareContext,
+ void* nsView,
+ void* pixelFormat,
int* viewNotReady);
Bool makeCurrentContext(void* nsContext);
Bool clearCurrentContext(void* nsContext);