Recommended Posts

I have some questions about OpenGl Programming. I have read the book "C++ Without fear" by Brian Overland and i thought it was an amazing beginners book( but it was the only Programming book i have read). I took some advice and read a General C++ book Before jumping into how C++ is used in games. I purchased Beginning C++ Game Programming and Beginning OpenGl game programming online in a 2 for 1 special. Now come my ?'s. Is openGl C++ as it pertains to graphics. Do you use a C++ Complier for OpenGl. Any other explinations would be great. Thanks ladies and gents.

0

Share this post

Link to post

Share on other sites

Original post by ChedderNipsI have some questions about OpenGl Programming. I have read the book "C++ Without fear" by Brian Overland and i thought it was an amazing beginners book( but it was the only Programming book i have read). I took some advice and read a General C++ book Before jumping into how C++ is used in games. I purchased Beginning C++ Game Programming and Beginning OpenGl game programming online in a 2 for 1 special. Now come my ?'s. Is openGl C++ as it pertains to graphics. Do you use a C++ Complier for OpenGl. Any other explinations would be great. Thanks ladies and gents.

OpenGL is a C API. So you can write games using OpenGL in pure C. But nowadays most people use C++ mixed with OpenGL (any C++ compiler can also compile C so there's no problem using a C API in C++).

Share this post

Link to post

Share on other sites

To help clarify things a bit, keep in mind that C++ is a "language" that you speak to tell the computer what to do.

Now, just like human language, you can talk about multiple things using C++. You can talk about graphics, physics, artificial intelligence, user input, audio, networking, memory management...and the list goes on and on.

In programming, whenever you use a "topic" which is well documentated and has already been "discussed" by someone else, you're generally referring to an Application Programming Interface (API). In other words, OpenGL is just a "topic" which you can "talk about" in C++. In this case, OpenGL happens to be a topic on Graphics (Its a Graphics API).

So in summary, you use C++ to talk to your processor. Since your processor doesnt know C++ your compiler must first convert what you program into something your processor understands. Just like spoken languages, C++ allows you to program a wide array of things, including graphics, AI, sound, etc...ususally, but not always, you'll use a helper library called an "API" which is just a set of functions, structures, classes, etc...which make talking to your processor about a well-defined topic easier.