Learning to create games using c++ and openGL Help

Started by
3 comments, last by Aliii 11 years, 4 months ago

Hello, getting straight to business

I don't know how many instances you guys have read about a person wanting to create a game, well all I have to say is that its just an incredible thing to go out and do. For me it has been a life long dream to create a game, the designing is especially fun. The idea that you can create anything is just fascinating! I keep on telling myself i'm going to start learning the c++ language, this time I am going to start. So as I was going through those pages of text and explanations, I was constantly perplexed by API, CALL's and such. I can't enumerate all of these but I will say a few. My plan is to learn c++ (it is documented well and there seems to be lots of people who can give support) and afterwords understand openGL to implement it into later projects. But to state my confusion:

- What is an API, yes I have read all over the internet and they all give fairly the same explanation; an application programming interface

- how does openGL work? Do you create your code and when you need to show something on screen (text, 3d meshes etc) you just implement that in your game loop?

- Also this is not a question in respect to c++ or openGL but maybe a request for some suggestions from the experts who have "been there done that" so to speak. I know I want to use c++ and openGL. What are some things you guys recommend as far as creating games using c++/openGL. I understand that I am going to need to learn a myriad of things but I know if I persevere I can learn something useful.

Background: Currently learning c++ and pre-calculus (senior in High school) I can also work my way around basic arduino projects, just so you know that i'm not completely a beginner in programming, I still need work though. I am an intermediate user in Blender 3D, and understand the basics of Photoshop CS6.

Thank you for taking the time to read this and all advice given.

Advertisement

Make sure you learn C++ first (without graphics). Then I'd suggest using a 2D API like SFML. Then move to a 3D one like OpenGL. But skipping from zero graphics to 3D is fine too.

- What is an API, yes I have read all over the internet and they all give fairly the same explanation; an application programming interface

An API is a collection of code functions and classes that do something specific for you so you don't have to do it yourself. OpenGL is a 3D API. It does the complicated math, and complicated interacting with the videocard, to present 3D graphics onscreen so you don't have to learn how the hardware of the videocard works, or how to convert pretend triangles to real pixels onscreen.

APIs are also sometimes called "libraries". As in, a "library" of functions. There are also computer files called 'libraries' (either 'static' or 'dynamically linked libraries) which on Windows have the extension '.a' (static library) and '.dll' (dynamically linked library). An API is usually (but not always) a collection of one or more 'library' files that your .exe program interacts with (either while being compiled, or when being ran).

- how does openGL work? Do you create your code and when you need to show something on screen (text, 3d meshes etc) you just implement that in your game loop?

Yes-ish. OpenGL provides a collection of functions. Your code can call OpenGL functions. OpenGL is low level (meaning less easy to use, and closer to the metal), so it doesn't provide text rendering or 3D model loading in itself (and instead provides the foundation that text rendering or 3D models can be added ontop of). OpenGL provides mostly the ability to draw millions of textured triangles very fast - and games are made up of triangles.

- Also this is not a question in respect to c++ or openGL but maybe a request for some suggestions from the experts who have "been there done that" so to speak. I know I want to use c++ and openGL. What are some things you guys recommend as far as creating games using c++/openGL. I understand that I am going to need to learn a myriad of things but I know if I persevere I can learn something useful.

The best thing to do is learn one thing at a time. C++ is complicated enough to learn without trying to learn additional things at once.
I'd suggest getting a thick C++ programming book (one written within the past 5 years), and a thinner C++ book to use as a reference and as an alternative source of descriptions. Also, bookmark a C++ documentation website, and have the patience to understand that it will take awhile.

Yeah I agree with Servant. Take your time with c++. U will have your hands full with it for atleast a year. You gotta spend some time getting the feel of the language(this goes for any language). Just dont try to rush things and or take too many things at once or overdue stuff. Be consistent yet practical. Like do an hour of c++ everyday, not like 4 hours lol. Keep a balance with school and hobbies. At first you might lea0nrs tons of features but forget the syntax. Once you get into more advance stuff and use these features then rembering the syntax becomes easier, and it actually becomes intuitive. For example I learned inheritance but barely used it untill now. When I first learned pointers i could barely wrap my head around them, now that I use them normally, it becomes easier to understand concepts that u didnt understand before.

Thank you so much, I appreciate the comments a lot. I plan to stay at gamedev, and ask some more questions.

Sorry, but why do you want to do it the hard way if you are already doing well with Blender? If you choose to do it with C++ & OpenGL, your progress will be very very slow compared to using an engine.(+you have to learn additional thing like a sound API, WinAPI, learning 3D math, physics, etc.) Depends where do you want to continue your studies and how many other "hobbies" you have ....but once you get a dayjob you wont have time and energy to do C++ at home. Just a warning:)

Anyway if you want to do it this way:

-dont start to read a 1000+ page C++ book. Learn the basics then learn the rest as you go

-you probably already know that but you dont need C++ for openGL. C works too

-start with the fixed-pipeline openGL

-you can have fun with 3D, but if you want a finished game then concentrate on 2D

...and welcome to GameDev! :)

This topic is closed to new replies.

Advertisement