Sign in to follow this  
Guhill

I have a pretty wide understanding of C++, now...

Recommended Posts

I just finished my sophomore year in High School and I finished a C++ programming class and have a pretty wide understanding of it. Now I'm ready to combine it with OpenGL so that I can start writing games with graphics and sound. How does all that work? Is openGL a programming language itself? or just an add on to C++ and you are still coding in C++ with more commands that come with the openGL add-on? That whole thing is confusing to me and I am uneasy stepping into untouched territory without a basic understanding of it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
oh, function calls which allow for sound and graphics? okay, that makes more sense. Thanks.


No, not sound. Graphics and only graphics.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
I finished a C++ programming class and have a pretty wide understanding of it.
It seems like asome strange euphemism about term wide.
Quote:
That whole thing is confusing to me and I am uneasy stepping into untouched territory without a basic understanding of it.


You seems to need a some experience (2 years+) with programming. It's intuitive when you know what are you doing, however I VERY doubt an introductionary course in C++ would give you ANY clue. Look at NEHE tutorials, they are bad, they are very bad, however they are one of the few very consistent and freely available tutorials.
Start with a moving picture on the screen. If you would have it working and without bugs (and loading any image) you could continue with some other finese.
BTW there are three working ways how to do it.

Share this post


Link to post
Share on other sites
actually I do have more than 2 years in programming, just not programming with C++. I have been coding in DarkBASIC Professional for 3 years, and in C++ for like 8 months. But I guess you're right, I probably should do some more coding in C++ before I go into openGL. I do, however have a slight problem... there are no more C++ coding classes available at my High School. There are 2 Java courses available which I will be taking my Junior year. If I want to further my knowledge in C++ I will have to teach myself using a book or pay for a class at TVI... hmmm

Share this post


Link to post
Share on other sites
Quote:
Original post by Raghar
It seems like asome strange euphemism about term wide.


Well, he said "wide" and not "deep", which kind of sounds like what such classes are doing. They give you a nice overview and afterwards you know ABOUT most things, but don't really know anything in detail. You might know what templates are, but wouldn't guess all the neat things you can do with them (and they probably even skipped template specialization).

That said, I basically picked up C/C++ while learning OpenGL. It's possible and I didn't really feel like I was struggling. Of course, the book used a pretty pragmatic mix of C/C++ and my coding style still hasn't recovered. Also, OpenGL as such is plain C, so knowing C++ inside out isn't really necessary.

Share this post


Link to post
Share on other sites
Quote:
I probably should do some more coding in C++ before I go into openGL.
I would rather say: Just try it out and see how far you can get. If you should not manage to get it running, skip it, do other things and come back later. If you should manage to get it running - all the better! I really think you will at least learn a lot from the approach.
The best way for a tentative start might be to look into the (already mentioned) Nehe Tutorials. Work through the first three or four Tuts. If you understand them, continue.

Share this post


Link to post
Share on other sites
"wide" not "deep" is correct. If the openGl functions are in the C language, will that make it tougher, or will knowing C++ suffice? Ok, I will try the Nehe tutorials. Thanks to everyone who replied to this thread.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
"wide" not "deep" is correct.


Not really, I think the term you are looking for here is "broad":

"I have a broad understanding of C++"
"He had a deeper understanding of the language than I guessed!"
"How wide was his understanding?"
"wtf mate?"

Guhill - knowing C++ won't hinder you with Nehe - there is plenty of C++ source code and tutorials lying around on that site. Just be careful to avoid lapsing into C-style coding with C++ - that's bad karma. Instead, start implementing the features in a C++ way, by encapsulating VertexBuffers in a class, for example. When you get to them, that is. :D

Share this post


Link to post
Share on other sites
Use the API manual, not google to look up functions(msdn if ur doing windows programming), only use a search engine as a last resort.

There are simly too many bad coding samples that don't really explain anything, using msdn for example will give you all the info you need and usually come with straight to the point examples.

And I'd say 2years experience with any 3GL is more than enough to start with OpenGL in c++, I never really learned c++ as far as I can remember, I just started using it.

Share this post


Link to post
Share on other sites
Starting with OpenGL doesn't really require any amazing or in depth knowledge of C/C++. Of course you'll have to buy book(s) and learn yourself, but I'd say your biggest problem will be the math and theory behind graphics programming which have nothing to do with the programming languange. They're not that difficult to grasp though, at least at beginner's level. Be sure to get the Red Book(an online version is free) and learn the fundamentals well: 90% of the problems I see from beginners are not really from poor understanding of C++(how hard it can be to make a bunch of function calls?), but from poor understanding of things like matrices, coordinate systems, lighting equations and such.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
actually I do have more than 2 years in programming, just not programming with C++. I have been coding in DarkBASIC Professional for 3 years, and in C++ for like 8 months. But I guess you're right, I probably should do some more coding in C++ before I go into openGL. I do, however have a slight problem... there are no more C++ coding classes available at my High School. There are 2 Java courses available which I will be taking my Junior year. If I want to further my knowledge in C++ I will have to teach myself using a book or pay for a class at TVI... hmmm


Classes are for slouches (but also for credits, ironically). You'll probably learn faster if you get a good solid book and just get going with it.

Share this post


