Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fixed crash when drawing non-textured primitives

  • Loading branch information
slouken committed Feb 17, 2011
1 parent ea710d3 commit 7cd4f75a348418b3bfff90575fdf2fc92d38436d
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/render/opengles/SDL_render_gles.c
@@ -239,16 +239,14 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
glLoadIdentity();

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
//glEnableClientState(GL_TEXTURE_COORD_ARRAY);

return renderer;
}

static void
GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
{
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;

if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
/* Rebind the context to the window area and update matrices */
SDL_CurrentContext = NULL;
@@ -595,13 +593,11 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
int minx, miny, maxx, maxy;
GLfloat minu, maxu, minv, maxv;
int i;
void *temp_buffer; /* used for reformatting dirty rect pixels */
void *temp_ptr;

GLES_ActivateRenderer(renderer);

glEnable(GL_TEXTURE_2D);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

glBindTexture(texturedata->type, texturedata->texture);

@@ -672,7 +668,8 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}


glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_TEXTURE_2D);

return 0;

0 comments on commit 7cd4f75

Please sign in to comment.