summaryrefslogtreecommitdiffstats
path: root/canvas/source/opengl/ogl_spritedevicehelper.hxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-08 01:55:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-08 09:24:00 +0200
commit779ae371b152748aecf2ea81eca1bdbbf0226389 (patch)
treebb617dd73d7c5eed7fd5ef777c926a138e22c5cf /canvas/source/opengl/ogl_spritedevicehelper.hxx
parentextract shaders to own file and use shared shader loading (diff)
downloadcore-779ae371b152748aecf2ea81eca1bdbbf0226389.tar.gz
core-779ae371b152748aecf2ea81eca1bdbbf0226389.zip
reuse OpenGLContext in OGL canvas
The only thing that needs to be reimplemented is the pbuffer based custom sprite rendering. We should use a FBO with a texture backend for that. This will also save several OpenGL context switches! Change-Id: I4aef33ae2499e44c8b5f41c296d8721cb94a37a1
Diffstat (limited to 'canvas/source/opengl/ogl_spritedevicehelper.hxx')
-rw-r--r--canvas/source/opengl/ogl_spritedevicehelper.hxx36
1 files changed, 5 insertions, 31 deletions
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.hxx b/canvas/source/opengl/ogl_spritedevicehelper.hxx
index 5fe9ed196b3b..f43a3af3efda 100644
--- a/canvas/source/opengl/ogl_spritedevicehelper.hxx
+++ b/canvas/source/opengl/ogl_spritedevicehelper.hxx
@@ -10,6 +10,8 @@
#ifndef INCLUDED_CANVAS_SOURCE_OPENGL_OGL_SPRITEDEVICEHELPER_HXX
#define INCLUDED_CANVAS_SOURCE_OPENGL_OGL_SPRITEDEVICEHELPER_HXX
+#include <vcl/opengl/OpenGLContext.hxx>
+
#include <rtl/ref.hxx>
#include <canvas/elapsedtime.hxx>
#include <com/sun/star/rendering/XGraphicDevice.hpp>
@@ -20,7 +22,6 @@
#include <set>
-
class Window;
class SystemChildWindow;
namespace basegfx{ class B2IVector; class B2DHomMatrix; }
@@ -113,26 +114,11 @@ namespace oglcanvas
/// Get instance of internal texture cache
TextureCache& getTextureCache() const;
-
-
- // nobody except IBufferContext implementations are supposed
- // to use this
- bool activatePBufferContext(const ::basegfx::B2IVector& rSize,
- unsigned int PBuffer) const;
- bool activateWindowContext() const;
- bool updatePBufferTexture( const ::basegfx::B2IVector&,
- unsigned int ) const;
+ bool activateWindowContext();
private:
void resize( const ::basegfx::B2IVector& rNewSize );
- void compileShader(unsigned int& o_rShaderHandle,
- unsigned int eShaderType,
- const char* pShaderSourceCode);
- void linkShaders(unsigned int& o_rProgramHandle,
- unsigned int nVertexProgramId,
- unsigned int nFragmentProgramId);
-
/** Phyical output device
Deliberately not a refcounted reference, because of
@@ -149,28 +135,16 @@ namespace oglcanvas
/// For the frame counter timings
::canvas::tools::ElapsedTime maLastUpdate;
- boost::shared_ptr<SystemChildWindow> mpChildWindow;
- void* mpDisplay;
- void* mpGLContext;
- void* mpGLPBufContext;
- void* mpFBConfig;
-
boost::shared_ptr<TextureCache> mpTextureCache;
- unsigned int mnDummyVertexProgram;
-
- unsigned int mnLinearTwoColorGradientFragmentProgram;
- unsigned int mnLinearMultiColorGradientFragmentProgram;
- unsigned int mnRadialTwoColorGradientFragmentProgram;
- unsigned int mnRadialMultiColorGradientFragmentProgram;
- unsigned int mnRectangularTwoColorGradientFragmentProgram;
- unsigned int mnRectangularMultiColorGradientFragmentProgram;
unsigned int mnLinearTwoColorGradientProgram;
unsigned int mnLinearMultiColorGradientProgram;
unsigned int mnRadialTwoColorGradientProgram;
unsigned int mnRadialMultiColorGradientProgram;
unsigned int mnRectangularTwoColorGradientProgram;
unsigned int mnRectangularMultiColorGradientProgram;
+
+ OpenGLContext maContext;
};
}