• Advertisement
Sign in to follow this  

A little Confused

This topic is 4314 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ChedderNips
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.


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
Quote:
Original post by ChedderNips
so u can write OpenGl in a C++ complier


Yup; you sure can [smile]

Share this post


Link to post
Share on other sites
ChedderNips,

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).

Now, your computer doesn't understand C++. But your compiler does...and it translates your conversation in C++ to your processor in "machine language."

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.

Hopefully this helps clear things up a bit.

Cheers and Good luck!

Share this post


Link to post
Share on other sites
Wow...you helped alot with that...thanks alot. I was just confused because OpenGl dosent look like C++ but the again im just a beginner and wasnt sure.
Thanks alot

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement