Advertisement

What is InitGL?

Started by May 02, 2014 11:11 PM
2 comments, last by rip-off 10 years, 8 months ago

Hello guys,
Is:


int InitGL{

}

is like:


int main(){

}
"int initGL{ }" is illegal C code.

If you meant "int initGL(){ }", then that's just a regular plain ol' function definition.

If the original spelling is correct (no parenthesis) from wherever you copied the source, then initGL is some non-standard macro specific to that source code. It's not standard to C or to OpenGL.

Sean Middleditch – Game Systems Engineer – Join my team!

Advertisement

"int initGL{ }" is illegal C code.

If you meant "int initGL(){ }", then that's just a regular plain ol' function definition.

If the original spelling is correct (no parenthesis) from wherever you copied the source, then initGL is some non-standard macro specific to that source code. It's not standard to C or to OpenGL.

Ohh you are right, I forgot those parenthesis. anyway I realized that its the main function for every opengl project.

I realized that its the main function for every opengl project.

Nope. It is possible you are reading a book or tutorial which relies heavily on such a function, but there is no special requirement to have a function called initGL(). OpenGL is a library you use, it doesn't impose such notions on your project.

Most likely, elsewhere in the book or tutorial there is a main() (or platform specific entry point like WinMain()) function which calls this initGL().

This topic is closed to new replies.

Advertisement