When calling qglDrawRangeElementsEXT(), use proper start and end parameters.
This commit is contained in:
parent
8234225459
commit
86984eb536
7 changed files with 115 additions and 36 deletions
|
@ -366,6 +366,8 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
int s, t;
|
||||
int firstVertex = tess.numVertexes;
|
||||
//int firstIndex = tess.numIndexes;
|
||||
int minIndex = tess.minIndex;
|
||||
int maxIndex = tess.maxIndex;
|
||||
vec4_t color;
|
||||
|
||||
//tess.numVertexes = 0;
|
||||
|
@ -415,6 +417,9 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
}
|
||||
}
|
||||
|
||||
tess.minIndex = firstVertex;
|
||||
tess.maxIndex = tess.numVertexes;
|
||||
|
||||
// FIXME: A lot of this can probably be removed for speed, and refactored into a more convenient function
|
||||
RB_UpdateVBOs(ATTR_POSITION | ATTR_TEXCOORD);
|
||||
/*
|
||||
|
@ -458,7 +463,7 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
GLSL_SetUniformMatrix16(sp, GENERIC_UNIFORM_DIFFUSETEXMATRIX, matrix);
|
||||
}
|
||||
|
||||
R_DrawElementsVBO(tess.numIndexes - tess.firstIndex, tess.firstIndex);
|
||||
R_DrawElementsVBO(tess.numIndexes - tess.firstIndex, tess.firstIndex, tess.minIndex, tess.maxIndex);
|
||||
|
||||
//qglDrawElements(GL_TRIANGLES, tess.numIndexes - tess.firstIndex, GL_INDEX_TYPE, BUFFER_OFFSET(tess.firstIndex * sizeof(GL_INDEX_TYPE)));
|
||||
|
||||
|
@ -468,6 +473,8 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
|
|||
tess.numIndexes = tess.firstIndex;
|
||||
tess.numVertexes = firstVertex;
|
||||
tess.firstIndex = 0;
|
||||
tess.minIndex = minIndex;
|
||||
tess.maxIndex = maxIndex;
|
||||
}
|
||||
|
||||
static void DrawSkyBox( shader_t *shader )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue