Release mode EXE wont render textures?

Started by
12 comments, last by moshes 14 years, 7 months ago
When I produce an EXE in Debug mode, the textures in my application render no problem, the FPS is about 128. When I produce the EXE as a release application, there are no textures. I can see 1 rendered pixel and the FPS is abot 2500. Does anybody know what is happening?
Advertisement
A wild guess, the paths different for release and debug executables.
Have you maybe the textures only in the debug-directory?
jonzy_x86: Any status to report?
The paths are relative, and both work fine.

I have a return value on the function that loads the textures and that returns true.

Hello ... check for uninitialized variables in your project (maybe in one of your classes). I think this is the number one cause when dealing with release problems.
As far as I know , in debug mode variables are being initialized whereas in the release they aren't which leads to problems.
So ... check the relevant parts of your code for uninitialized variables.

I hope I've been of help to you...

-------------------------------------------------------------------------------------------
My Website - Portfolio, Tutorials
My blog
Quote:Original post by jonzy_x86
The paths are relative, and both work fine.


I thought they don't work fine?

What the first two posts were guessing is btw that yes, they are relative, but that your filestructure looks roughly like this:

Project/ +-Debug/ |  +-Textures/ |  |  +-foo.bmp |  |  +-bar.bmp |  | |  +-yourGame.exe | +-Release/    +-yourGame.exe          "Textures/" not here


So that maybe you try to load "Textures/foo.bmp", but when in release-mode, it simply isn't there.


Quote:I have a return value on the function that loads the textures and that returns true.

We are not clairvoyants and cannot guess what happens inside your function that returns true. Maybe post some code?

Btw, you can easily check if a file exists (yay, I made a cheat sheet!):

------------------------------------------------------C++: if (std::ifstream (path)) { /*exists*/ }     -or maybe-     const bool exists = std::ifstream (path);------------------------------------------------------C#: if System.IO.File.Exists (path)) { /*exists*/ }------------------------------------------------------C:  if (FILE *f = fopen (path, "r")) {        // exists        fclose (f); // don't forget!    }------------------------------------------------------PHP:if (file_exists ($path)) { /*exists*/ }------------------------------------------------------
Check your texture bindings, add some code in release version to dump texture IDs to a file and see if they remain consistent at various parts in your program. Also check how you load textures via glTexImage and friends as well. Struct alignment and padding in release code could also screw things up, particularly if you use hard coded offset pointers.
Latest project: Sideways Racing on the iPad
jonzy_x86: Any status to report?
Thanks all for your replies.

I'll have a look at the uninitialised variables today, perhaps that is the problem.

I will post some cut-down code here to demonstrate the problem.

The directory structure is like this...

Project
+-Debug
| +MyProject.exe (opens "Images\\Images.tga")
|
+- Release
| +MyProject.exe (opens "Images\\Images.tga")
|
+-Images
+Image.tga

*For some reason, the Image.tga part of the above will not format properly, this should be under the Images folder.*

I know that the Images folder is outside of the debug/release folders, but this work when running from the compiler because it uses the project path as the root.

And even without running in the compiler, I can copy the exes to the right directory and still the debug works but the release doesn't.

When I say that they both work fine, I mean that the function can open and read the file in both projects (I already have a file exists test there).

Thanks

Paul

This topic is closed to new replies.

Advertisement