Link to post
Share on other sites
You might want to try out 'pure' Win32 programs before you go into OpenGL. Win32 is necessary for OpenGL, so you're either learning it first, or learning it at the same time as OpenGL.

Or, you could save yourself a bunch of time/hassle and use SDL instead of Win32.

Share this post


Link to post
Share on other sites
Quote:
Original post by ronkfist
There are simly too many bad coding samples that don't really explain anything, using msdn for example will give you all the info you need and usually come with straight to the point examples.


the following post by promit pretty much says it all: what makes source code tutorials so bad?

msdn is a great resource, and not all of the information found there applies only to windows. the official opengl programming and reference books (red book/blue book) are also very handy.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hmmm, two things that were said that I don't agree with are:

-"Win32 is necessary". This is just 100% incorrect. If you needed Win32 then how the heck would you be able to develop for linux/etc. If you want an easier way to set up windows and handle basic input just use glut(provided you're using OpenGL). Glut has its drawbacks as well but for game development you don't need much else at the introductory level.

-It doesn't really matter how deep you're understanding of the C++ language is. Chances are that if you want to pursue a career as a programmer (or in a related field) you will go to university and take either a computer science degree or a software engineering degree. Both of these will allow you to learn both the science of engineering and the art of programming. A language is just a language. Does it matter if you speak English? French? Italian? Arabic? No! Similarily it doesn't really matter what programming language you are most proficient in. Learning a new programming language is easy once you've formed a solid programming knowledge base. What I'm really trying to say with all this is that you are still in High School. Play around with OpenGL if you want. You have lots of time to learn. I didn't even start with OpenGL until I was in my third year of university and I got a job in the game industry. The only real words of warning I'll give you at this point are: Don't get ahead of yourself. No game you produce will be anywhere near as big/beautiful as these multi-million dollar productions coming out from professional dev-houses. But that doesn't mean that your games can't be fun (which is the most important part).

Lastly, don't ignore mathematics. At least get a basic understanding of vector/matrix math. I know you're still young and you may or may not have covered these in school, but they are necessary for game development (you can probably get away without them for a very simple 2D game, but I wouldn't count on it).

Share this post


Link to post
Share on other sites
firstly, what is SDL, Win32, and Glut, what are those?

Secondly, are vectors and all that covered in regular mathematics, like calculus, trig, and precalculus, or do I need to take some special "type" of math. Because that's all I have left to take, I have taken everything else and will have it all done by the end of high school.

thirdly, no, I don't want commercial quality games, I just enjoy coding and would like to make some of my own, possibly shareware, but I am not putting my expectations too high. I would, however, like to get a job in a game development company somday.

Once again I would like to thank all of you for taking your time to reply to this thread.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
firstly, what is SDL, Win32, and Glut, what are those?

Secondly, are vectors and all that covered in regular mathematics, like calculus, trig, and precalculus, or do I need to take some special "type" of math. Because that's all I have left to take, I have taken everything else and will have it all done by the end of high school.

thirdly, no, I don't want commercial quality games, I just enjoy coding and would like to make some of my own, possibly shareware, but I am not putting my expectations too high. I would, however, like to get a job in a game development company somday.

Once again I would like to thank all of you for taking your time to reply to this thread.


The win32 API is how you use C/C++ to set up windows windows (that sounds redundant). You need to create a Win32 window before you are able to draw any opengl graphics onto it. SDL and glut are some libraries that make the process of creating a window MUCH easier and even work with linux and mac.

Trigonometry and algebra is VERY useful for 3D programming. You need to have a good understanding of vectors, vector math, right triangle manipulation, etc. I would say that calculus is not really that important starting out. There are times when integrals and derivatives can be helpful, but not often. The general understanding of what an integral and derivative are probably a good idea.

Share this post


Link to post
Share on other sites
So do I just install SDL or glut and they are used automatically or do I have to use them manually every time I code. Is there like a command in C++ that allows for usage of them? I have taken ALG I and II, and Geometry, and gotten A's in all of them which is good because they were advanced placement, and I'll be taking advanced placement Trig next semester as well. Cool name, Sr. Guapo. Unfortunately, mine would probably be Sr. Tonto, lol.

Share this post


Link to post
Share on other sites
Quote:
Original post by Guhill
So do I just install SDL or glut and they are used automatically or do I have to use them manually every time I code. Is there like a command in C++ that allows for usage of them? I have taken ALG I and II, and Geometry, and gotten A's in all of them which is good because they were advanced placement, and I'll be taking advanced placement Trig next semester as well. Cool name, Sr. Guapo. Unfortunately, mine would probably be Sr. Tonto, lol.


Well, I believe glut is included with OpenGL (not 100%), so it should already be there. You will have to link to the correct library and then include the headers for it. I will personally recommend SDL. From my experience with it, it is very easy to use and quite efficient. You will need to download the runtimes here. There are articles on the site about setting it up and using it.

Tonto is a bit harsh. Believe me, everyone starts out the same way. Eventually everything starts to click and make sense. Just keep trying and hanging out here and ina couple years, you will be making some awesome games!

Share this post


Link to post
Share on other sites
Quote:
Original post by Sr_Guapo
Well, I believe glut is included with OpenGL (not 100%)


In general it's not. You can get a Windows version here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this