Here is my code and files, and yes I know the code is very sloppy
Main.cpp
#pragma comment(lib,"SDLmain.lib")#pragma comment(lib,"SDL_image.lib")#pragma comment(lib,"OpenGL32.lib")#pragma comment(lib,"GLU32.lib")#include <fstream>#include <iostream>#include <Windows.h>#include <SDL/SDL.h>#include <SDL/SDL_image.h>#include <gl/GL.h>#include <gl/GLU.h>#include <map>#include <vector>#include "Globals.h"int main(int argc, char * argv[]){ std::ofstream error; error.open("Error_Log.txt"); error.close(); SDL_Init(SDL_INIT_EVERYTHING); SDL_SetVideoMode(800,700,32,SDL_OPENGL | SDL_SWSURFACE); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-100.0f,100.0f,-100.0f,100.0f,-1.0f,1.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); while(1) { if(SDL_PollEvent(&event)) { if(event.type == SDL_QUIT) { break; } } glClearColor(0.0f,0.0f,0.0f,0.0f); glClear(GL_COLOR_BUFFER_BIT); SDL_GL_SwapBuffers(); } SDL_Quit(); return 0;}
Globals.h
#include <SDL\SDL.h>#ifndef GLOBALS_H#define GLOBALS_Hextern SDL_Event event;#endif
Globals.cpp
#include "Globals.h"SDL_Event event;