diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2019-09-02 21:33:14 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2019-09-02 21:33:14 +0200 |
commit | e17f14db7213fd27c4fa864ca57e6c2b4dbd79ec (patch) | |
tree | f45d25a15d3a25f45a49fa87b909fed39965f560 /src/main.c | |
parent | 643420376e22d72d62a34b00f6b3d4c3e6eca979 (diff) | |
download | demoscene-eo-e17f14db7213fd27c4fa864ca57e6c2b4dbd79ec.tar.gz demoscene-eo-e17f14db7213fd27c4fa864ca57e6c2b4dbd79ec.tar.bz2 demoscene-eo-e17f14db7213fd27c4fa864ca57e6c2b4dbd79ec.zip |
First try for GL drawing. Scene 00 cannot render after scene01_init.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 22 |
1 files changed, 2 insertions, 20 deletions
@@ -77,28 +77,10 @@ int main(void) if ( ge.sdl_target == NULL ) return 9; ge.raw_target = malloc(256*256*4); if ( ge.raw_target == NULL ) return 10; - ge.gl_ctx = SDL_GL_CreateContext(ge.sdl_win); - if ( ge.gl_ctx == NULL ) return 11; - // Initialize OpenGL - glShadeModel(GL_SMOOTH); - glClearDepth(1.0f); - glEnable(GL_DEPTH_TEST); - glDepthFunc(GL_LEQUAL); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); - - glDisable(GL_TEXTURE_2D); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glEnable(GL_CULL_FACE); - glCullFace(GL_FRONT); - glViewport(0, 0, (GLsizei)256, (GLsizei)256); - glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, 1.0f, 0.1f, 100.0f); // 1.0f==ratio - glMatrixMode(GL_MODELVIEW); glLoadIdentity(); + ge.gl_ctx = SDL_GL_CreateContext(ge.sdl_win); + if ( ge.gl_ctx == NULL ) return 11; // Main libcaca loop for caca window (OpenGL could be used in sceneN_next()) ge.framecount=0; |