OpenGL and SDL question

Hello everybody,

I am working on a video game for my programming class right now using SDL and open GL. I am stumped on this part of my code. Originally, my professor just gave us an example using one hand from a deck. Now he wants us to use the entire deck in the game.

this is with only one hand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Make Texure/Billboard objects
	steal = new Billboard();
	steal->load("images\\steal.bmp", 10);
	keep = new Billboard();
	keep->load("images\\keep.bmp", 20);
	die = new Billboard();
	die->load("images\\die.bmp", 30);
	draw = new Billboard();
	draw->load("images\\draw.bmp", 40);
	cardBack = new Texture("images\\cardback.bmp", 2);
	char faces[13][16] = {	"images\\h2.bmp", "images\\h3.bmp", "images\\h4.bmp", "images\\h5.bmp", "images\\h6.bmp", "images\\h7.bmp", 
							"images\\h8.bmp", "images\\h9.bmp", "images\\h10.bmp", "images\\hJ.bmp", "images\\hQ.bmp", "images\\hK.bmp", "images\\hA.bmp"};
	cards = new Texture *[13];
	for (int f = 0; f < 13; f++)
	{
		cards[f] = new Texture(faces[f], 100+f);
	}


this is my attempt at putting in the entire deck
1
2
3
4
5
6
7
8
9
10
11
12
13
char faces[52][25] = {	"images\\h2.bmp", "images\\h3.bmp", "images\\h4.bmp", "images\\h5.bmp", "images\\h6.bmp", "images\\h7.bmp", 
							"images\\h8.bmp", "images\\h9.bmp", "images\\h10.bmp", "images\\hJ.bmp", "images\\hQ.bmp", "images\\hK.bmp", "images\\hA.bmp",
							"images\\d2.bmp","images\\d3.bmp","images\\d4.bmp","images\\d5.bmp","images\\d6.bmp","images\\d7.bmp","images\\d8.bmp",
							"images\\d9.bmp","images\\d10.bmp","images\\dJ.bmp","images\\dQ.bmp","images\\dK.bmp","images\\dA.bmp","images\\s2.bmp",
							"images\\s3.bmp","images\\s4.bmp","images\\s5.bmp","images\\s6.bmp","images\\s7.bmp","images\\s8.bmp","images\\s9.bmp",
							"images\\s10.bmp","images\\sJ.bmp","images\\sQ.bmp","images\\sK.bmp","images\\sA.bmp", "images\\c2.bmp","images\\c3.bmp",
							"images\\c4.bmp","images\\c5.bmp","images\\c6.bmp","images\\c7.bmp","images\\c8.bmp","images\\c9.bmp","images\\c10.bmp",
							"images\\cJ.bmp","images\\cQ.bmp","images\\cK.bmp","images\\cA.bmp"};
	cards = new Texture *[52];
	for (int f = 0; f < 52; f++)
	{
		cards[f] = new Texture(faces[f], 100+f);
	}


My game only shows the heart deck but I need it to show the others! Please enlighten me with your knowledge! Thank you!
A few questions:

1) Where is the code the draws the Heart deck, and what is the code that draws the others?
2) What is the second parameter to the Billboard and Texture class constructor?
3) When you say it "only shows the heart deck," does that mean that the other decks just don't appear? Do they show garbage data? Are they all rasterized with a single color?
4) What sort of error-checking does Billboard::load do when it creates the texture? If the task is delegated to the Texture class, what does Texture do for error-checking?
5) What resolution are the card images?
6) What are the specs on your graphics hardware?

EDIT:
7) Have you tested the program on computers other than your own?
Last edited on
@NGen: My question is, why does he have char faces[52][25]? I am missing something apparently as I thought it would only need char faces[52]. It may just be the fact that it is midnight, but isn't that the equivalent of having 52 boxes each holding 25 items?
Last edited on by closed account z6A9GNh0
@BHXSpecter
Look at how it is declared and assigned, 52 c-strings with max length of 25 (24 +'\0') that hold the path and filename of the images.
Topic archived. No new replies allowed.