Jump to content
  • Advertisement
Sign in to follow this  
Ataru58

Blackjack in C++?

This topic is 3938 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

Since I've been having such a ball creating a PHP version of Blackjack, I wonder if I could get some help creating a BJ version for C++. I've got all the image files for all the cards including the back. Can anyone give me a basic starting point? I've been looking at the windows.h and that looks simultaneously daunting and confusing. Any help or advice would be most appreciated!

Share this post


Link to post
Share on other sites
Advertisement
C++ by itself doesn't have a way to draw graphics, so you'll have to learn a graphics API:

A) Use the Windows API. It's ugly, it's slow, it's simple, but it will work on any windows PC.
B) Use OpenGL. It's cross-platform.
C) Use DirectX. It's probably a bit easier to use than OpenGL, but it only works on windows.

I'd recommend either B or C, because they are hardware accelerated, and can do 3D as well as 2D, which means if you want to make more complex games in the future then you've already learnt the basics.

DirectX comes with some utility functions to load in your images, but if you use OpenGL then you will either have to load the images yourself or use an image loading library like DevIL or SOIL.

Share this post


Link to post
Share on other sites
They are not your only options. Others include Allegro and SDL - libraries that wrap up DirectX and OpenGL for you, and provide many useful functions (such as drawing images). If you're going for a nice, simple game in C++, there's no need to have to deal with the complexities of a low-level graphics API.

Share this post


Link to post
Share on other sites
Alright, I installed Allegro on Dev-C++. I'm also installing the SDL for it too. Any tutorials or advice to get me started? I'm looking for the very basics in using these, since I'm a newbie to this.

Share this post


Link to post
Share on other sites
If you look in the forum FAQ there are a few links there to tutorials with both allegro and sdl to get you started you can probably find some more with a simple google search. Just follow the tutorials keep practicing you'll be alright, good luck.

Share this post


Link to post
Share on other sites
Wow, without that monolithic window making, these seems like they could be done rather easily. This could be fun! I'll be practicing it all day. I'm gonna see what I can concoct. I've never used most of these things before like SDL or anything similar, I'm currently reading the Lazy Foo tutorial and it's pretty good.

Share this post


Link to post
Share on other sites
Well, Alegro is all fun and games, but, if you're like me, trying to understand every thing that you do, it just might come in handy to spend the time to learn an API. I chosed OpenGL a long time ago, and once you start "getting it" it's rather simple and yet fun. I recommend the nehe site for learning OpenGL (it's discontinued now, but has a solid base of tutorials). In order to do what you want, you must only follow the first 6 tutorials (up until the txture mapping one), but if you like, you don't have to stop there. Oh, the site is nehe.gamedev.net . Enjoy

Share this post


Link to post
Share on other sites
I appear to be have a linker error in one of the tutorials at Lazy Foo. Lesson 6, I've got this in parameters(-lmingw32 -lSDLmain -lSDL_image) just like it said, but it gives me a few linker errors like SDL_FreeSurface and SDL_RGB and SDL_DisplayFormat. Anyone know what's wrong? I've gone through the first few lessons and even copied them exactly, but I don't know why i get the linker errors.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!