src/video/SDL_renderer_gl.c
changeset 3041 20d65430e63c
parent 3013 8cc00819c8d6
child 3253 5d7ef5970073
equal deleted inserted replaced
3040:62d4992e5a92 3041:20d65430e63c
   844 #endif
   844 #endif
   845     {
   845     {
   846         renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   846         renderdata->glTexImage2D(data->type, 0, internalFormat, texture_w,
   847                                  texture_h, 0, format, type, NULL);
   847                                  texture_h, 0, format, type, NULL);
   848     }
   848     }
       
   849     renderdata->glDisable(data->type);
   849     result = renderdata->glGetError();
   850     result = renderdata->glGetError();
   850     if (result != GL_NO_ERROR) {
   851     if (result != GL_NO_ERROR) {
   851         GL_SetError("glTexImage2D()", result);
   852         GL_SetError("glTexImage2D()", result);
   852         return -1;
   853         return -1;
   853     }
   854     }
   991     renderdata->glEnable(data->type);
   992     renderdata->glEnable(data->type);
   992     renderdata->glBindTexture(data->type, data->texture);
   993     renderdata->glBindTexture(data->type, data->texture);
   993     renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
   994     renderdata->glTexSubImage2D(data->type, 0, rect->x, rect->y, rect->w,
   994                                 rect->h, data->format, data->formattype,
   995                                 rect->h, data->format, data->formattype,
   995                                 pixels);
   996                                 pixels);
       
   997     renderdata->glDisable(data->type);
   996     result = renderdata->glGetError();
   998     result = renderdata->glGetError();
   997     if (result != GL_NO_ERROR) {
   999     if (result != GL_NO_ERROR) {
   998         GL_SetError("glTexSubImage2D()", result);
  1000         GL_SetError("glTexSubImage2D()", result);
   999         return -1;
  1001         return -1;
  1000     }
  1002     }