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

Author Topic: Release version not drawing graphics...  (Read 3967 times)

0 Members and 1 Guest are viewing this topic.

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« on: December 01, 2010, 10:51:06 am »
I am trying to build a release version of my game, the dropdown in VS is selected as Release, and I linked the release libs without the -d, I also added the release dll's. It compiles normal, but when I execute the program non of my graphics are drawing anymore, but with debug mode and the libs/dlls it works fine. Anyone know what is the issue here? This literally breaks my prototype for my portfolio if I cannot build a release version. Also I am using 2.0 for this.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Release version not drawing graphics...
« Reply #1 on: December 01, 2010, 11:27:47 am »
Any error message? Any resource that failed to load? Or is everything ok?
Laurent Gomila - SFML developer

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« Reply #2 on: December 01, 2010, 11:50:37 am »
In my classes I have CRender which has RenderWindow as a pointer. It loads and runs perfectly in debug, but in release it builds, it executes, but nothing is visible execept the window.clear(color). I can exit the game no problem.

So I decided to do some test because I honestly thought it was my Physfs.lib not working correctly in Release mode, so I made a basic render window game and noticed something really odd. RenderWindow no longer worked unless it was a pointer like so,

sf::RenderWindow* Game = new sf::Render(blah blah blah);

the reason because if I did it not being a pointer the program would crash and in debugging mode this was causing it,

Game.Clear(); //this was the fault of the crash

I am actually reverting back to a younger release that isn't in beta still, so I can get this added to my portfolio, I just graduated with my Bachelo's in Game Software Development and I need to build my portfolio up some so I can start applying at the game companies around me. I would like to see this fixed as this pointer issue doesn't happen in debug mode.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Release version not drawing graphics...
« Reply #3 on: December 01, 2010, 11:54:22 am »
Can you show me a complete and minimal code that reproduces this problem?
Laurent Gomila - SFML developer

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« Reply #4 on: December 01, 2010, 12:05:20 pm »
Crash happens in this code in Release mode. I am all the correct libs linked in input, and the correct dll's in the folder. It builds fine but crashes at my comment. If you make RenderWindow a pointer as I stated above it will actually not crash out, but nothing will draw in the window either.

Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow Game(sf::VideoMode(1024, 768, 32), "SFML Release Test", sf::Style::Close);
sf::Event Event;
const sf::Input& Input = Game.GetInput();

while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}

if(Input.IsKeyDown(sf::Key::Escape))
{
Game.Close();
}

Game.Clear();

Game.Display(); //Crash happens here
}

return EXIT_SUCCESS;
}


EDIT** Also if you comment out Display, Clear(); causes a crash as well, but if you comment both out it runs just fine.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Release version not drawing graphics...
« Reply #5 on: December 01, 2010, 12:10:18 pm »
How did you compile SFML?
Laurent Gomila - SFML developer

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« Reply #6 on: December 01, 2010, 12:13:48 pm »
I created SFML 2.0 using CMakelist than opening the project, and compiling all in debug mode and release mode in VS2010 Pro.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Release version not drawing graphics...
« Reply #7 on: December 01, 2010, 12:41:56 pm »
Are you sure that there is only one build of SFML 2 on your computer? No chance there might be a conflict?
Laurent Gomila - SFML developer

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« Reply #8 on: December 01, 2010, 12:49:05 pm »
Nope, I have all my SDK's under a specific folder, I have no other SFML lib or include directories on my system next to the SFML-2.0 I have in my SDK folder. I take it you are not getting the same problem as I am? So you are not able to replicate it and help me out here? This has been my first time actually building release mode so maybe I did something wrong? Are there any settings I need to make sure I have checked to get it to work?

wicked357

  • Newbie
  • *
  • Posts: 18
    • View Profile
    • http://www.eternalcoding.com
Release version not drawing graphics...
« Reply #9 on: December 01, 2010, 01:05:03 pm »
I completely deleted my SFML-2.0 build from previous started out completely fresh and I got it working, I don't know what the issue was, maybe I had some old files in there from sometime ago, oh well at least it is working now, what I headache that was... thank you so much for your assistance, Ill have to remember if something isn't working right and it should just rebuild the whole thing and delete the old. Sorry for taking so much of your time with this, it was your idea that put that in my head to delete the whole old build and rebuild a new one.

 

anything