summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-02-03 17:06:55 +0100
committerTor Lillqvist <tml@collabora.com>2014-02-03 17:48:26 +0100
commit26cb65db74d67fc2561a495018d0f580c31202bc (patch)
tree4cc27b162370eb7fcbbeca81b82b33d037ad7bb0 /chart2
parentb6ba651fa9ed4b79605b74f4b3073db654071013 (diff)
Make the OpenGL stuff in chart2 compile for OS X (but definitely won't work)
Change-Id: I487fcd12bf90e8ce2c05743244858f7b5145c355
Diffstat (limited to 'chart2')
-rw-r--r--chart2/Library_chartopengl.mk4
-rw-r--r--chart2/Module_chart2.mk2
-rw-r--r--chart2/source/view/inc/DummyXShape.hxx9
-rw-r--r--chart2/source/view/main/DummyXShape.cxx13
-rwxr-xr-xchart2/source/view/main/OpenGLRender.cxx8
-rwxr-xr-xchart2/source/view/main/OpenGLRender.hxx13
6 files changed, 40 insertions, 9 deletions
diff --git a/chart2/Library_chartopengl.mk b/chart2/Library_chartopengl.mk
index 8cf8385fbc8c..0aa6340aa140 100644
--- a/chart2/Library_chartopengl.mk
+++ b/chart2/Library_chartopengl.mk
@@ -62,6 +62,10 @@ $(eval $(call gb_Library_use_system_win32_libs,chartopengl,\
gdi32 \
glu32 \
))
+else ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_use_system_darwin_frameworks,chartopengl,\
+ OpenGL \
+))
else ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,chartopengl,\
-ldl \
diff --git a/chart2/Module_chart2.mk b/chart2/Module_chart2.mk
index 9d6e0191effa..611e699705a9 100644
--- a/chart2/Module_chart2.mk
+++ b/chart2/Module_chart2.mk
@@ -12,7 +12,7 @@ $(eval $(call gb_Module_Module,chart2))
$(eval $(call gb_Module_add_targets,chart2,\
Library_chartcontroller \
Library_chartcore \
- $(if $(filter LINUX FREEBSD WNT,$(OS)), \
+ $(if $(filter FREEBSD LINUX MACOSX WNT,$(OS)), \
Library_chartopengl \
Package_opengl \
) \
diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx
index df9a892ffc8e..eae679b88678 100644
--- a/chart2/source/view/inc/DummyXShape.hxx
+++ b/chart2/source/view/inc/DummyXShape.hxx
@@ -61,8 +61,14 @@
#include <map>
#include <boost/scoped_ptr.hpp>
+#if defined( MACOSX )
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#else
#include <GL/gl.h>
#include <GL/glu.h>
+#endif
+
#include <vcl/window.hxx>
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
@@ -72,9 +78,6 @@
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined( MACOSX )
- #include "premac.h"
- #include <Cocoa/Cocoa.h>
- #include "postmac.h"
#elif defined( UNX )
#include <GL/glu.h>
#include <GL/glext.h>
diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx
index 636679e3e079..003afd24cf2f 100644
--- a/chart2/source/view/main/DummyXShape.cxx
+++ b/chart2/source/view/main/DummyXShape.cxx
@@ -947,6 +947,13 @@ bool DummyChart::initWindow()
return true;
}
+#elif defined( MACOSX )
+
+bool DummyChart::initWindow()
+{
+ return false;
+}
+
#elif defined( UNX )
namespace {
@@ -1085,6 +1092,8 @@ bool DummyChart::initOpengl()
#if defined( WNT )
GLWin.hDC = GetDC(GLWin.hWnd);
+#elif defined( MACOSX )
+
#elif defined( UNX )
GLWin.ctx = glXCreateContext(GLWin.dpy,
GLWin.vi,
@@ -1135,6 +1144,8 @@ bool DummyChart::initOpengl()
GLWin.hRC = wglCreateContext(GLWin.hDC);
wglMakeCurrent(GLWin.hDC,GLWin.hRC);
+#elif defined( MACOSX )
+
#elif defined( UNX )
if( !glXMakeCurrent( GLWin.dpy, GLWin.win, GLWin.ctx ) )
{
@@ -1195,6 +1206,8 @@ bool DummyChart::initOpengl()
#if defined( WNT )
SwapBuffers(GLWin.hDC);
glFlush();
+#elif defined( MACOSX )
+
#elif defined( UNX )
glXSwapBuffers(GLWin.dpy, GLWin.win);
#endif
diff --git a/chart2/source/view/main/OpenGLRender.cxx b/chart2/source/view/main/OpenGLRender.cxx
index 9cc75cbe1d90..1c3795a2222b 100755
--- a/chart2/source/view/main/OpenGLRender.cxx
+++ b/chart2/source/view/main/OpenGLRender.cxx
@@ -424,6 +424,8 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
#if defined( WNT )
SwapBuffers(glWin.hDC);
+#elif defined( MACOSX )
+
#elif defined( UNX )
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
@@ -663,6 +665,8 @@ void OpenGLRender::renderToBitmap()
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#if defined( WNT )
SwapBuffers(glWin.hDC);
+#elif defined( MACOSX )
+
#elif defined( UNX )
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
@@ -745,6 +749,8 @@ int OpenGLRender::RenderTexture(GLuint TexID)
glUseProgram(0);
#if defined( WNT )
SwapBuffers(glWin.hDC);
+#elif defined( MACOSX )
+
#elif defined( UNX )
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
@@ -826,6 +832,8 @@ void OpenGLRender::Release()
glDeleteRenderbuffers(1, &m_RboID);
#if defined( WNT )
wglMakeCurrent(NULL, NULL);
+#elif defined( MACOSX )
+
#elif defined( UNX )
glXMakeCurrent(glWin.dpy, None, NULL);
diff --git a/chart2/source/view/main/OpenGLRender.hxx b/chart2/source/view/main/OpenGLRender.hxx
index 23e842dae8a3..4b717d80bede 100755
--- a/chart2/source/view/main/OpenGLRender.hxx
+++ b/chart2/source/view/main/OpenGLRender.hxx
@@ -10,7 +10,8 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <vcl/font.hxx>
-#if defined( UNX )
+#if defined( MACOSX )
+#elif defined( UNX )
#include <prex.h>
#include "GL/glxew.h"
#include <postx.h>
@@ -22,9 +23,14 @@
#include "postwin.h"
#endif
-
+#if defined( MACOSX )
+#include <OpenGL/gl.h>
+#include <OpenGL/glu.h>
+#else
#include <GL/gl.h>
#include <GL/glu.h>
+#endif
+
#include <vcl/window.hxx>
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
@@ -36,9 +42,6 @@
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined( MACOSX )
-#include "premac.h"
-#include <Cocoa/Cocoa.h>
-#include "postmac.h"
#elif defined( UNX )
#include <GL/glu.h>