[Code] Update

This commit is contained in:
Andre Meyering 2018-11-28 15:48:19 +01:00
parent deac21d289
commit 012bc11487

View file

@ -155,8 +155,6 @@ void displaycloud(int modus)
glDisable(GL_TEXTURE_2D);
}
///////////////////////////////////////////////////////////////////////////////////
if (modus > 0) {
@ -224,6 +222,19 @@ void display(void)
GLfloat s_plane[] = { 0, 0, 1, 0 };
GLfloat t_plane[] = { 0, 1, 0, 0 };
if (textureMode == 1) { // OBJECT LINEAR
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
} else if (textureMode == 2) { // EYE LINEAR
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
}
glTexGenfv(GL_S, GL_OBJECT_PLANE, s_plane);
glTexGenfv(GL_T, GL_OBJECT_PLANE, t_plane);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (lights == 1) {
@ -324,7 +335,7 @@ void init(void)
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glClearColor(0.99, 0.99, 0.99, 0.0);
glClearColor(0.99f, 0.99f, 0.99f, 0.0);
glLoadIdentity();
xoff = 0.0;
yoff = 0.0;
@ -339,14 +350,22 @@ void init(void)
readBitmap();
// Texture wrap settings
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
// Filter settings
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
// Connecting lighting and texture
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
// Initialize texture
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, WIDTH, HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, bitmapImage);
// enable automatic texture generation
glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T);
//////////////////////////////////////////////////////////////////////////////////////////////////////
}