src/video/SDL_renderer_gles.c
changeset 2949 4eabc35fbb4a
parent 2937 017d4334accf
child 2964 0faae272a372
     1.1 --- a/src/video/SDL_renderer_gles.c	Thu Jan 01 23:01:05 2009 +0000
     1.2 +++ b/src/video/SDL_renderer_gles.c	Thu Jan 01 23:47:33 2009 +0000
     1.3 @@ -632,11 +632,15 @@
     1.4                      (GLfloat) renderer->b * inv255f,
     1.5                      (GLfloat) renderer->a * inv255f);
     1.6  
     1.7 -/* FIXME:
     1.8 -    data->glBegin(GL_POINTS);
     1.9 -    data->glVertex2i(x, y);
    1.10 -    data->glEnd();
    1.11 -*/
    1.12 +	GLshort vertices[2];
    1.13 +	vertices[0] = x;
    1.14 +	vertices[1] = y;
    1.15 +	
    1.16 +	data->glVertexPointer(2, GL_SHORT, 0, vertices);
    1.17 +	data->glEnableClientState(GL_VERTEX_ARRAY);
    1.18 +	data->glDrawArrays(GL_POINTS, 0, 1);
    1.19 +	data->glDisableClientState(GL_VERTEX_ARRAY);
    1.20 +	
    1.21      return 0;
    1.22  }
    1.23  
    1.24 @@ -652,12 +656,17 @@
    1.25                      (GLfloat) renderer->b * inv255f,
    1.26                      (GLfloat) renderer->a * inv255f);
    1.27  
    1.28 -/* FIXME:
    1.29 -    data->glBegin(GL_LINES);
    1.30 -    data->glVertex2i(x1, y1);
    1.31 -    data->glVertex2i(x2, y2);
    1.32 -    data->glEnd();
    1.33 -*/
    1.34 +	GLshort vertices[4];
    1.35 +	vertices[0] = x1;
    1.36 +	vertices[1] = y1;
    1.37 +	vertices[2] = x2;
    1.38 +	vertices[3] = y2;
    1.39 +
    1.40 +	data->glVertexPointer(2, GL_SHORT, 0, vertices);
    1.41 +	data->glEnableClientState(GL_VERTEX_ARRAY);
    1.42 +	data->glDrawArrays(GL_LINES, 0, 2);
    1.43 +	data->glDisableClientState(GL_VERTEX_ARRAY);
    1.44 +
    1.45      return 0;
    1.46  }
    1.47  
    1.48 @@ -673,9 +682,26 @@
    1.49                      (GLfloat) renderer->b * inv255f,
    1.50                      (GLfloat) renderer->a * inv255f);
    1.51  
    1.52 -/* FIXME:
    1.53 -    data->glRecti(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h);
    1.54 -*/
    1.55 +	GLshort minx = rect->x;
    1.56 +	GLshort maxx = rect->x + rect->w;
    1.57 +	GLshort miny = rect->y;
    1.58 +	GLshort maxy = rect->y + rect->h;
    1.59 +	
    1.60 +	GLshort vertices[8];
    1.61 +	vertices[0] = minx;
    1.62 +	vertices[1] = miny;
    1.63 +	vertices[2] = maxx;
    1.64 +	vertices[3] = miny;
    1.65 +	vertices[4] = minx;
    1.66 +	vertices[5] = maxy;
    1.67 +	vertices[6] = maxx;
    1.68 +	vertices[7] = maxy;
    1.69 +	
    1.70 +	data->glVertexPointer(2, GL_SHORT, 0, vertices);
    1.71 +	data->glEnableClientState(GL_VERTEX_ARRAY);
    1.72 +	data->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    1.73 +	data->glDisableClientState(GL_VERTEX_ARRAY);
    1.74 +
    1.75      return 0;
    1.76  }
    1.77