Blackjack in C++?

Started by
10 comments, last by Ataru58 16 years, 5 months ago
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!
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.
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.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
I would also suggest SDL or Allegro.

SDL homepage
Allegro sourceforge page

A good tutorial for starting out in SDL is Lazyfoo's SDL tutorials. (They've helped me quite a bit)
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.
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.
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.
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
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.
You forgot '-lSDL'.

-lmingw32 -lSDLmain -lSDL -lSDL_image

This topic is closed to new replies.

Advertisement