More non C89 compliant comments

This commit is contained in:
Gabriel Jacobo 2013-08-20 20:34:40 -03:00
parent 63fe3a7753
commit 552b04c58a
28 changed files with 252 additions and 248 deletions

View file

@ -332,19 +332,19 @@ SDL_GL_LoadTexture(SDL_Surface * surface, GLfloat * texcoord)
}
/* A general OpenGL initialization function. Sets all of the initial parameters. */
void InitGL(int Width, int Height) // We call this right after our OpenGL window is created.
void InitGL(int Width, int Height) /* We call this right after our OpenGL window is created. */
{
GLdouble aspect;
glViewport(0, 0, Width, Height);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // This Will Clear The Background Color To Black
glClearDepth(1.0); // Enables Clearing Of The Depth Buffer
glDepthFunc(GL_LESS); // The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glShadeModel(GL_SMOOTH); // Enables Smooth Color Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); /* This Will Clear The Background Color To Black */
glClearDepth(1.0); /* Enables Clearing Of The Depth Buffer */
glDepthFunc(GL_LESS); /* The Type Of Depth Test To Do */
glEnable(GL_DEPTH_TEST); /* Enables Depth Testing */
glShadeModel(GL_SMOOTH); /* Enables Smooth Color Shading */
glMatrixMode(GL_PROJECTION);
glLoadIdentity(); // Reset The Projection Matrix
glLoadIdentity(); /* Reset The Projection Matrix */
aspect = (GLdouble)Width / Height;
glOrtho(-3.0, 3.0, -3.0 / aspect, 3.0 / aspect, 0.0, 1.0);
@ -363,29 +363,29 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord)
MAXY
};
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
glLoadIdentity(); // Reset The View
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* Clear The Screen And The Depth Buffer */
glLoadIdentity(); /* Reset The View */
glTranslatef(-1.5f,0.0f,0.0f); // Move Left 1.5 Units
glTranslatef(-1.5f,0.0f,0.0f); /* Move Left 1.5 Units */
// draw a triangle (in smooth coloring mode)
glBegin(GL_POLYGON); // start drawing a polygon
glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glEnd(); // we're done with the polygon (smooth color interpolation)
/* draw a triangle (in smooth coloring mode) */
glBegin(GL_POLYGON); /* start drawing a polygon */
glColor3f(1.0f,0.0f,0.0f); /* Set The Color To Red */
glVertex3f( 0.0f, 1.0f, 0.0f); /* Top */
glColor3f(0.0f,1.0f,0.0f); /* Set The Color To Green */
glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */
glColor3f(0.0f,0.0f,1.0f); /* Set The Color To Blue */
glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */
glEnd(); /* we're done with the polygon (smooth color interpolation) */
glTranslatef(3.0f,0.0f,0.0f); // Move Right 3 Units
glTranslatef(3.0f,0.0f,0.0f); /* Move Right 3 Units */
// Enable blending
/* Enable blending */
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// draw a textured square (quadrilateral)
/* draw a textured square (quadrilateral) */
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture);
glColor3f(1.0f,1.0f,1.0f);
@ -393,23 +393,23 @@ void DrawGLScene(SDL_Window *window, GLuint texture, GLfloat * texcoord)
glUseProgramObjectARB(shaders[current_shader].program);
}
glBegin(GL_QUADS); // start drawing a polygon (4 sided)
glBegin(GL_QUADS); /* start drawing a polygon (4 sided) */
glTexCoord2f(texcoord[MINX], texcoord[MINY]);
glVertex3f(-1.0f, 1.0f, 0.0f); // Top Left
glVertex3f(-1.0f, 1.0f, 0.0f); /* Top Left */
glTexCoord2f(texcoord[MAXX], texcoord[MINY]);
glVertex3f( 1.0f, 1.0f, 0.0f); // Top Right
glVertex3f( 1.0f, 1.0f, 0.0f); /* Top Right */
glTexCoord2f(texcoord[MAXX], texcoord[MAXY]);
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glVertex3f( 1.0f,-1.0f, 0.0f); /* Bottom Right */
glTexCoord2f(texcoord[MINX], texcoord[MAXY]);
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glEnd(); // done with the polygon
glVertex3f(-1.0f,-1.0f, 0.0f); /* Bottom Left */
glEnd(); /* done with the polygon */
if (shaders_supported) {
glUseProgramObjectARB(0);
}
glDisable(GL_TEXTURE_2D);
// swap buffers to display, since we're double buffered.
/* swap buffers to display, since we're double buffered. */
SDL_GL_SwapWindow(window);
}