Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]Having strange trouble with texture sizes!  (Read 1366 times)

0 Members and 1 Guest are viewing this topic.

Maximilian

  • Newbie
  • *
  • Posts: 13
    • View Profile
[SOLVED]Having strange trouble with texture sizes!
« 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!
« Last Edit: August 24, 2013, 11:18:25 am by Maximilian »

Maximilian

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Having strange trouble with texture sizes!
« Reply #1 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...)