summaryrefslogtreecommitdiffstats
path: root/make/stub_includes/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-05 05:45:19 +0100
committerSven Gothel <[email protected]>2011-11-05 05:45:19 +0100
commitfe4f9f3f83cda05052549cc34fb3f7acb4eabb9c (patch)
treeb4968ddd865bb881832e4b335b18cbdddfda9e59 /make/stub_includes/opengl
parent34ef2815dd0f4dc84f35fe5bf72ea876d4b9e882 (diff)
OSX: CGL type cleanup ; layeredSurface impl.
- Use proper OSX types for NS/CGL prototypes (gluegen) and impl. - Impl layeredSurface (native): - OSXUtil: NSView backing creation - OSXUtil: AttachJAWTSurfaceLayer - CGL: NSOpenGLLayer type impl. and hook
Diffstat (limited to 'make/stub_includes/opengl')
-rw-r--r--make/stub_includes/opengl/macosx-window-system.h67
1 files changed, 36 insertions, 31 deletions
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h
index 65d8e41f7..fe0c0b1bc 100644
--- a/make/stub_includes/opengl/macosx-window-system.h
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -7,55 +7,60 @@
compilation then the build fails.
*/
+#include <AppKit/NSView.h>
+#include <AppKit/NSOpenGL.h>
+#include <AppKit/NSOpenGLLayer.h>
+// #include <AppKit/NSOpenGLView.h>
+#include <OpenGL/CGLDevice.h>
+#include <OpenGL/OpenGL.h>
+
typedef int Bool;
// CGL ..
-void CGLQueryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues);
+void CGLQueryPixelFormat(CGLPixelFormatObj fmt, int* iattrs, int niattrs, int* ivalues);
// NS ..
-void* createPixelFormat(int* iattrs, int niattrs, int* ivalues);
-void queryPixelFormat(void* pixelFormat, int* iattrs, int niattrs, int* ivalues);
-void deletePixelFormat(void* pixelFormat);
+NSOpenGLPixelFormat* createPixelFormat(int* iattrs, int niattrs, int* ivalues);
+void queryPixelFormat(NSOpenGLPixelFormat* fmt, int* iattrs, int niattrs, int* ivalues);
+void deletePixelFormat(NSOpenGLPixelFormat* fmt);
// NS ..
-void *getCurrentContext(void);
-void *getNSView(void* nsContext);
+NSOpenGLContext* getCurrentContext(void);
+CGLContextObj getCGLContext(NSOpenGLContext* ctx);
+NSView* getNSView(NSOpenGLContext* ctx);
-void* createContext(void* shareContext,
- void* nsView,
- void* pixelFormat,
+NSOpenGLContext* createContext(NSOpenGLContext* shareContext,
+ NSView* nsView,
+ Bool isBackingLayerView,
+ NSOpenGLPixelFormat* pixelFormat,
Bool opaque,
int* viewNotReady);
-void *getCGLContext(void* nsContext);
-Bool makeCurrentContext(void* nsContext);
-Bool clearCurrentContext(void *nsContext);
-Bool deleteContext(void* nsContext, Bool releaseOnMainThread);
-Bool flushBuffer(void* nsContext);
-void setContextOpacity(void* nsContext, int opacity);
-void updateContext(void* nsContext);
-void copyContext(void* destContext, void* srcContext, int mask);
-
-void* updateContextRegister(void* nsContext, void* nsView);
+Bool makeCurrentContext(NSOpenGLContext* ctx);
+Bool clearCurrentContext(NSOpenGLContext *ctx);
+Bool deleteContext(NSOpenGLContext* ctx, Bool releaseOnMainThread);
+Bool flushBuffer(NSOpenGLContext* ctx);
+void setContextOpacity(NSOpenGLContext* ctx, int opacity);
+void updateContext(NSOpenGLContext* ctx);
+void copyContext(NSOpenGLContext* dest, NSOpenGLContext* src, int mask);
+
+void* updateContextRegister(NSOpenGLContext* ctx, NSView* view);
Bool updateContextNeedsUpdate(void* updater);
void updateContextUnregister(void* updater);
-void* createPBuffer(int renderTarget, int internalFormat, int width, int height);
-Bool destroyPBuffer(void* pBuffer);
-void setContextPBuffer(void* nsContext, void* pBuffer);
-void setContextTextureImageToPBuffer(void* nsContext, void* pBuffer, int colorBuffer);
+NSOpenGLPixelBuffer* createPBuffer(int renderTarget, int internalFormat, int width, int height);
+Bool destroyPBuffer(NSOpenGLPixelBuffer* pBuffer);
+void setContextPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer* pBuffer);
+void setContextTextureImageToPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer* pBuffer, int colorBuffer);
+
+NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, NSOpenGLPixelFormat* fmt, NSView* view, Bool opaque);
+void setNSOpenGLLayerNeedsDisplay(NSOpenGLLayer* glLayer);
+void releaseNSOpenGLLayer(NSOpenGLLayer *glLayer);
void* getProcAddress(const char *procName);
-void setSwapInterval(void* nsContext, int interval);
+void setSwapInterval(NSOpenGLContext* ctx, int interval);
/* Gamma-related functionality */
Bool setGammaRamp(int tableSize, float* redRamp, float* greenRamp, float* blueRamp);
void resetGammaRamp();
-/****************************************************************************************/
-/* Java2D/JOGL bridge support; need to be able to create pbuffers and
- contexts using the CGL APIs to be able to share textures, etc. with
- contexts created by Java2D/JOGL bridge, which are CGLContextObjs */
-
-/* Pick up copies of CGL signatures from Mac OS X stub_includes/window-system-build directory */
-#include <OpenGL/OpenGL.h>