First question, is it possible/useful to program OpenGL just with C and not C++? If it’s possible, does it have severe limitations on what I can do? I have just finished a cource on C and would like to get things happening with OGL straight away instead of learning C++.
In as little code as possible, what’s the minimum I need to get a triangle rendered? I want to avoid all the setup of windows etc. Does GLUT work with plain C? Ideally, I’d like a ‘hello world’ program that draws a triangle instead of a text string. I’ve read the tutorials at NeHe and all the things about setting up windows is really too tedious.
Lastly, am I taking the wrong mentality already? Should I be learning all the tedious stuff first or C++ before I take on learning OpenGL?
It is easier to program OpenGL in VC6 or Visual C++ 6 for me, but that is my opinion. And it would be a good idea to learn all you can in C++ before trying to start OpenGL Programming, but that is also my opinion.
Thanks guys
The red book 55 line code example is very enlightening.
Just curious, how powerful is GLUT? If one ever wanted to build concise but powerful programs like shadows, smoke etc, or maybe expose the latest feature of a new GPU, would one still use GLUT?
GLUT is for creating windows and handle input, that’s all. It doesn’t care what you do in OpenGL. And it’s really not the best windowing API if you want to make a larger program, but that isn’t the point with GLUT either.
[This message has been edited by Bob (edited 12-06-2002).]
// Disable vertical sync (on cards that support it)
glfwSwapInterval( 0 );
// Main loop
running = GL_TRUE;
frames = 0;
t0 = glfwGetTime();
while( running )
{
// Get time and mouse position
t = glfwGetTime();
glfwGetMousePos( &x, &y );
C is enough for getting started with OpenGL, and even advanced. And actually C++ makes no easier to do windows/input tasks easier… but glfw and glut are easier to deal than winapi(and even MFC), but knowing winapi gives you more control over your programs windows layerying, input… etc.
It would even be better for everyone to use winapi within C++…