Hey guys..I have a problem... I am studying SFML and trying to mix some things and I have picked an image for my background that his size is 2048x2048...I declare all things...a chainsaw sprite that will rotate while the window is open and the background sprite....everything seems to be fine..but when I try to execute only the chainsaw appears rotating...and in console show a message like this: Failed to create texture, its internal size too high (2048x2048, maximum is 1024x1024)
and here is my code:
/*****************************************************
* HEADERS
******************************************************/
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
// Main function of C++ programs
int main(int argc,char* argv[])
{
/***********************************************************
* WINDOW
************************************************************/
// Set up the main window and enable framerate limit to 60
sf::RenderWindow window(sf::VideoMode(800,600), "SFML Test");
window.setFramerateLimit(60);
// Set an view and his properties
sf::View view;
view.reset(sf::FloatRect(50, 50, 1024, 768));
/***********************************************************
* GRAPHICS
************************************************************/
// Texture for the background
sf::Texture main_BG;
main_BG.loadFromFile("Resources/BG01.png");
// Texture for the chainsaw sprite
sf::Texture chainsaw_texture;
chainsaw_texture.loadFromFile("Resources/Chainsaw.png");
// Properties of the BackGround (sprite)
sf::Sprite background;
background.setTexture(main_BG);
background.setPosition(0,0);
background.setColor(sf::Color::Blue);
// Properties of the chainsaw sprite
sf::Sprite chainsaw;
chainsaw.setTexture(chainsaw_texture);
chainsaw.setPosition(400,300);
chainsaw.setOrigin(117,115);
/*************************************************************
* Main Loop
**************************************************************/
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
{
window.close();
}
}
/**********************************************************
* KEYBOARD OR JOYSTICK INPUT
***********************************************************/
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
{
view.move(-5,0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
{
view.move(5,0);
}
// Set what view we'll use
window.setView(view);
// Clear the window
window.clear(sf::Color::White);
// Do the draw call's
window.draw(background);
window.draw(chainsaw);
// Rotate the chainsaw sprite while the window is open
chainsaw.rotate(5);
// Update the screen
window.display();
}
}
So...the really question is...Have I an option to solve this or the only option is to use a background texture at internal size of 1024x1024??