Untitled
By: a guest | Feb 9th, 2010 | Syntax:
None | Size: 1.13 KB | Hits: 24 | Expires: Never
/*
-------------------------------------------------------------------------------------------
S.D.L.(R) 1.2.x GTR(OpenGL)
Source (C)opyright 2010, by Silent Hero Productions(R)
-------------------------------------------------------------------------------------------
*/
#include "SDL/SDL.h"
#include "SDL/SDL_opengl.h"
int main( int argc, char* args[] )
{
if ( SDL_Init(SDL_INIT_VIDEO) != 0 )
{
printf("Unable to initialize SDL: %s\n", SDL_GetError());
return 1;
}
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL);
glEnable( GL_TEXTURE_2D );
glClearColor( 1.0f, 1.0f, 1.0f, 0.0f );
glViewport( 0, 0, 640, 480 );
glClear( GL_COLOR_BUFFER_BIT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
SDL_GL_SwapBuffers();
SDL_Delay(3000);
SDL_Quit();
return 0;
}
// TM
// "A 100% By JeZ+Lee" of Silent Hero Productions(R)