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

Author Topic: Problem with RenderTexture  (Read 10433 times)

0 Members and 7 Guests are viewing this topic.

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Problem with RenderTexture
« on: April 03, 2013, 10:08:29 am »
Hello,

Not sure if I'm using RenderTexture incorrectly, but whenever the object goes out of scope I get an error:

Windows has triggered a breakpoint in SfmlTest.exe.
This may be due to a corruption of the heap, which indicates a bug in SfmlTest.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while SfmlTest.exe has focus.
The output window may have more diagnostic information.


sf::RenderWindow Window(sf::VideoMode(500,500, 32), "SfmlTest",sf::Style::Default);

{
        sf::RenderTexture texture;
        if (!texture.create(500, 500))
                return -1;
} //Error here. If I use a RenderTexture in a function I get the same problem
 

Do I somehow need to dispose RenderTexture before?

I'm using Sfml 2.0 RC, the debug dll's and the Debug configuration in VS2010

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with RenderTexture
« Reply #1 on: April 03, 2013, 10:27:29 am »
This is most likely an environment/configuration issue. This code should not crash. But you seem to do everything right, so... I don't know, sorry :-\
Laurent Gomila - SFML developer

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #2 on: April 03, 2013, 10:47:42 am »
Hmm, alright

Do you have an idea what I could try? I've tried to use the release libraries and release configuration but I get the same error.
If I run the program from the explorer rather than VS, it just crashes...

Oh also, RenderTexture itself works fine, just not when it goes out of scope :(

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with RenderTexture
« Reply #3 on: April 03, 2013, 10:56:47 am »
You can try to recompile SFML. You can also try with static libraries.
Laurent Gomila - SFML developer

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #4 on: April 03, 2013, 11:28:49 am »
I've just tried static libraries, but no success unfortunately :(
Recompiling SFML sounds like a complicated task to me :/ I might try that a bit later

Does nobody else experience this issue?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with RenderTexture
« Reply #5 on: April 03, 2013, 11:38:27 am »
Quote
Recompiling SFML sounds like a complicated task to me
It's not, if you follow the tutorial step by step.
Laurent Gomila - SFML developer

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #6 on: April 03, 2013, 12:26:15 pm »
Recompiled it with dynamic debug dll's.
Same error :/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem with RenderTexture
« Reply #7 on: April 03, 2013, 12:50:36 pm »
Can you launch the debugger to get more relevant information about the crash?
Laurent Gomila - SFML developer

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #8 on: April 03, 2013, 01:13:42 pm »
I can start the debugger, but can't see the source. (Sorry, not too familiar with C++ programming)

However, I noticed that I don't get an error if I remove the line where the RenderWindow is created!
Does that mean something? (Of course that is not a useful workaround ;))

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Problem with RenderTexture
« Reply #9 on: April 03, 2013, 01:17:04 pm »
Can you describe stepwise and exactly what you did, from downloading SFML until executing the final project?

"Exactly" means, specify every build option you chose, every library you linked, etc. Be as verbose as possible. And make sure the informations are correct (i.e. don't say "I linked sfml-system" if you in fact linked "sfml-system-d.lib").
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #10 on: April 03, 2013, 02:14:00 pm »
Okay sure.

- installed VS2010 ultimate (not recently, it has been on my laptop for a while)
- downloaded SFML 2.0 RC (http://www.sfml-dev.org/download/2.0-rc/SFML-2.0-rc-windows-32-vc2010.zip)
- created a new C++ Project (Win32, Console, Empty Project)
- add new C++ File (main.cpp)
- Project Properties: C/C++ -> General -> Additional Include Directories: C:\SFML-2.0-rc\include
- Project Properties: Linker -> General -> Additional Library Directories: C:\SFML-2.0-rc\lib
- Project Properties: Linker -> Input -> Additional Dependencies:
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib
- main.cpp:
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
#include <iostream>

int main(){

        sf::RenderWindow Window(sf::VideoMode(800,600, 32), "SfmlTest",sf::Style::Default);

        {
                sf::RenderTexture texture;
                if (!texture.create(500, 500))
                        return -1;
        }

        std::cin.get();

        return 0;
}
- Copy sfml-system-d-2.dll, sfml-window-d-2.dll and sfml-graphics-d-2.dll from C:\SFML-2.0-rc\bin to my programs debug folder
- Press Debug

Voilà

Windows has triggered a breakpoint in SfmlTest.exe.
This may be due to a corruption of the heap, which indicates a bug in SfmlTest.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while SfmlTest.exe has focus.
The output window may have more diagnostic information.



eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problem with RenderTexture
« Reply #11 on: April 03, 2013, 02:42:26 pm »
Works fine here with VS 2012 Ultimate and the RC...
Is your graphics card driver uptodate?
What OS specs?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #12 on: April 03, 2013, 02:59:04 pm »
That's weird.

Anyways, I assumed there was no update because Windows Update didn't list it, but it turned out I could get the newest driver from the intel website.
But that wasn't the issue, the problem persists.

OS:
Windows 7 Professional 32 Bit SP1

Graphics:
Mobile Intel(R) 4 Series Express Chipset Family 8.15.10.2869
(rubbish :) )

OpenGL:
2.1.0 - Build 8.15.10.2869

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Problem with RenderTexture
« Reply #13 on: April 03, 2013, 03:04:59 pm »
So it might be, yet another Intel graphics card issue... :-\
This would need some deeper debugging, to figure out the cause.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Fire

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Problem with RenderTexture
« Reply #14 on: April 03, 2013, 03:11:29 pm »
Can Laurent do something about that? Or is it something that I just have to accept? :-\

 

anything