diff options
Diffstat (limited to 'app/gfx/gl/gl_context_osmesa.cc')
-rw-r--r-- | app/gfx/gl/gl_context_osmesa.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/app/gfx/gl/gl_context_osmesa.cc b/app/gfx/gl/gl_context_osmesa.cc index 49057d2..6d144cb 100644 --- a/app/gfx/gl/gl_context_osmesa.cc +++ b/app/gfx/gl/gl_context_osmesa.cc @@ -2,11 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <GL/glew.h> -#include <GL/osmew.h> - #include <algorithm> +#include "app/gfx/gl/gl_bindings.h" #include "app/gfx/gl/gl_context_osmesa.h" namespace gfx { @@ -18,14 +16,17 @@ OSMesaGLContext::OSMesaGLContext() : context_(NULL) OSMesaGLContext::~OSMesaGLContext() { } -bool OSMesaGLContext::Initialize(void* shared_handle) { +bool OSMesaGLContext::Initialize(GLContext* shared_context) { DCHECK(!context_); size_ = gfx::Size(1, 1); buffer_.reset(new int32[1]); - context_ = OSMesaCreateContext(GL_RGBA, - static_cast<OSMesaContext>(shared_handle)); + OSMesaContext shared_handle = NULL; + if (shared_context) + shared_handle = static_cast<OSMesaContext>(shared_context->GetHandle()); + + context_ = OSMesaCreateContext(GL_RGBA, shared_handle); if (!context_) return false; @@ -34,11 +35,6 @@ bool OSMesaGLContext::Initialize(void* shared_handle) { return false; } - if (!InitializeGLEW()) { - Destroy(); - return false; - } - if (!InitializeCommon()) { Destroy(); return false; |