more opengl graphics fixes

This commit is contained in:
Eduardo Bart
2012-06-02 15:58:30 -03:00
parent cde81666b8
commit 257f652bb7
13 changed files with 34 additions and 15 deletions

View File

@@ -87,12 +87,17 @@ void Graphics::init()
*/
// determine max texture size
static GLint maxTextureSize = -1;
if(maxTextureSize == -1)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
GLint maxTextureSize = 0;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
if(m_maxTextureSize == -1 || m_maxTextureSize > maxTextureSize)
m_maxTextureSize = maxTextureSize;
// check if we have alpha channel in the color buffer, because we need alpha channel for glCopyTexSubImage2D
GLint alphaBits = 0;
glGetIntegerv(GL_ALPHA_BITS, &alphaBits);
if(alphaBits <= 0)
g_logger.fatal("OpenGL visual doesn't have an alpha buffer");
selectPainterEngine(m_prefferedPainterEngine);
m_emptyTexture = TexturePtr(new Texture);
}

View File

@@ -34,7 +34,7 @@ static const std::string glslMainWithTexCoordsVertexShader = "\n\
void main()\n\
{\n\
gl_Position = calculatePosition();\n\
texCoord = textureMatrix * vec3(a_texCoord,1);\n\
texCoord = (textureMatrix * vec3(a_texCoord,1)).xy;\n\
}\n";
static std::string glslPositionOnlyVertexShader = "\n\