C/openGL

i’ve been trying to learn openGL for a while now on the web, but i find books to be more effect so yesterday i went and bouth “openGL programming Guide Fourth Editiong, The Official Guide to Learning OpenGL, Version 1.4”…ok…so i got home and finally got a chance to really start reading it [instead of glancing through at teh book store] and i saw its for programming in C :mad: ! i normally do openGL with c++…but i ran a little sample out of the book just to see if i could still work with it, when i ran the program there was 2 windows, a DOS session in the bg and the actual window with the GUI i wanted :mad: Is it normal to have that DOS window in a second window when you run your C programs? What should i do? should i return the book or what :confused: is there a significant difference between programming with C/openGL and c++/openGL, please reply soon as i doubt Borders will let me return the book after a week
Thanks, Chris.

Originally posted by biohazard:
is there a significant difference between programming with C/openGL and c++/openGL
Not really. When, it all depends by point of views. For example, some people thinks that when a function calls itself they have to use the term “recursion”. For me there’s very little difference between C and C++, but I know for sure someone will blame me for saying that.

Originally posted by biohazard:
Is it normal to have that DOS window in a second window when you run your C programs?
For beginner’s programs it is. If I am not wrong all cross-os APIs like GLUT and SDL actually do that… at least when I used them.

Originally posted by biohazard:
What should i do? should i return the book or what?
I don’t read the book but I think you’ll find it useful anyway.

Originally posted by Obli:
[QUOTE]Originally posted by biohazard:
[qb]is there a significant difference between programming with C/openGL and c++/openGL

Not really. When, it all depends by point of views. For example, some people thinks that when a function calls itself they have to use the term “recursion”. For me there’s very little difference between C and C++, but I know for sure someone will blame me for saying that.

I’m sorry if I didnt explain myself correctly, I’m not talking about “general programming” with C and C++, i know theres differences, I’m just talking about programming with them groupd, as in [C and openGL] or [C++ and openGL], is there much of a difference? All the openGL code is pretty much the same right? Forgive me if I don tknow what i’m talking about :stuck_out_tongue: , and is there anyway to get read of the “DOS session window” in the bg?

Hello Biohazard,

I don’t know if vc++ has the option but in Dev-Cpp, you can somewhere turn off starting a DOS Window. (or you start your prog directly in the dos console :wink: )
But sometimes it is quit useful to have a console for printing out debug information.

By the way, there is no great difference between c and c++ for opengl programms.
C programms almost run as c++.
One advantage with c++ is that you are able to use classes and can define your variable in a for loop :smiley: .

Sumpfratte

the book is definetely good for learning opengl, while its examples are C based, one could translate it into other languages easily I think. after all its just the “principle open gl” part that really matters, the C stuff is just basic setup around it for small test apps.
there is a lot of implementations (if you check the opengl sourceforge engines) that are c++ based, and therefore wrap opengl into it, but there is also c versions (quake2,3) and of course other languages.

the way you implement opengl into your app and make use of it, pretty much is decided by the whole setup of your app. the book being for beginners has a “minimal” setup to just get the opengl stuff going in the quickest way, and for this using GLut and c was probably the best and easiest way.
if you want no console window and a nice gui, you will need to get into app coding for your os, which is “not opengl’s” problem, it is not about the environment but just the drawing.
GLut is such a minimal environment one can use easily and x platform, but it isnt “opengl” it is just a wrapper for window/input management on different os

THANKYOU so much for all the help you guys, i really appriciate it.