Kaydet (Commit) bc8ed7f7 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

split the windows and linux intialization bits

This makes it much esier now to simplify the Linux selection logic.

Change-Id: I7db0daf81b1c9047d4ef95527c7b51c09e6ab80a
üst ee1b4eb7
......@@ -12,6 +12,8 @@
#include <cppuhelper/implbase6.hxx>
#include "OpenGLRender.hxx"
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/beans/XMultiPropertySet.hpp>
......@@ -83,19 +85,9 @@
#elif defined( UNX )
#include <GL/glu.h>
#include <GL/glext.h>
namespace unx
{
#include <X11/keysym.h>
#include <X11/X.h>
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <GL/glxext.h>
}
#endif
//[mod] by gaowei
#include "OpenGLRender.hxx"
//[mod] by gaowei end
......
......@@ -502,7 +502,7 @@ int OpenGLRender::InitOpenGL(GLWindow aWindow)
#if defined( WNT )
SwapBuffers(glWin.hDC);
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
glFlush();
glEnable(GL_LIGHTING);
......@@ -741,7 +741,7 @@ void OpenGLRender::renderToBitmap()
#if defined( WNT )
SwapBuffers(glWin.hDC);
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
glFlush();
}
......@@ -823,7 +823,7 @@ int OpenGLRender::RenderTexture(GLuint TexID)
#if defined( WNT )
SwapBuffers(glWin.hDC);
#elif defined( UNX )
unx::glXSwapBuffers(glWin.dpy, glWin.win);
glXSwapBuffers(glWin.dpy, glWin.win);
#endif
glFlush();
return 0;
......
......@@ -10,6 +10,12 @@
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <vcl/font.hxx>
#if defined( UNX )
#include <prex.h>
#include "GL/glxew.h"
#include <postx.h>
#endif
#if defined( _WIN32 )
#include "prewin.h"
#include "windows.h"
......@@ -24,25 +30,22 @@
#include <vcl/sysdata.hxx>
#if defined( _WIN32 )
#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#include <GL/glu.h>
#include <GL/glext.h>
#include <GL/wglext.h>
#elif defined( MACOSX )
#include "premac.h"
#include <Cocoa/Cocoa.h>
#include "postmac.h"
#include "premac.h"
#include <Cocoa/Cocoa.h>
#include "postmac.h"
#elif defined( UNX )
#include <GL/glu.h>
#include <GL/glext.h>
namespace unx
{
#include <X11/keysym.h>
#include <X11/X.h>
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <GL/glxext.h>
}
#include <GL/glu.h>
#include <GL/glext.h>
#define GLX_GLXEXT_PROTOTYPES 1
#include <GL/glx.h>
#include <GL/glxext.h>
#endif
// Include GLM
......@@ -110,14 +113,14 @@ struct GLWindow
HGLRC hRC;
#elif defined( MACOSX )
#elif defined( UNX )
unx::Display* dpy;
Display* dpy;
int screen;
unx::Window win;
XLIB_Window win;
#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
unx::GLXFBConfig fbc;
GLXFBConfig fbc;
#endif
unx::XVisualInfo* vi;
unx::GLXContext ctx;
XVisualInfo* vi;
GLXContext ctx;
bool HasGLXExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, (const GLubyte*) GLXExtensions ); }
const char* GLXExtensions;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment