Mercurial > sdl-ios-xcode
comparison src/video/SDL_renderer_gl.c @ 2925:7e21f7662208
Swapped functions to match the other renderer files
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 30 Dec 2008 04:22:24 +0000 |
parents | dc4523c7c22d |
children | 2133d2d300fd |
comparison
equal
deleted
inserted
replaced
2924:098dc905ef51 | 2925:7e21f7662208 |
---|---|
1081 { | 1081 { |
1082 return 0; | 1082 return 0; |
1083 } | 1083 } |
1084 | 1084 |
1085 static int | 1085 static int |
1086 GL_RenderPoint(SDL_Renderer * renderer, int x, int y) | |
1087 { | |
1088 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; | |
1089 | |
1090 SetBlendMode(data, renderer->blendMode); | |
1091 | |
1092 data->glColor4f((GLfloat) renderer->r * inv255f, | |
1093 (GLfloat) renderer->g * inv255f, | |
1094 (GLfloat) renderer->b * inv255f, | |
1095 (GLfloat) renderer->a * inv255f); | |
1096 | |
1097 data->glBegin(GL_POINTS); | |
1098 data->glVertex2i(x, y); | |
1099 data->glEnd(); | |
1100 | |
1101 return 0; | |
1102 } | |
1103 | |
1104 static int | |
1105 GL_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) | |
1106 { | |
1107 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; | |
1108 | |
1109 SetBlendMode(data, renderer->blendMode); | |
1110 | |
1111 data->glColor4f((GLfloat) renderer->r * inv255f, | |
1112 (GLfloat) renderer->g * inv255f, | |
1113 (GLfloat) renderer->b * inv255f, | |
1114 (GLfloat) renderer->a * inv255f); | |
1115 | |
1116 data->glBegin(GL_LINES); | |
1117 data->glVertex2i(x1, y1); | |
1118 data->glVertex2i(x2, y2); | |
1119 data->glEnd(); | |
1120 | |
1121 return 0; | |
1122 } | |
1123 | |
1124 static int | |
1086 GL_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect) | 1125 GL_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect) |
1087 { | 1126 { |
1088 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; | 1127 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; |
1089 SDL_Window *window = SDL_GetWindowFromID(renderer->window); | 1128 SDL_Window *window = SDL_GetWindowFromID(renderer->window); |
1090 | 1129 |
1092 (GLfloat) renderer->g * inv255f, | 1131 (GLfloat) renderer->g * inv255f, |
1093 (GLfloat) renderer->b * inv255f, | 1132 (GLfloat) renderer->b * inv255f, |
1094 (GLfloat) renderer->a * inv255f); | 1133 (GLfloat) renderer->a * inv255f); |
1095 SetBlendMode(data, renderer->blendMode); | 1134 SetBlendMode(data, renderer->blendMode); |
1096 data->glRecti(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h); | 1135 data->glRecti(rect->x, rect->y, rect->x + rect->w, rect->y + rect->h); |
1097 | |
1098 return 0; | |
1099 } | |
1100 | |
1101 static int | |
1102 GL_RenderPoint(SDL_Renderer * renderer, int x, int y) | |
1103 { | |
1104 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; | |
1105 | |
1106 SetBlendMode(data, renderer->blendMode); | |
1107 | |
1108 data->glColor4f((GLfloat) renderer->r * inv255f, | |
1109 (GLfloat) renderer->g * inv255f, | |
1110 (GLfloat) renderer->b * inv255f, | |
1111 (GLfloat) renderer->a * inv255f); | |
1112 | |
1113 data->glBegin(GL_POINTS); | |
1114 data->glVertex2i(x, y); | |
1115 data->glEnd(); | |
1116 | |
1117 return 0; | |
1118 } | |
1119 | |
1120 static int | |
1121 GL_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2) | |
1122 { | |
1123 GL_RenderData *data = (GL_RenderData *) renderer->driverdata; | |
1124 | |
1125 SetBlendMode(data, renderer->blendMode); | |
1126 | |
1127 data->glColor4f((GLfloat) renderer->r * inv255f, | |
1128 (GLfloat) renderer->g * inv255f, | |
1129 (GLfloat) renderer->b * inv255f, | |
1130 (GLfloat) renderer->a * inv255f); | |
1131 | |
1132 data->glBegin(GL_LINES); | |
1133 data->glVertex2i(x1, y1); | |
1134 data->glVertex2i(x2, y2); | |
1135 data->glEnd(); | |
1136 | 1136 |
1137 return 0; | 1137 return 0; |
1138 } | 1138 } |
1139 | 1139 |
1140 static int | 1140 static int |