Clean GLES sections
This commit is contained in:
parent
6329e3bb13
commit
6faa23cba3
4 changed files with 11 additions and 25 deletions
src
|
@ -108,13 +108,8 @@ static void CreateMinimapTexture(void)
|
|||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
glGenTextures(1, &MinimapTexture);
|
||||
glBindTexture(GL_TEXTURE_2D, MinimapTexture);
|
||||
#ifdef USE_GLES
|
||||
#warning TODO: Port glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); to GLES
|
||||
#warning TODO: Port glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); to GLES
|
||||
#else
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, MinimapTextureWidth,
|
||||
|
|
|
@ -983,13 +983,8 @@ static void MakeTextures2(CGraphic *g, GLuint texture, CUnitColors *colors,
|
|||
|
||||
SDL_LockSurface(g->Surface);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
#ifdef USE_GLES
|
||||
#warning TODO: Port glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); to GLES
|
||||
#warning TODO: Port glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); to GLES
|
||||
#else
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
#endif
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
for (int i = 0; i < maxh; ++i) {
|
||||
|
@ -1053,11 +1048,9 @@ static void MakeTextures2(CGraphic *g, GLuint texture, CUnitColors *colors,
|
|||
}
|
||||
|
||||
GLint internalformat = GL_RGBA;
|
||||
#ifndef USE_GLES
|
||||
if (GLTextureCompressionSupported && UseGLTextureCompression) {
|
||||
internalformat = GL_COMPRESSED_RGBA;
|
||||
}
|
||||
#endif
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalformat, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex);
|
||||
|
||||
|
|
|
@ -367,9 +367,7 @@ void SaveScreenshotPNG(const char *name)
|
|||
fprintf(stderr, "Out of memory\n");
|
||||
exit(1);
|
||||
}
|
||||
#ifdef USE_GLES
|
||||
#warning TODO: Port glReadBuffer(GL_FRONT); to GLES
|
||||
#else
|
||||
#ifndef USE_GLES
|
||||
glReadBuffer(GL_FRONT);
|
||||
#endif
|
||||
glReadPixels(0, 0, Video.Width, Video.Height, GL_RGB, GL_UNSIGNED_BYTE,
|
||||
|
|
|
@ -260,27 +260,27 @@ static void InitOpenGL(void)
|
|||
InitOpenGLExtensions();
|
||||
|
||||
glViewport(0, 0, (GLsizei)Video.Width, (GLsizei)Video.Height);
|
||||
|
||||
|
||||
#ifndef USE_GLES
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_GLES
|
||||
glOrthof(0.0f, (GLfloat)Video.Width, (GLfloat)Video.Height, 0.0f, -1.0f, 1.0f);
|
||||
#else
|
||||
glOrtho(0, Video.Width, Video.Height, 0, -1, 1);
|
||||
#endif
|
||||
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
|
||||
#ifndef USE_GLES
|
||||
glTranslatef(0.375, 0.375, 0.);
|
||||
#endif
|
||||
|
||||
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
|
||||
#ifdef USE_GLES
|
||||
glClearDepthf(1.0f);
|
||||
#else
|
||||
|
|
Loading…
Add table
Reference in a new issue