Permalink
Browse files

rendererGLES: use float numbers in plane2[4] since it will be running…

… on OpenGL ES, use GL_RGBA in glTextImage2D and comment unused code, refs #1100
  • Loading branch information...
rafal1137 committed Oct 6, 2018
1 parent cc2b852 commit bfe77d6d14e5028e76307f44fd548b1745171fd2
Showing with 6 additions and 13 deletions.
  1. +4 −4 src/rendererGLES/tr_backend.c
  2. +2 −9 src/rendererGLES/tr_shade.c
View
8 src/rendererGLES/tr_backend.c 100644 → 100755
@@ -341,7 +341,7 @@ void GL_State(unsigned long stateBits)
// fill/line mode
if (diff & GLS_POLYMODE_LINE)
{
qglPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
qglPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
}
// depthtest
@@ -595,7 +595,7 @@ void RB_BeginDrawingView(void)
if (backEnd.viewParms.isPortal)
{
float plane[4];
double plane2[4]; // keep this, glew expects double
float plane2[4]; // keep this, glew expects double "Android does not support glew and OpenGLES expect float"
plane[0] = backEnd.viewParms.portalPlane.normal[0];
plane[1] = backEnd.viewParms.portalPlane.normal[1];
@@ -861,7 +861,7 @@ void RE_StretchRaw(int x, int y, int w, int h, int cols, int rows, const byte *d
{
tr.scratchImage[client]->width = tr.scratchImage[client]->uploadWidth = cols;
tr.scratchImage[client]->height = tr.scratchImage[client]->uploadHeight = rows;
qglTexImage2D(GL_TEXTURE_2D, 0, 3, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -947,7 +947,7 @@ void RE_UploadCinematic(int w, int h, int cols, int rows, const byte *data, int
{
tr.scratchImage[client]->width = tr.scratchImage[client]->uploadWidth = cols;
tr.scratchImage[client]->height = tr.scratchImage[client]->uploadHeight = rows;
qglTexImage2D(GL_TEXTURE_2D, 0, 3, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
qglTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cols, rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
View
11 src/rendererGLES/tr_shade.c 100644 → 100755
@@ -204,15 +204,15 @@ static void DrawTris(shaderCommands_t *input)
Ren_LogComment("glLockArraysEXT\n");
}
R_DrawElements(input->numIndexes, input->indexes);
qglDrawElements(GL_LINE_STRIP, input->numIndexes, GL_INDEX_TYPE, input->indexes );
if (qglUnlockArraysEXT)
{
qglUnlockArraysEXT();
Ren_LogComment("glUnlockArraysEXT\n");
}
qglDepthRange(0, 1);
qglDisable(GL_POLYGON_OFFSET_FILL);
//qglDisable(GL_POLYGON_OFFSET_FILL);
}
/**
@@ -344,13 +344,6 @@ static void DrawMultitextured(shaderCommands_t *input, int stage)
GL_State(pStage->stateBits);
// this is an ugly hack to work around a GeForce driver
// bug with multitexture and clip planes
if (backEnd.viewParms.isPortal)
{
qglPolygonMode(GL_FRONT_AND_BACK, GL_LINES);
}
// base
GL_SelectTexture(0);
qglTexCoordPointer(2, GL_FLOAT, 0, input->svars.texcoords[0]);

0 comments on commit bfe77d6

Please sign in to comment.