Modified OpenGL ES render driver to support new SDL_RenderFill, SDL_RenderLine, and SDL_RenderPoint.
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403411
This commit is contained in:
parent
bfa8620949
commit
6b02e2aeb6
2 changed files with 42 additions and 16 deletions
|
@ -86,7 +86,7 @@ SDL_PROC_UNUSED(void, glColor4x,
|
|||
SDL_PROC_UNUSED(void, glColorMask,
|
||||
(GLboolean red, GLboolean green, GLboolean blue,
|
||||
GLboolean alpha))
|
||||
SDL_PROC_UNUSED(void, glColorPointer,
|
||||
SDL_PROC(void, glColorPointer,
|
||||
(GLint size, GLenum type, GLsizei stride,
|
||||
const GLvoid * pointer))
|
||||
SDL_PROC_UNUSED(void, glCompressedTexImage2D,
|
||||
|
@ -110,7 +110,7 @@ SDL_PROC_UNUSED(void, glDepthFunc, (GLenum func))
|
|||
SDL_PROC_UNUSED(void, glDepthMask, (GLboolean flag))
|
||||
SDL_PROC_UNUSED(void, glDepthRangex, (GLclampx zNear, GLclampx zFar))
|
||||
SDL_PROC(void, glDisable, (GLenum cap))
|
||||
SDL_PROC_UNUSED(void, glDisableClientState, (GLenum array))
|
||||
SDL_PROC(void, glDisableClientState, (GLenum array))
|
||||
SDL_PROC(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count))
|
||||
SDL_PROC_UNUSED(void, glDrawElements,
|
||||
(GLenum mode, GLsizei count, GLenum type,
|
||||
|
|
|
@ -632,11 +632,15 @@ GLES_RenderPoint(SDL_Renderer * renderer, int x, int y)
|
|||
(GLfloat) renderer->b * inv255f,
|
||||
(GLfloat) renderer->a * inv255f);
|
||||
|
||||
/* FIXME:
|
||||
data->glBegin(GL_POINTS);
|
||||
data->glVertex2i(x, y);
|
||||
data->glEnd();
|
||||
*/
|
||||
GLshort vertices[2];
|
||||
vertices[0] = x;
|
||||
vertices[1] = y;
|
||||
|
||||
data->glVertexPointer(2, GL_SHORT, 0, vertices);
|
||||
data->glEnableClientState(GL_VERTEX_ARRAY);
|
||||
data->glDrawArrays(GL_POINTS, 0, 1);
|
||||
data->glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -652,12 +656,17 @@ GLES_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
|
|||
(GLfloat) renderer->b * inv255f,
|
||||
(GLfloat) renderer->a * inv255f);
|
||||
|
||||
/* FIXME:
|
||||
data->glBegin(GL_LINES);
|
||||
data->glVertex2i(x1, y1);
|
||||
data->glVertex2i(x2, y2);
|
||||
data->glEnd();
|
||||
*/
|
||||
GLshort vertices[4];
|
||||
vertices[0] = x1;
|
||||
vertices[1] = y1;
|
||||
vertices[2] = x2;
|
||||
vertices[3] = y2;
|
||||
|
||||
data->glVertexPointer(2, GL_SHORT, 0, vertices);
|
||||
data->glEnableClientState(GL_VERTEX_ARRAY);
|
||||
data->glDrawArrays(GL_LINES, 0, 2);
|
||||
data->glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -673,9 +682,26 @@ GLES_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect)
|
|||
(GLfloat) renderer->b * inv255f,
|
||||
(GLfloat) renderer->a * inv255f);
|
||||
|
||||
/* FIXME:
|
||||
data->glRecti(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h);
|
||||
*/
|
||||
GLshort minx = rect->x;
|
||||
GLshort maxx = rect->x + rect->w;
|
||||
GLshort miny = rect->y;
|
||||
GLshort maxy = rect->y + rect->h;
|
||||
|
||||
GLshort vertices[8];
|
||||
vertices[0] = minx;
|
||||
vertices[1] = miny;
|
||||
vertices[2] = maxx;
|
||||
vertices[3] = miny;
|
||||
vertices[4] = minx;
|
||||
vertices[5] = maxy;
|
||||
vertices[6] = maxx;
|
||||
vertices[7] = maxy;
|
||||
|
||||
data->glVertexPointer(2, GL_SHORT, 0, vertices);
|
||||
data->glEnableClientState(GL_VERTEX_ARRAY);
|
||||
data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
|
||||
data->glDisableClientState(GL_VERTEX_ARRAY);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue