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

Show Posts

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.


Messages - trashcanman980

Pages: [1]
1
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 09:24:01 pm »
No, I take it back. I mistakenly forgot to to alter the literal with respect to the new executable location.

Thanks a ton Jesper, you've been a godsend.

2
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 09:19:58 pm »
Sadly, No change to behavior.

3
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 09:17:21 pm »
You're right, I derped right over that didn't I. Let me give it a whirl. I'll post back momentarily.

4
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 09:07:53 pm »
Jesper, Thanks for your continued assistance :

Quote
Are you perhaps mixing debug/release builds of the library and your application?

I double checked my lib input, it contains only the release versions:
sfml-graphics.lib
sfml-window.lib
sfml-system.lib

The particular project I'm creating right now is tiny enough right now (I'm literally just drawing/manipulating one sprite to check out the API before I start an honest project) that I'm just using the dll's.

Quote
Are you perhaps building the app with a different compiler (even just different version) than SFML was built with?

I'm using the pre-compiled Visual C++ 10 (2010) - 64-bit provided by the download on the home page. I'm using this IDE to build as well.

This weekend, I'll try just building from src myself and seeing what happens.


Quote
Are you perhaps using a 8bit PNG image?

Windows file properties reports the bit depth of the file is 32 bit.

Quote
Have you tried specifying an absolute path to the image to load (to rule out CWD issues; although I believe we already did that - but still)?

I tried using a string literal with the absolute path, but no dice.



5
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 08:53:18 pm »
Hapax, Thanks for the suggestion. I gave it whirl, but the Image failed to loadFromFile as well:

Looking at the error stream reveals the same single quotation failure message.

Quote
Faled to load image "

I'm not sure how the string literal isn't making it over to where it belongs -.-. I also tried supplying the absolute path, but no dice. I've got to see to family affairs this afternoon, but thank you to everyone that's attempted to assist. I'll keep on this when i can return to my PC. I'll also give it a whirl on my UNIX platforms with the same file in order to isolate the file format from whatever issue may be causing this.

6
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 08:24:49 pm »
Here's my full invocation, I downloaded the libraries pre-compiled.

Quote
/I"C:\Users\<ME>\Desktop\SFML-2.3\include" /Zi /nologo /W3 /WX- /Od /D "_MBCS" /Gm /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"x64\Debug\pong.pch" /Fa"x64\Debug\" /Fo"x64\Debug\" /Fd"x64\Debug\vc100.pdb" /Gd /errorReport:queue

7
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 08:22:32 pm »
Solid Suggestion, Attempted as follows:

        if(!test.loadFromFile("paddle.png")) {
                cerr << "*Violent Explosion*" << endl;

                char path[FILENAME_MAX];
                _getcwd(path, sizeof(path));
                printf ("Work Dir : %s", path);

        }
 

Output:
Quote
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>Pong.exe 2> err.log
Work Dir : C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>type err.log
*Violent Explosion*
Failed to load image "
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>

Verified CWD is appropriate during load at runtime.

8
Graphics / Re: loadFromFile Failure
« on: July 03, 2015, 08:05:58 pm »
I kept the prompt open:

Quote
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>chdir
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug

C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>echo %CD%
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug

So the CWD should be good.

As for the .png, it was generated in about 30 seconds this morning using mspaint packaged with windows 8.1. It's just a prototype standin. I've attached it here. I've tried generating others in various styles, no dice.

9
Graphics / loadFromFile Failure
« on: July 03, 2015, 07:54:01 pm »
TL:DR for anyone having an issue similar to this:

Ensure you're using the correct library for your project configuration. Debug should correspond to -d, Static to -s in the lib filenames.

Don't be derpy like me, friends don't let friends mismatch library release configurations.  ;)
----------------------------------------------------------------------------------------------------
Greetings, I'm a new-comer to SFML, I work in the CG industry as a developer and I'm working with SFML for other academic purposes.

I'm having an interesting issue. The following code fails to load the texture in question. (The texture is a 128x32 png file with no transparency layer.) :

...
sf::Texture test;
sf::Sprite testSpr;
if(!test.loadFromFile("paddle.png")) {
    cerr << "I'd like more debug info than this.";
    return EXIT_FAILURE;
}
testSpr.setTexture(test);
...
 

paddle.png is a typical power of two texture. It is located in the working directory, which was set using VS2010's project debugging configuration. Even an execution from cmd within the appropriate working directory fails:

Checking the error stream reveals the following error (which makes no sense to me)
Quote
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>Pong.exe 2> err.log

C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>type err.log
I'd like more debug info than this.
Failed to load image "
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>
C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>dir paddle.png
 Volume in drive C has no label.
 Volume Serial Number is XXXX-XXXX

 Directory of C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug

07/03/2015  10:24 AM               424 paddle.png
               1 File(s)            424 bytes
               0 Dir(s)  902,470,395,904 bytes free

C:\Users\<ME>\Documents\Visual Studio 2010\Projects\pong\x64\Debug>

That's not a typo, there is only one quote character in the stream output for the lib error stream output. The string literal provided as argument is clearly not empty.

Anyone have any ideas?

Pages: [1]