| 1176 | Texture *startscreen = NULL; |
| 1177 | |
| 1178 | void loadingscreen(const char *fmt, ...) |
| 1179 | { |
| 1180 | if(!startscreen) startscreen = textureload("packages/misc/startscreen.png", 3); |
| 1181 | |
| 1182 | glEnable(GL_TEXTURE_2D); |
| 1183 | glDisable(GL_DEPTH_TEST); |
| 1184 | |
| 1185 | glMatrixMode(GL_PROJECTION); |
| 1186 | glLoadIdentity(); |
| 1187 | glOrtho(0, VIRTW, VIRTH, 0, -1, 1); |
| 1188 | |
| 1189 | glMatrixMode(GL_MODELVIEW); |
| 1190 | glLoadIdentity(); |
| 1191 | |
| 1192 | glClearColor(0, 0, 0, 1); |
| 1193 | glColor3f(1, 1, 1); |
| 1194 | |
| 1195 | loopi(fmt ? 1 : 2) |
| 1196 | { |
| 1197 | glClear(GL_COLOR_BUFFER_BIT); |
| 1198 | quad(startscreen->id, (VIRTW-VIRTH)/2, 0, VIRTH, 0, 0, 1); |
| 1199 | if(fmt) |
| 1200 | { |
| 1201 | glEnable(GL_BLEND); |
| 1202 | defvformatstring(str, fmt, fmt); |
| 1203 | int w = text_width(str); |
| 1204 | draw_text(str, w>=VIRTW ? 0 : (VIRTW-w)/2, VIRTH*3/4); |
| 1205 | glDisable(GL_BLEND); |
| 1206 | } |
| 1207 | SDL_GL_SwapWindow(screen); |
| 1208 | } |
| 1209 | |
| 1210 | glDisable(GL_TEXTURE_2D); |
| 1211 | glEnable(GL_DEPTH_TEST); |
| 1212 | } |
| 1213 | |
| 1214 | static void bar(float bar, int o, float r, float g, float b) |
| 1215 | { |
no test coverage detected