summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorZolnai Tamás <tamas.zolnai@collabora.com>2014-07-20 14:20:35 +0200
committerZolnai Tamás <tamas.zolnai@collabora.com>2014-07-21 13:00:08 +0200
commit23c876deeb357b6306712ff0586a819176151c15 (patch)
treee511e84350e62f70c63cd9c5c1bbacbfef4d67ca /slideshow
parentb8f4db5bad245c2e340b3217b10df994785eecd3 (diff)
Extract getGLVersion() method to OpenGLHelper
Change-Id: If3b7a6c71164f2b55defe8c28cdce69de9283175
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx11
-rw-r--r--slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm12
-rw-r--r--slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx12
3 files changed, 11 insertions, 24 deletions
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 36c1dd085279..378de36ce5e4 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -61,6 +61,7 @@
#include <vcl/canvastools.hxx>
#include <vcl/opengl/OpenGLContext.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
#include <vcl/window.hxx>
#include <boost/noncopyable.hpp>
@@ -337,14 +338,8 @@ void OGLTransitionerImpl::impl_initializeFlags( bool const bGLXPresent )
{
mbGLXPresent = bGLXPresent;
if ( bGLXPresent ) {
- const GLubyte* version = glGetString( GL_VERSION );
- if( version && version[0] ) {
- mnGLVersion = version[0] - '0';
- if( version[1] == '.' && version[2] )
- mnGLVersion += (version[2] - '0')/10.0;
- } else
- mnGLVersion = 1.0;
- SAL_INFO("slideshow.opengl", "GL version: " << version << " parsed: " << mnGLVersion << "" );
+ mnGLVersion = OpenGLHelper::getGLVersion();
+ SAL_INFO("slideshow.opengl", "GL version: " << mnGLVersion << "" );
const GLubyte* vendor = glGetString( GL_VENDOR );
mbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );
diff --git a/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm b/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm
index 47cdb2d7ee66..62b135a446d3 100644
--- a/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm
+++ b/slideshow/source/engine/OGLTrans/mac/OGLTrans_TransitionerImpl.mm
@@ -56,6 +56,8 @@
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
+
#include <boost/noncopyable.hpp>
#include <premac.h>
@@ -311,14 +313,8 @@ bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowV
if( instance->initWindowFromSlideShowView( xView ) )
{
- const GLubyte* version = glGetString( GL_VERSION );
- if( version && version[0] ) {
- cnGLVersion = version[0] - '0';
- if( version[1] == '.' && version[2] )
- cnGLVersion += (version[2] - '0')/10.0;
- } else
- cnGLVersion = 1.0;
- OSL_TRACE("GL version: %s parsed: %f", version, cnGLVersion );
+ cnGLVersion = OpenGLHelper::getGLVersion();
+ OSL_TRACE("GL version: %f", cnGLVersion );
const GLubyte* vendor = glGetString( GL_VENDOR );
cbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );
diff --git a/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx
index 19f22fdea618..2fcd3b537976 100644
--- a/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/win/OGLTrans_TransitionerImpl.cxx
@@ -56,6 +56,8 @@
#include <vcl/syschild.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/opengl/OpenGLHelper.hxx>
+
#include <boost/noncopyable.hpp>
#include <GL/gl.h>
@@ -314,14 +316,8 @@ bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowV
instance = new OGLTransitionerImpl( NULL );
if( instance->initWindowFromSlideShowView( xView ) ) {
- const GLubyte* version = glGetString( GL_VERSION );
- if( version && version[0] ) {
- cnGLVersion = version[0] - '0';
- if( version[1] == '.' && version[2] )
- cnGLVersion += (version[2] - '0')/10.0;
- } else
- cnGLVersion = 1.0;
- OSL_TRACE("GL version: %s parsed: %f", version, cnGLVersion );
+ cnGLVersion = OpenGLHelper::getGLVersion();
+ OSL_TRACE("GL version: %f", cnGLVersion );
const GLubyte* vendor = glGetString( GL_VENDOR );
cbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );