OpenGLES: remove RenderCopy and RenderCopyEx from back-end
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
diff --git a/src/render/opengles/SDL_glesfuncs.h b/src/render/opengles/SDL_glesfuncs.h
index 4b74958..18d7540 100644
--- a/src/render/opengles/SDL_glesfuncs.h
+++ b/src/render/opengles/SDL_glesfuncs.h
@@ -57,10 +57,6 @@ SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei))
SDL_PROC_OES(void, glBindFramebufferOES, (GLenum, GLuint))
SDL_PROC_OES(void, glFramebufferTexture2DOES, (GLenum, GLenum, GLenum, GLuint, GLint))
SDL_PROC_OES(GLenum, glCheckFramebufferStatusOES, (GLenum))
-SDL_PROC(void, glPushMatrix, (void))
-SDL_PROC(void, glTranslatef, (GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glRotatef, (GLfloat, GLfloat, GLfloat, GLfloat))
-SDL_PROC(void, glPopMatrix, (void))
SDL_PROC_OES(void, glDeleteFramebuffersOES, (GLsizei, const GLuint*))
/* vi: set ts=4 sw=4 expandtab: */
diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
index 4fa256f..cb06e13 100644
--- a/src/render/opengles/SDL_render_gles.c
+++ b/src/render/opengles/SDL_render_gles.c
@@ -633,129 +633,6 @@ GLES_QueueFillRects(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_F
}
static int
-GLES_QueueCopy(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture,
- const SDL_Rect * srcrect, const SDL_FRect * dstrect)
-{
- GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
- GLfloat minx, miny, maxx, maxy;
- GLfloat minu, maxu, minv, maxv;
- GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, 16 * sizeof (GLfloat), 0, &cmd->data.draw.first);
-
- if (!verts) {
- return -1;
- }
-
- cmd->data.draw.count = 1;
-
- minx = dstrect->x;
- miny = dstrect->y;
- maxx = dstrect->x + dstrect->w;
- maxy = dstrect->y + dstrect->h;
-
- minu = (GLfloat) srcrect->x / texture->w;
- minu *= texturedata->texw;
- maxu = (GLfloat) (srcrect->x + srcrect->w) / texture->w;
- maxu *= texturedata->texw;
- minv = (GLfloat) srcrect->y / texture->h;
- minv *= texturedata->texh;
- maxv = (GLfloat) (srcrect->y + srcrect->h) / texture->h;
- maxv *= texturedata->texh;
-
- *(verts++) = minx;
- *(verts++) = miny;
- *(verts++) = maxx;
- *(verts++) = miny;
- *(verts++) = minx;
- *(verts++) = maxy;
- *(verts++) = maxx;
- *(verts++) = maxy;
-
- *(verts++) = minu;
- *(verts++) = minv;
- *(verts++) = maxu;
- *(verts++) = minv;
- *(verts++) = minu;
- *(verts++) = maxv;
- *(verts++) = maxu;
- *(verts++) = maxv;
-
- return 0;
-}
-
-static int
-GLES_QueueCopyEx(SDL_Renderer * renderer, SDL_RenderCommand *cmd, SDL_Texture * texture,
- const SDL_Rect * srcquad, const SDL_FRect * dstrect,
- const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
-{
- GLES_TextureData *texturedata = (GLES_TextureData *) texture->driverdata;
- GLfloat minx, miny, maxx, maxy;
- GLfloat centerx, centery;
- GLfloat minu, maxu, minv, maxv;
- GLfloat *verts = (GLfloat *) SDL_AllocateRenderVertices(renderer, 19 * sizeof (GLfloat), 0, &cmd->data.draw.first);
-
- if (!verts) {
- return -1;
- }
-
- centerx = center->x;
- centery = center->y;
-
- if (flip & SDL_FLIP_HORIZONTAL) {
- minx = dstrect->w - centerx;
- maxx = -centerx;
- }
- else {
- minx = -centerx;
- maxx = dstrect->w - centerx;
- }
-
- if (flip & SDL_FLIP_VERTICAL) {
- miny = dstrect->h - centery;
- maxy = -centery;
- }
- else {
- miny = -centery;
- maxy = dstrect->h - centery;
- }
-
- minu = (GLfloat) srcquad->x / texture->w;
- minu *= texturedata->texw;
- maxu = (GLfloat) (srcquad->x + srcquad->w) / texture->w;
- maxu *= texturedata->texw;
- minv = (GLfloat) srcquad->y / texture->h;
- minv *= texturedata->texh;
- maxv = (GLfloat) (srcquad->y + srcquad->h) / texture->h;
- maxv *= texturedata->texh;
-
- cmd->data.draw.count = 1;
-
- *(verts++) = minx;
- *(verts++) = miny;
- *(verts++) = maxx;
- *(verts++) = miny;
- *(verts++) = minx;
- *(verts++) = maxy;
- *(verts++) = maxx;
- *(verts++) = maxy;
-
- *(verts++) = minu;
- *(verts++) = minv;
- *(verts++) = maxu;
- *(verts++) = minv;
- *(verts++) = minu;
- *(verts++) = maxv;
- *(verts++) = maxu;
- *(verts++) = maxv;
-
- *(verts++) = (GLfloat) dstrect->x + centerx;
- *(verts++) = (GLfloat) dstrect->y + centery;
- *(verts++) = (GLfloat) angle;
-
- return 0;
-}
-
-#if SDL_HAVE_RENDER_GEOMETRY
-static int
GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
const float *xy, int xy_stride, const int *color, int color_stride, const float *uv, int uv_stride,
int num_vertices, const void *indices, int num_indices, int size_indices,
@@ -812,7 +689,6 @@ GLES_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *
}
return 0;
}
-#endif
static void
SetDrawState(GLES_RenderData *data, const SDL_RenderCommand *cmd)
@@ -1028,35 +904,13 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert
break;
}
- case SDL_RENDERCMD_COPY: {
- const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first);
- SetCopyState(data, cmd);
- data->glVertexPointer(2, GL_FLOAT, 0, verts);
- data->glTexCoordPointer(2, GL_FLOAT, 0, verts + 8);
- data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+ case SDL_RENDERCMD_COPY: /* unused */
break;
- }
- case SDL_RENDERCMD_COPY_EX: {
- const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first);
- const GLfloat translatex = verts[16];
- const GLfloat translatey = verts[17];
- const GLfloat angle = verts[18];
- SetCopyState(data, cmd);
- data->glVertexPointer(2, GL_FLOAT, 0, verts);
- data->glTexCoordPointer(2, GL_FLOAT, 0, verts + 8);
-
- /* Translate to flip, rotate, translate to position */
- data->glPushMatrix();
- data->glTranslatef(translatex, translatey, 0.0f);
- data->glRotatef(angle, 0.0, 0.0, 1.0);
- data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
- data->glPopMatrix();
+ case SDL_RENDERCMD_COPY_EX: /* unused */
break;
- }
case SDL_RENDERCMD_GEOMETRY: {
-#if SDL_HAVE_RENDER_GEOMETRY
const GLfloat *verts = (GLfloat *) (((Uint8 *) vertices) + cmd->data.draw.first);
SDL_Texture *texture = cmd->data.draw.texture;
const size_t count = cmd->data.draw.count;
@@ -1079,7 +933,6 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert
data->glDrawArrays(GL_TRIANGLES, 0, (GLsizei) count);
data->glDisableClientState(GL_COLOR_ARRAY);
-#endif
break;
}
@@ -1312,11 +1165,7 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
renderer->QueueDrawPoints = GLES_QueueDrawPoints;
renderer->QueueDrawLines = GLES_QueueDrawLines;
renderer->QueueFillRects = GLES_QueueFillRects;
- renderer->QueueCopy = GLES_QueueCopy;
- renderer->QueueCopyEx = GLES_QueueCopyEx;
-#if SDL_HAVE_RENDER_GEOMETRY
renderer->QueueGeometry = GLES_QueueGeometry;
-#endif
renderer->RunCommandQueue = GLES_RunCommandQueue;
renderer->RenderReadPixels = GLES_RenderReadPixels;
renderer->RenderPresent = GLES_RenderPresent;