src/render/opengles/SDL_render_gles.c
changeset 12593 307b9da13612
parent 12531 af47ff0de5ab
child 12621 6a60a1e87d10
equal deleted inserted replaced
12592:10722106b650 12593:307b9da13612
   389     renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   389     renderdata->glTexParameteri(data->type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
   390 
   390 
   391     renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   391     renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   392                              texture_h, 0, format, type, NULL);
   392                              texture_h, 0, format, type, NULL);
   393     renderdata->glDisable(GL_TEXTURE_2D);
   393     renderdata->glDisable(GL_TEXTURE_2D);
       
   394     renderdata->drawstate.texture = texture;
       
   395     renderdata->drawstate.texturing = SDL_FALSE;
   394 
   396 
   395     result = renderdata->glGetError();
   397     result = renderdata->glGetError();
   396     if (result != GL_NO_ERROR) {
   398     if (result != GL_NO_ERROR) {
   397         SDL_free(data);
   399         SDL_free(data);
   398         return GLES_SetError("glTexImage2D()", result);
   400         return GLES_SetError("glTexImage2D()", result);
   451                     data->format,
   453                     data->format,
   452                     data->formattype,
   454                     data->formattype,
   453                     src);
   455                     src);
   454     renderdata->glDisable(data->type);
   456     renderdata->glDisable(data->type);
   455     SDL_free(blob);
   457     SDL_free(blob);
       
   458 
       
   459     renderdata->drawstate.texture = texture;
       
   460     renderdata->drawstate.texturing = SDL_FALSE;
   456 
   461 
   457     if (renderdata->glGetError() != GL_NO_ERROR) {
   462     if (renderdata->glGetError() != GL_NO_ERROR) {
   458         return SDL_SetError("Failed to update texture");
   463         return SDL_SetError("Failed to update texture");
   459     }
   464     }
   460     return 0;
   465     return 0;
  1058     GLES_ActivateRenderer(renderer);
  1063     GLES_ActivateRenderer(renderer);
  1059 
  1064 
  1060     data->glEnable(GL_TEXTURE_2D);
  1065     data->glEnable(GL_TEXTURE_2D);
  1061     data->glBindTexture(texturedata->type, texturedata->texture);
  1066     data->glBindTexture(texturedata->type, texturedata->texture);
  1062 
  1067 
       
  1068     data->drawstate.texture = texture;
       
  1069     data->drawstate.texturing = SDL_TRUE;
       
  1070 
  1063     if (texw) {
  1071     if (texw) {
  1064         *texw = (float)texturedata->texw;
  1072         *texw = (float)texturedata->texw;
  1065     }
  1073     }
  1066     if (texh) {
  1074     if (texh) {
  1067         *texh = (float)texturedata->texh;
  1075         *texh = (float)texturedata->texh;
  1074 {
  1082 {
  1075     GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
  1083     GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
  1076     GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
  1084     GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
  1077     GLES_ActivateRenderer(renderer);
  1085     GLES_ActivateRenderer(renderer);
  1078     data->glDisable(texturedata->type);
  1086     data->glDisable(texturedata->type);
       
  1087 
       
  1088     data->drawstate.texture = NULL;
       
  1089     data->drawstate.texturing = SDL_FALSE;
  1079 
  1090 
  1080     return 0;
  1091     return 0;
  1081 }
  1092 }
  1082 
  1093 
  1083 static SDL_Renderer *
  1094 static SDL_Renderer *