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 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
#include "SDL.h"
#include "SDL_opengl.h"
#include "player.h"
#include "Invest.h"
#include <iostream>
using namespace std;
bool run =true;
SDL_Event event1;
int main( int argc, char* args[] )
{
float botx1;
float boty1;
//OBJECTS
player p1;
Invest guy;
//SDL/ Window set=up/////////////
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Surface* screen;
screen = SDL_SetVideoMode(600,400,32, SDL_OPENGL | SDL_SWSURFACE );
glViewport(0,0,600,400);
glLoadIdentity();
//disable depth checking
glDisable(GL_DEPTH_TEST);
/////////////////////////////////////////////////
p1.set(5,5, 30, 30, 180, 230, 30, true, 0, false, false);
guy.menu();
while (run)
{
p1.move();
run=p1.testClose();
//End of events
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix(); //Start rendering phase
glOrtho( 0, 600, 400, 0, -1, 1 );
glColor4ub(200,200,200,0);
p1.draw();
SDL_GL_SwapBuffers();
glPopMatrix(); //End rendering phase
}
SDL_Quit();
return 0;
}
|