[grits] Add some stubbed code for Mac OS support
- From: Andy Spencer <andys src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grits] Add some stubbed code for Mac OS support
- Date: Sun, 26 Jun 2011 23:30:11 +0000 (UTC)
commit 6c98281f93edb654fdf1586f8c3cfed811457e3e
Author: Andy Spencer <andy753421 gmail com>
Date: Sat Jun 18 22:12:38 2011 +0000
Add some stubbed code for Mac OS support
(This won't compile yet)
src/gtkgl.c | 40 ++++++++++++++++++++++++++++++++++++----
1 files changed, 36 insertions(+), 4 deletions(-)
---
diff --git a/src/gtkgl.c b/src/gtkgl.c
index 9a2909a..6812d33 100644
--- a/src/gtkgl.c
+++ b/src/gtkgl.c
@@ -172,10 +172,42 @@ void gtk_gl_disable(GtkWidget *widget)
* Mac OSX implementation *
**************************/
#elif defined(USE_CGL)
-void gtk_gl_enable(GtkWidget *widget) { }
-void gtk_gl_begin(GtkWidget *widget) { }
-void gtk_gl_end(GtkWidget *widget) { }
-void gtk_gl_disable(GtkWidget *widget) { }
+void gtk_gl_enable(GtkWidget *widget)
+{
+ CGDisplayCapture( kCGDirectMainDisplay );
+ CGLPixelFormatAttribute attribs[] =
+ {
+ kCGLPFANoRecovery,
+ kCGLPFADoubleBuffer,
+ kCGLPFAFullScreen,
+ kCGLPFAStencilSize, ( CGLPixelFormatAttribute ) 8,
+ kCGLPFADisplayMask, ( CGLPixelFormatAttribute ) CGDisplayIDToOpenGLDisplayMask( kCGDirectMainDisplay ),
+ ( CGLPixelFormatAttribute ) NULL
+ };
+
+ CGLPixelFormatObj pixelFormatObj;
+ GLint numPixelFormats;
+ CGLChoosePixelFormat( attribs, &pixelFormatObj, &numPixelFormats );
+
+ CGLCreateContext( pixelFormatObj, NULL, &contextObj );
+
+ CGLDestroyPixelFormat( pixelFormatObj );
+
+ CGLSetCurrentContext( contextObj );
+ CGLSetFullScreen( contextObj );
+}
+
+void gtk_gl_begin(GtkWidget *widget)
+{
+}
+
+void gtk_gl_end(GtkWidget *widget)
+{
+}
+
+void gtk_gl_disable(GtkWidget *widget)
+{
+}
/****************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]