Hello to all!
Forgive my bad english, but i’m italian (are there any italian?) and don’t speak very well this language.
I’m try to learn opengl programming, trought the RedBook.
This is the first example of the book:
#include <whateverYouNeed.h> main() { OpenAWindowPlease(); glClearColor(0.0, 0.0, 0.0, 0.0); glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); glBegin(GL_POLYGON); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); glFlush(); KeepTheWindowOnTheScreenForAWhile(); }
These two lines:
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
set the background to black (so i’ve intended).
This:
glClearColor(0.0, 0.0, 0.0, 0.0);
set the color to black.
glClearColor take 4 parameters; but Rgb colors need only 3 paramters (red, green, blue). Why?
On the blue book there is written:
C SPECIFICATION
void glClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
So what is Alpha?