1
General / Why does my program suddenly stop working?
« on: August 15, 2011, 01:45:57 pm »
Omg i can't believe i missed that >.<, thanks lol.
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.
std::vector< std::vector<sf::Sprite> > SpTiles(201,
std::vector<sf::Sprite>(201));
iX = 0;
iY = 0;
fX = 0.f;
fY = 0.f;
// Program stops here
while (iY < 201);
{
SpTiles[iX][iY].SetImage(ImGrass);
SpTiles[iX][iY].SetPosition(fX, fY);
++iX;
fX = fX + 64.f;
if (iX > 200)
{
iX = 0;
++iY;
fX = 0.f;
fY = fY + 64.f;
}
}
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
}
// Clear the screen (fill it with black color)
App.Clear();
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}