diff options
author | neoraider <devnull@localhost> | 2005-04-18 17:27:00 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2005-04-18 17:27:00 +0200 |
commit | f3df7ef89aa15aed2e4d68e2b414d31aef57f976 (patch) | |
tree | 53c5630e7a890dc6c1b0b0a2d631119a21da984a /init.c | |
download | libzoom-f3df7ef89aa15aed2e4d68e2b414d31aef57f976.tar libzoom-f3df7ef89aa15aed2e4d68e2b414d31aef57f976.zip |
Verzeichnisstruktur ge?ndert
Diffstat (limited to 'init.c')
-rw-r--r-- | init.c | 65 |
1 files changed, 65 insertions, 0 deletions
@@ -0,0 +1,65 @@ +#include <stdlib.h> +#include <GL/gl.h> +#include <GL/glu.h> +#include <zoom/init.h> +#include <zoom/texture.h> +#include <zoom/level.h> + +LEVEL level; +GLuint sphere; +GLuint meditex_blue; + +extern TEXLIST *texlist; + +int InitGame() { + GLfloat mat_ambient_and_diffuse[] = { 0.5, 0.5, 0.5, 1.0}; + glViewport(0, 0, 640, 480); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(50.0, 640.0/480.0, 0.1, 1000.0); + + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + glShadeModel(GL_SMOOTH); + glClearColor(0.0, 0.0, 0.0, 0.0); + glClearDepth(1.0); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + + glEnable(GL_CULL_FACE); + glFrontFace(GL_CCW); + + glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mat_ambient_and_diffuse); + + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + + meditex_blue = LoadTexture("medib.tex"); + glEnable(GL_TEXTURE_2D); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + GLUquadricObj *quadric = gluNewQuadric(); + gluQuadricDrawStyle(quadric, GLU_FILL); + gluQuadricTexture(quadric, GL_TRUE); + + LoadLevel("level2.lvl", &level); + + sphere = glGenLists(1); + glNewList(sphere, GL_COMPILE); + glRotatef(90, 1.0, 0.0, 0.0); + gluSphere(quadric, 1.0, 24, 24); + glEndList(); + + gluDeleteQuadric(quadric); + + return 1; +} + +void UninitGame() { + FreeLevel(&level); + free(texlist); +} |