/
start_screen.cpp
53 lines (47 loc) · 1.21 KB
/
start_screen.cpp
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
#include <GL/gl.h>
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <windows.h>
#include "controls.h"
#include "main.h"
#include "fonts.h"
#include "display.h"
#include "plane.h"
void drawStart(float zz)
{
glColor3f(0.9f, 0.9f, 0.9f);
glBegin(GL_POLYGON);
glVertex3f(0.0f, -1.0f, zz);
glVertex3f(1.0f, -1.0f, zz);
glVertex3f(1.5f, -0.5f, zz);
glVertex3f(1.5f, 0.5f, zz);
glVertex3f(1.0f, 1.0f, zz);
glVertex3f(-1.0f, 1.0f, zz);
glVertex3f(-1.5f, 0.5f, zz);
glVertex3f(-1.5f, -0.5f, zz);
glVertex3f(-1.0f, -1.0f, zz);
glVertex3f(0.0f, -1.0f, zz);
glEnd();
setOrthographicProjection();
renderBitmapString(-1.0f, 0.0f, 0.5f,fontBitmap,(char *)"START");
restorePerspectiveProjection();
}
void renderDisplayStart(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
gluLookAt( 0.0f, 0.0f, 10.0f,
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f);
drawStart(0.0f);
setOrthographicProjection();
glPushMatrix();
glLoadIdentity();
glColor3f(0.0f, 0.0f, 1.0f);
renderBitmapString(315,250,1,fontBitmap,(char *)"START");
glPopMatrix();
restorePerspectiveProjection();
glutSwapBuffers();
}