#include <Windows.h>
#include <gl\GL.h>
#include "SDL.h"
int main(int argc, char* argv[])
{
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32);
SDL_Init(SDL_INIT_VIDEO);
SDL_SetVideoMode(900, 600, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_NOFRAME);
glViewport(0, 0, 900, 600);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0);
glDepthFunc(GL_LESS);
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
glMatrixMode(GL_PROJECTION);
glMatrixMode(GL_MODELVIEW);
SDL_Quit();
return 0;
}
The exact error message I am getting when I run the program is this, "Unhandled exception at 0x6812a8b9 in OpenGL.exe: 0xC0000005: Access violation writing location 0x00000160."
What's the issue?
This post has been edited by ghillieLEAD: 24 February 2011 - 07:00 PM

New Topic/Question
Reply




MultiQuote




|