src/render/opengles2/SDL_render_gles2.c
changeset 12595 4ecb6ce33406
parent 12594 89dbef84cdcb
child 12621 6a60a1e87d10
equal deleted inserted replaced
12594:89dbef84cdcb 12595:4ecb6ce33406
  1595     /* Bail out if we're supposed to update an empty rectangle */
  1595     /* Bail out if we're supposed to update an empty rectangle */
  1596     if (rect->w <= 0 || rect->h <= 0) {
  1596     if (rect->w <= 0 || rect->h <= 0) {
  1597         return 0;
  1597         return 0;
  1598     }
  1598     }
  1599 
  1599 
  1600     renderdata->drawstate.texture = NULL;  /* we trash this state. */
  1600     data->drawstate.texture = NULL;  /* we trash this state. */
  1601 
  1601 
  1602     /* Create a texture subimage with the supplied data */
  1602     /* Create a texture subimage with the supplied data */
  1603     data->glBindTexture(tdata->texture_type, tdata->texture);
  1603     data->glBindTexture(tdata->texture_type, tdata->texture);
  1604     GLES2_TexSubImage2D(data, tdata->texture_type,
  1604     GLES2_TexSubImage2D(data, tdata->texture_type,
  1605                     rect->x,
  1605                     rect->x,
  1675     /* Bail out if we're supposed to update an empty rectangle */
  1675     /* Bail out if we're supposed to update an empty rectangle */
  1676     if (rect->w <= 0 || rect->h <= 0) {
  1676     if (rect->w <= 0 || rect->h <= 0) {
  1677         return 0;
  1677         return 0;
  1678     }
  1678     }
  1679 
  1679 
  1680     renderdata->drawstate.texture = NULL;  /* we trash this state. */
  1680     data->drawstate.texture = NULL;  /* we trash this state. */
  1681 
  1681 
  1682     data->glBindTexture(tdata->texture_type, tdata->texture_v);
  1682     data->glBindTexture(tdata->texture_type, tdata->texture_v);
  1683     GLES2_TexSubImage2D(data, tdata->texture_type,
  1683     GLES2_TexSubImage2D(data, tdata->texture_type,
  1684                     rect->x / 2,
  1684                     rect->x / 2,
  1685                     rect->y / 2,
  1685                     rect->y / 2,
  1871     GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata;
  1871     GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata;
  1872     GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata;
  1872     GLES2_TextureData *texturedata = (GLES2_TextureData *)texture->driverdata;
  1873     GLES2_ActivateRenderer(renderer);
  1873     GLES2_ActivateRenderer(renderer);
  1874 
  1874 
  1875     data->glBindTexture(texturedata->texture_type, texturedata->texture);
  1875     data->glBindTexture(texturedata->texture_type, texturedata->texture);
  1876     renderdata->drawstate.texture = texture;
  1876     data->drawstate.texture = texture;
  1877 
  1877 
  1878     if (texw) {
  1878     if (texw) {
  1879         *texw = 1.0;
  1879         *texw = 1.0;
  1880     }
  1880     }
  1881     if (texh) {
  1881     if (texh) {