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
|
//ScreenOpenGL.cpp
#include "ScreenOpenGL.h"
void Screen::Draw()
{
}
int Screen::Title(bool InvOpen)
{
if (bool InvOpen = true)
glClearColor(5.f, 5.f, 0.f, 1.f);
else
glClearColor(1.f, 0.f, 0.f, 1.f);
glClear (GL_COLOR_BUFFER_BIT); //Clear the colour buffer (more buffers later on)
glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations
//Draw everything we've done on the screen (for single buffer mode)
glFlush();
return 0;
}
//passing the width and height into the function when it is called
void Screen::Resize(int width, int height)
{
//setting to resize the window
glViewport (0,0, (GLsizei)width, (GLsizei)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
// Set the Field of view angle (in degrees), the aspect ratio of our window, and the new and far planes
gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0);
// Switch back to the model view matrix, so that we can start drawing shapes correctly
glMatrixMode(GL_MODELVIEW);
}
|