I meant, I used this function with these values as the first argument (limit).
EDIT: Partially solved.
I moved the texture loading code before creating the RendererWindow, like this:
int main()
{
/* ... */
sf::Texture txt;
txt.loadFromFile("txt.png");
sf::RenderWindow window(sf::VideoMode(800, 600), "test");
/* ... */
}
But I've encountered another problem.
When I load a texture, create a sprite and set the texture for it, then draw it, the window becomes same as described before (it's transparent).
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::Texture char_txt;
if(!char_txt.loadFromFile("char.png"))
{
std::cout << "Failed to load char.png... exitting" << std::endl;
return -1;
}
sf::Sprite char_sprite;
char_sprite.setTexture(char_txt);
sf::RenderWindow window(sf::VideoMode(800, 600), "test");
window.setFramerateLimit(60);
while(window.isOpen())
{
sf::Event ev;
while(window.pollEvent(ev))
{
if(ev.type == sf::Event::Closed)
window.close();
if(ev.type == sf::Event::KeyPressed && ev.key.code == sf::Keyboard::Escape)
window.close();
}
window.clear();
window.draw(char_sprite);
window.display();
}
return 0;
}
Any ideas?