GLEW fix for some graphics drivers
parent
8818a8e5db
commit
edb1c0cbd6
|
@ -444,8 +444,6 @@ bool CApplication::CreateVideoSurface()
|
||||||
// Use hardware surface if available
|
// Use hardware surface if available
|
||||||
if (videoInfo->hw_available)
|
if (videoInfo->hw_available)
|
||||||
videoFlags |= SDL_HWSURFACE;
|
videoFlags |= SDL_HWSURFACE;
|
||||||
else
|
|
||||||
videoFlags |= SDL_SWSURFACE;
|
|
||||||
|
|
||||||
// Enable hardware blit if available
|
// Enable hardware blit if available
|
||||||
if (videoInfo->blit_hw)
|
if (videoInfo->blit_hw)
|
||||||
|
|
|
@ -87,6 +87,8 @@ bool CGLDevice::Create()
|
||||||
{
|
{
|
||||||
glewInited = true;
|
glewInited = true;
|
||||||
|
|
||||||
|
glewExperimental = GL_TRUE;
|
||||||
|
|
||||||
if (glewInit() != GLEW_OK)
|
if (glewInit() != GLEW_OK)
|
||||||
{
|
{
|
||||||
GetLogger()->Error("GLEW initialization failed\n");
|
GetLogger()->Error("GLEW initialization failed\n");
|
||||||
|
@ -95,7 +97,7 @@ bool CGLDevice::Create()
|
||||||
|
|
||||||
m_multitextureAvailable = glewIsSupported("GL_ARB_multitexture GL_ARB_texture_env_combine");
|
m_multitextureAvailable = glewIsSupported("GL_ARB_multitexture GL_ARB_texture_env_combine");
|
||||||
if (!m_multitextureAvailable)
|
if (!m_multitextureAvailable)
|
||||||
GetLogger()->Error("GLEW reports multitexturing not supported - graphics quality will be degraded!\n");
|
GetLogger()->Warn("GLEW reports multitexturing not supported - graphics quality will be degraded!\n");
|
||||||
|
|
||||||
m_vboAvailable = glewIsSupported("GL_ARB_vertex_buffer_object");
|
m_vboAvailable = glewIsSupported("GL_ARB_vertex_buffer_object");
|
||||||
if (m_vboAvailable)
|
if (m_vboAvailable)
|
||||||
|
@ -415,7 +417,9 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
|
||||||
result.size.y = data->surface->h;
|
result.size.y = data->surface->h;
|
||||||
|
|
||||||
// Use & enable 1st texture stage
|
// Use & enable 1st texture stage
|
||||||
|
if (m_multitextureAvailable)
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
|
|
||||||
glEnable(GL_TEXTURE_2D);
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
glGenTextures(1, &result.id);
|
glGenTextures(1, &result.id);
|
||||||
|
|
Loading…
Reference in New Issue