1
General / Re: Valgrind with SFML
« on: April 16, 2013, 05:08:05 pm »
Thank you very much binary1248!!! Updated graphics drivers and it solved my problem!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int GetNextCard(int &ReturnCard) //Idea is to set ReturnCard to the last element, then delete the element
{
ReturnCard = cards.back();
cards.pop_back();
return ReturnCard;
}
void SetNextCard(std::vector<int> &NextCard, int &ReturnCard) //Idea is to add to a new vector what the value of returncard
{ //This is done so I can use something like sprite[NextCard]
NextCard.push_back(ReturnCard); //instead of sprite[0] or sprite[1]
} //I want to use this method because for htis and splits
//the sprite[0] method seems difficult to use as there is no
void dealcardone(sf::RenderTarget& App, int x, int y) //way to determine how many cards have gone out from
{ //player to play.
if (fStop == true)
{
GetNextCard(ReturnCard); //This is my draw function, uses bool to ensure it only runs once
SetNextCard(NextCard, ReturnCard);
fStop = false;
}
SpriteCard[ReturnCard].SetPosition(x,y);
App.Draw(SpriteCard[NextCard[0]]);
}
void dealcardtwo(sf::RenderTarget& App, int x, int y)
{
if (fStop2 == true)
{
GetNextCard(ReturnCard);
SetNextCard(NextCard, ReturnCard);
fStop2 = false;
}
SpriteCard[ReturnCard].SetPosition(x,y);
App.Draw(SpriteCard[NextCard[1]]);
}
void Graphics::Render(sf::RenderTarget& App) const
{
App.Draw(spriteBJtable);
}
class Graphics : public sf::Drawable
{
public:
Graphics(){};
~Graphics(){};
virtual void Render(sf::RenderTarget& App) const;
void loadBJtable();
void sprite_loadBJtable();
void loadBCard();
void sprite_loadBCard();
private:
sf::Image BJtable;
sf::Sprite spriteBJtable;
sf::Image BCard;
sf::Sprite spriteBCard;
};
virtual void Render(sf::RenderTarget& App) const;
[code]
[code]
void Graphics::Render(sf::RenderTarget& App) const
{
App.Draw(spriteBJtable);
}
Graphic.Render(App);
void load(std::string file)
{
imgBGone.LoadFromFile(file);
}
virtual void Render(sf::RenderTarget& App) const;
void Graphics::Render(sf::RenderTarget& App) const
{
App.Draw(spriteBJtable);
}