mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 05:53:26 +02:00
more opengl graphics fixes
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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\
|
||||
|
Reference in New Issue
Block a user