mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 14:55:39 +00:00
Merge pull request #1348 from hpvb/intel-mesa-compile-fix
Fix running on Linux / Intel Mesa drivers
This commit is contained in:
commit
6a2d394d90
4 changed files with 12 additions and 3 deletions
|
|
@ -83,6 +83,10 @@ void GFXGLDevice::enumerateAdapters( Vector<GFXAdapter*> &adapterList )
|
|||
);
|
||||
|
||||
SDL_ClearError();
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
|
||||
SDL_GLContext tempContext = SDL_GL_CreateContext( tempWindow );
|
||||
if( !tempContext )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ namespace GL
|
|||
{
|
||||
void gglPerformBinds()
|
||||
{
|
||||
glewExperimental = GL_TRUE;
|
||||
GLenum err = glewInit();
|
||||
AssertFatal(GLEW_OK == err, avar("Error: %s\n", glewGetErrorString(err)) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,13 @@
|
|||
#define T_GL_H
|
||||
#include "GL/glew.h"
|
||||
|
||||
#if defined (TORQUE_OS_WIN)
|
||||
// This doesn't work on Mesa drivers.
|
||||
#define gglHasExtension(EXTENSION) GLEW_##EXTENSION
|
||||
#else
|
||||
// Slower but reliably detects extensions on Mesa.
|
||||
#define gglHasExtension(EXTENSION) glewGetExtension("GL_" # EXTENSION)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -13,18 +13,16 @@ namespace PlatformGL
|
|||
return;
|
||||
|
||||
inited = true;
|
||||
const U32 majorOGL = 4;
|
||||
const U32 majorOGL = 3;
|
||||
const U32 minorOGL = 2;
|
||||
U32 debugFlag = 0;
|
||||
#ifdef TORQUE_DEBUG
|
||||
debugFlag |= SDL_GL_CONTEXT_DEBUG_FLAG;
|
||||
#endif
|
||||
|
||||
#if 0 // cause problem with glew, no extension load
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, majorOGL);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minorOGL);
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
|
||||
#endif
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, debugFlag);
|
||||
|
||||
SDL_ClearError();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue