1
General / Re: Define structure with a sf::RenderWindow in it.
« on: March 21, 2020, 10:40:06 pm »
Holy fuck i'm a dumbass. Anyway I have one more question this time hopefully its less stupid. So i'm trying to get multiple windows open at once and im trying to do that by having a void that functions like the while loop would. It has a for loop that goes through a array of my structure key.
Key
This is my void
When Ever I try to use KeyArray.Window it says expression must have class type. How do I fix this?
Key
typedef struct KeyStruct {
sf::Image Img;
sf::Texture Tex;
sf::Sprite Sprite;
sf::RenderWindow* Window;//pointer because it is uncopyable
}NewKey;
sf::Image Img;
sf::Texture Tex;
sf::Sprite Sprite;
sf::RenderWindow* Window;//pointer because it is uncopyable
}NewKey;
This is my void
static void StepWindows()
{
sf::Clock clock;
int i;
for (i = 0; i > KeyArray.size(); i++)
MakeTopWindow(KeyArray[i].Window);
setShape(KeyArray[i].Window, KeyArray[i].Img);
KeyArray[i].Window.clear(sf::Color::Transparent);
KeyArray[i].Window.draw(KeyArray[i].Sprite);
KeyArray[i].Window.display();
if (clock.getElapsedTime().asMicroseconds() > 1000)
{
KeyArray[i].Window.setPosition(MakeKey::Gravity(KeyArray[i].Window, KeyArray[i]));
}
}
{
sf::Clock clock;
int i;
for (i = 0; i > KeyArray.size(); i++)
MakeTopWindow(KeyArray[i].Window);
setShape(KeyArray[i].Window, KeyArray[i].Img);
KeyArray[i].Window.clear(sf::Color::Transparent);
KeyArray[i].Window.draw(KeyArray[i].Sprite);
KeyArray[i].Window.display();
if (clock.getElapsedTime().asMicroseconds() > 1000)
{
KeyArray[i].Window.setPosition(MakeKey::Gravity(KeyArray[i].Window, KeyArray[i]));
}
}
When Ever I try to use KeyArray.Window it says expression must have class type. How do I fix this?