diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-20 15:20:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-21 15:43:56 +0000 |
commit | 56d2cab4704f079ca173d65619432665bc1a1c92 (patch) | |
tree | 18fc983d726c2ad5e77bceb78df4dc7abae54c8a /include/vcl/opengl | |
parent | 29428a5979ecf37eca7eb690a6acbc2897122753 (diff) |
split GLWindow into platform dependent parts and move to respective backends
Change-Id: I636d9bdac907000e4089aebdc5548ea89ec58083
Reviewed-on: https://gerrit.libreoffice.org/25252
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include/vcl/opengl')
-rw-r--r-- | include/vcl/opengl/OpenGLContext.hxx | 82 |
1 files changed, 7 insertions, 75 deletions
diff --git a/include/vcl/opengl/OpenGLContext.hxx b/include/vcl/opengl/OpenGLContext.hxx index 10024b3152e5..7b91620711a8 100644 --- a/include/vcl/opengl/OpenGLContext.hxx +++ b/include/vcl/opengl/OpenGLContext.hxx @@ -14,37 +14,6 @@ #include <GL/glew.h> -#if defined( MACOSX ) -#elif defined( IOS ) -#elif defined( ANDROID ) -#elif defined( LIBO_HEADLESS ) -#elif defined( UNX ) -# include <X11/Xlib.h> -# include <X11/Xutil.h> -# include "GL/glxew.h" -#elif defined( _WIN32 ) -#ifndef INCLUDED_PRE_POST_WIN_H -#define INCLUDED_PRE_POST_WIN_H -# include "prewin.h" -# include "postwin.h" -#endif -#endif - -#if defined( _WIN32 ) -#include <GL/wglew.h> -#elif defined( MACOSX ) -#include <OpenGL/OpenGL.h> -#ifdef __OBJC__ -@class NSOpenGLView; -#else -class NSOpenGLView; -#endif -#elif defined( IOS ) -#elif defined( ANDROID ) -#elif defined( LIBO_HEADLESS ) -#elif defined( UNX ) -#endif - #include <vcl/dllapi.h> #include <vcl/window.hxx> #include <tools/gen.hxx> @@ -67,57 +36,20 @@ class RenderState; /// Holds the information of our new child window struct VCL_DLLPUBLIC GLWindow { -#if defined( _WIN32 ) - HWND hWnd; - HDC hDC; - HGLRC hRC; -#elif defined( MACOSX ) -#elif defined( IOS ) -#elif defined( ANDROID ) -#elif defined( LIBO_HEADLESS ) -#elif defined( UNX ) - Display* dpy; - int screen; - Window win; - XVisualInfo* vi; - GLXContext ctx; - - bool HasGLXExtension( const char* name ) const; - const char* GLXExtensions; -#endif unsigned int Width; unsigned int Height; - const GLubyte* GLExtensions; bool bMultiSampleSupported; GLWindow() - : -#if defined( _WIN32 ) - hWnd(NULL), - hDC(NULL), - hRC(NULL), -#elif defined( MACOSX ) -#elif defined( IOS ) -#elif defined( ANDROID ) -#elif defined( LIBO_HEADLESS ) -#elif defined( UNX ) - dpy(nullptr), - screen(0), - win(0), - vi(nullptr), - ctx(nullptr), - GLXExtensions(nullptr), -#endif - Width(0), - Height(0), - GLExtensions(nullptr), - bMultiSampleSupported(false) + : Width(0) + , Height(0) + , bMultiSampleSupported(false) { } - bool Synchronize(bool bOnoff) const; + virtual bool Synchronize(bool bOnoff) const; - ~GLWindow(); + virtual ~GLWindow(); }; class VCL_DLLPUBLIC OpenGLContext @@ -189,7 +121,7 @@ public: void setWinPosAndSize(const Point &rPos, const Size& rSize); void setWinSize(const Size& rSize); - const GLWindow& getOpenGLWindow() const; + virtual const GLWindow& getOpenGLWindow() const = 0; SystemChildWindow* getChildWindow(); const SystemChildWindow* getChildWindow() const; @@ -212,11 +144,11 @@ private: virtual void destroyCurrentContext(); protected: - GLWindow m_aGLWin; bool InitGLEW(); void InitGLEWDebugging(); void InitChildWindow(SystemChildWindow *pChildWindow); void BuffersSwapped(); + virtual GLWindow& getModifiableOpenGLWindow() = 0; virtual bool ImplInit(); VclPtr<vcl::Window> m_xWindow; |