SFML community forums

Help => Graphics => Topic started by: Maximilian on August 24, 2013, 11:08:06 am

Title: [SOLVED]Having strange trouble with texture sizes!
Post by: Maximilian on August 24, 2013, 11:08:06 am
Basically, I've never progremmed with SFML before. I have alot of experience with c++ tho. What I'm trying to do is go slightly off course from the tutorial and create my own little texture.


Texture SwordTexture;
Image SwordImage;
float xSword=400, ySword=250;
IntRect SwordRect((int)xSword, (int)ySword, 50, 100);

if(!SwordTexture.create(50, 100))
                std::cout<<"SwordTextureCreateError";
if(!SwordImage.loadFromFile("Sword.png"))
                std::cout<<"SwordImageLoadError";
if(!SwordTexture.loadFromImage(SwordImage, SwordRect))
                std::cout<<"SwordTextueLoadFromFileError";//This part is causing some strange issues

 

The problem I'm having is this: The image is not loaded onto the Texture, and the program sends a really strange message saying the internal size of my texture is some riddiculus number like 4294966946x4294967149 and that the mximum is 16384x16384. Now, what I don't get is why it would do this, my image is only 50x100 pixels... I've had similar problems with other images Ive been trying to load :/ HELP!
Title: Re: Having strange trouble with texture sizes!
Post by: Maximilian on August 24, 2013, 11:18:02 am
Nvm... I'm a strange strange special kind of stupid... Had misinterpereted how the rectangles worked (I swear, i got it workingyesterday with another program...)