summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2019-09-02 21:33:14 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2019-09-02 21:33:14 +0200
commite17f14db7213fd27c4fa864ca57e6c2b4dbd79ec (patch)
treef45d25a15d3a25f45a49fa87b909fed39965f560 /src/main.c
parent643420376e22d72d62a34b00f6b3d4c3e6eca979 (diff)
downloaddemoscene-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.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/main.c b/src/main.c
index a73bf44..3f18052 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;