Concerned about learning game dev in c++

Started by
27 comments, last by DevFred 14 years, 1 month ago
I currently program in C# with XNA. Ive been programming off and on for years. I recently completed a Minesweeper clone. Im thinking about switching to C++, and probably using DirectDraw. My main concerns are that C++ will be hard to get things working, such as creating a window, getting DirectDraw to work, drawing graphics, and espcially developing a loop for the game. In C#/XNA, i downloaded and installed them, and was given the entire base/framework for creating a game (it had Update, Draw, Initialize, Graphics/Content objects, and all that other stuff. All i had to do was learn the functions. With C++, all im given is the 'main()' function. I know i have to get DirectDraw and get that working, but i have no idea how. When i do start programming, i have to set up a window to draw in. No idea how. Then i have the game run at a cirtain framerate so it doesnt consume 100% CPU. No idea how. I was never challanged with any of the basics to game development, only the "content side" because C#/XNA was so mindless and easy. So can anyone explain to me how DirectDraw is set up (the theory of how a library works, not step-by-step directions), and how setting a framerate works? XNA was simply install and it works. Ive tried to use DirectX and C++ many years ago, but i gave up because i didnt know how it worked.
Advertisement
I believe DirectDraw is deprecated.

Have you considered using something like SDL or SFML?

Most low level libraries don't have a concept that maps nicely to "setting the framerate". It is simple enough to add, you can call a blocking function that waits for vsync, this locks your framerate to the hardware (unless you draw too slowly). Adding in your own logic for limiting the framerate is pretty simple, and you might need such code anyway if you want to run a fixed time step for your game logic.
Why do you want to switch? If you're comfortable with C# and XNA then just stick with it until you have some compelling reason otherwise.
[size=2]
The main reason i wanted to switch was because i dont feel like C#+XNA is the programming that ive dreamed of. When i think of game programming, i think of starting with a blank file and going from there (aside from using an API to access hardware). C#/XNA doesnt give me the professional feeling, and it feels like im holding Microsoft's hand. I have a lot of mystery behind the framework it starts me with when i make a new program, because i dont know what happens behind the Draw(), Update(), and Initialize() functions.

Take these for example, when i start a new Game project in XNA:
GraphicsDeviceManager graphics;
ContentManager content;

I have no idea what they do aside from letting me load images and draw them.
And theres GameTime gameTime which i dont know much about. All i know is it keeps track of the amount of time that passed, and gives me functions to retrieve that time. But id still rather program that type of thing myself and create my own libraries with those functions, so i know whats going on.

And another reason i want to do C++ is i hear people talking about it being more powerful because its a lower level language, and its the "industry standard language". I dont know whats more powerful about it, but it makes me more attracted to it. I dont want to make a game fast, i want to thoroughly learn a language that i can do a lot of things with, and feel confident with it.

I should have mentioned that i have used c++ before. I learned it in 10th grade but i wasnt the best at it. I watched a long video tutorial recently, and coded as i relearned, and i did fine. I know the syntax and such to c++ but i never used an API/library with it. I also have a stack of c++ books that ive accumulated since i started programming.

I guess the main reason i want to do c++ is because it seems like a more professional language and i do all the programming. And not knowing exactly what the .NET framework and XNA does leaves me with a lot of mysteries, which kind of pushes me away and makes me lose interest in it.
C# and XNA is definetly not going away, especially with Microsofts recent announcement that it will be used to make games on PC, xbox and the new windows phon 7. I saw a video clip of someone at microsoft giving a presentation playing the same game on a PC, xbox, and windows phone 7 because it used xna across the board.

As far as C++, there are lots of different API's you could use to program a game not just directX. I have experience with Allegro and SDL. While these are i guess "not as mature or professional" as directX, picking one of them would be a good start to get your feet wet with game programming in C++. Then the transition to the more complex DirectX would be easier.

Hope that helps a little bit
Have you considered using SlimDX? That would give you a similar interface that DirectX has while still being able to use C#.
You should definitely learn C++ game techniques/APIs.

You'll learn the pros and cons a lot better that way, and make up your own mind about which is better *for you*, *for any given task*. You can also put it on your resume which can't hurt.

For programmers, more knowledge is almost always a good thing! DO IT!
Quote:Original post by Nypyren
For programmers, more knowledge is almost always a good thing! DO IT!


The OP will gain more useful knowledge actually making games in XNA than fighting C++.

Quote:
You can also put it on your resume which can't hurt.


If you haven't done it professionally, it doesn't count. I'm exaggerating of course, but not much. If you can't back it up with professional references or a slick, easy to access demo it's not going to mean anything on a resume to most places.
Quote:Original post by Telastyn
Quote:Original post by Nypyren
For programmers, more knowledge is almost always a good thing! DO IT!


The OP will gain more useful knowledge actually making games in XNA than fighting C++.


If he fights C++ he will more clearly understand why the C# alternative is there and how they differ.

Quote:
Quote:
You can also put it on your resume which can't hurt.


If you haven't done it professionally, it doesn't count. I'm exaggerating of course, but not much. If you can't back it up with professional references or a slick, easy to access demo it's not going to mean anything on a resume to most places.


Not everyone's applying to huge companies that would ignore non-professional experience. It seemed to work fine on my resume. I didn't have any professional C++ experience before my first game development job, yet I'd been using it for years on top of my college degree. Of course I could also back it up strongly during the interview as well.
Thanks for the replies. Im probably going stick with C# for now and try switching to SlimDX, which mumbo brought up. I dont plan on being a professional programmer, so i guess its not that important for me to do c++.

This topic is closed to new replies.

Advertisement