Commit d75d8a18 authored by fogal1's avatar fogal1

Use GLEW initializer.

A couple plots were manually initializing GLEW.  This makes them
use the new avtGLEWInitializer, meaning 1) if both plots are used
in a session, GLEW shouldn't get initialized twice, and 2) they
can work against Mesa, and thus in SR mode.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@8022 18c085ea-50e0-402c-830e-de6fd14e8384
parent c13d4f8e
......@@ -50,9 +50,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
#include <visit-config.h>
#ifdef HAVE_LIBGLEW
#include <GL/glew.h>
#endif
#include <avtGLEWInitializer.h>
#if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA))
#include <OpenGL/gl.h>
#else
......@@ -664,6 +662,9 @@ ShaderModeData::SetHint(int hint, int val)
// Brad Whitlock, Fri Sep 15 13:32:08 PST 2006
// Made sure that GLEW can initialize okay.
//
// Tom Fogal, Sat Jul 25 19:46:22 MDT 2009
// Use new glew initialization wrapper.
//
// ****************************************************************************
bool
......@@ -671,14 +672,7 @@ ShaderModeData::ModeAvailable()
{
if(!GLSL_init)
{
GLenum err = glewInit();
if(err != GLEW_OK)
{
debug1 << "ShaderModeData::ModeAvailable: glewInit() failed: "
<< glewGetErrorString(err) << endl;
return false;
}
GLSL_init = true;
GLSL_init = avt::glew::initialize();
}
return GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader;
}
......
......@@ -62,10 +62,7 @@
#ifndef VTK_IMPLEMENT_MESA_CXX
// Include GLEW.
#include <visit-config.h>
#ifdef HAVE_LIBGLEW
#include <GL/glew.h>
static bool glew_initialized = false;
#endif
#include <avtGLEWInitializer.h>
#if defined(__APPLE__) && (defined(VTK_USE_CARBON) || defined(VTK_USE_COCOA))
#include <OpenGL/gl.h>
......@@ -106,6 +103,9 @@
// I removed the code to get the glTexImage3D extension and initialized
// the GLEW library.
//
// Tom Fogal, Sat Jul 25 19:45:26 MDT 2009
// Use new GLEW initialization wrapper.
//
// ****************************************************************************
avtOpenGL3DTextureVolumeRenderer::avtOpenGL3DTextureVolumeRenderer()
......@@ -114,16 +114,7 @@ avtOpenGL3DTextureVolumeRenderer::avtOpenGL3DTextureVolumeRenderer()
volumetexId = 0;
#ifndef VTK_IMPLEMENT_MESA_CXX
#ifdef HAVE_LIBGLEW
GLenum err = glewInit();
if(err != GLEW_OK)
{
debug1 << "avtOpenGL3DTextureVolumeRenderer ctor: "
<< glewGetErrorString(err) << endl;
}
else
glew_initialized = true;
#endif
avt::glew::initialize();
#endif
}
......
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