Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: None | Size: 1.13 KB | Hits: 24 | Expires: Never
Copy text to clipboard
  1. /*
  2. -------------------------------------------------------------------------------------------
  3.              S.D.L.(R) 1.2.x GTR(OpenGL)
  4.  
  5. Source (C)opyright 2010, by Silent Hero Productions(R)
  6. -------------------------------------------------------------------------------------------
  7. */
  8.  
  9. #include "SDL/SDL.h"
  10. #include "SDL/SDL_opengl.h"
  11.  
  12. int main( int argc, char* args[] )
  13. {
  14.     if ( SDL_Init(SDL_INIT_VIDEO) != 0 )
  15.     {
  16.         printf("Unable to initialize SDL: %s\n", SDL_GetError());
  17.         return 1;
  18.     }
  19.  
  20.     SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
  21.  
  22.     SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL);
  23.  
  24.  
  25.     glEnable( GL_TEXTURE_2D );
  26.  
  27.     glClearColor( 1.0f, 1.0f, 1.0f, 0.0f );
  28.  
  29.     glViewport( 0, 0, 640, 480 );
  30.  
  31.     glClear( GL_COLOR_BUFFER_BIT );
  32.  
  33.     glMatrixMode( GL_PROJECTION );
  34.     glLoadIdentity();
  35.  
  36.     glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f);
  37.  
  38.     glMatrixMode( GL_MODELVIEW );
  39.     glLoadIdentity();
  40.  
  41.  
  42.     SDL_GL_SwapBuffers();
  43.  
  44.  
  45.     SDL_Delay(3000);
  46.  
  47.     SDL_Quit();
  48.     return 0;
  49. }
  50. //                  TM
  51. // "A 100% By JeZ+Lee" of Silent Hero Productions(R)