-
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
-
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 :-\
-
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 :(
-
You can try to recompile SFML. You can also try with static libraries.
-
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?
-
Recompiling SFML sounds like a complicated task to me
It's not, if you follow the tutorial step by step.
-
Recompiled it with dynamic debug dll's.
Same error :/
-
Can you launch the debugger to get more relevant information about the crash?
-
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 ;))
-
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").
-
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.
-
Works fine here with VS 2012 Ultimate and the RC...
Is your graphics card driver uptodate?
What OS specs?
-
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
-
So it might be, yet another Intel graphics card issue... :-\
This would need some deeper debugging, to figure out the cause.
-
Can Laurent do something about that? Or is it something that I just have to accept? :-\
-
As far as I remember, all Intel issues are fixed now. But I'm not 100% sure. You should search on this forum for similar issues with RenderTexture and Intel drivers (but be careful: most of them are on Linux), and see if some are still unresolved.
Is this happening only with sf::RenderTexture? Have you tried the same kind of code with all other graphics classes?
-
Haven't noticed any other problem like this.
I've tried Image, Texture and of course the RenderWindow.
What puzzles me is why it works as long as there is no open RenderWindow...
this code works too:
{
sf::RenderWindow Window(sf::VideoMode(800,600, 32), "SfmlTest",sf::Style::Default);
}
{
sf::RenderTexture texture;
if (!texture.create(500, 500))
return -1;
}
-
I have a test computer with the same video card, windows 8, no issues.
-
Uhh alright.
Maybe I should try to do a fresh windows 7 installation on another partition and see if it works there.
-
So recently I tried it again with a fresh Windows 7 installation. (same laptop)
It still doesn't work :/
Does anybody have an idea what I can do about it?
-
I also compiled and ran your code just fine. Code::blocks 12.11, Intel Q965 graphics chipset. it's gotta be something wonky with your system I'm thinking
-
Alright, new laptop (windows 8, vs2012)
two graphics cards: Intel HD Graphics 4600 and NVIDIA GeForce GT 750M
same error for intel graphics card, but no error with geforce!!!
What exactly is causing this?
If I was gonna write a game with SFML, I don't want to restrict the game to more powerful (or whatever the reason is) graphics cards just because of this bug :/
-
There are few things i can think off:
1: Check if the GPU memory capacity is enough to store 500x500.
2: In bios i think there will surely be somehere a checkBox of some sort to allow errors to pop up(to display) when they happen (on my system when one of my components reported error i got showed onto a blue screen with error, don't confuse it with BSOD)
That way i figured out my motherboard has front panel audio error but i don't remember how i exactly did it.
Little messing around bios needed, but if you can program it should be in line of work.
-
@Fire: Before you ask, use sf::Texture::getMaximumSize() to do #1.
-
@Fire: Before you ask, use sf::Texture::getMaximumSize() to do #1.
thanks ;)
There are few things i can think off:
1: Check if the GPU memory capacity is enough to store 500x500.
2: In bios i think there will surely be somehere a checkBox of some sort to allow errors to pop up(to display) when they happen (on my system when one of my components reported error i got showed onto a blue screen with error, don't confuse it with BSOD)
That way i figured out my motherboard has front panel audio error but i don't remember how i exactly did it.
Little messing around bios needed, but if you can program it should be in line of work.
intel returns 8192 and nvidia 16384.
I guess that's not the problem
I'll have a look what I can find in my bios
EDIT: I can't find any checkbox like that :/
-
intel returns 8192 and nvidia 16384.
I guess that's not the problem
I'll have a look what I can find in my bios
EDIT: I can't find any checkbox like that :/
Yea its 8192x8192 and other one 16384x16384, that is not the problem.
For the bios, its usually the complicated thing... google it is the best way you can find out.
I cant remember how its called, but i know how to do it on my pc, cant help you out sorry.
-
Since the only idea left is trying to get some error output from a lower level of the system, you might also try redirecting SFML's internal error stream to somewhere you can see it.
It's easier than it sounds. Details here: http://www.sfml-dev.org/documentation/2.1/group__system.php#ga7fe7f475639e26334606b5142c29551f
-
intel returns 8192 and nvidia 16384.
I guess that's not the problem
I'll have a look what I can find in my bios
EDIT: I can't find any checkbox like that :/
Yea its 8192x8192 and other one 16384x16384, that is not the problem.
For the bios, its usually the complicated thing... google it is the best way you can find out.
I cant remember how its called, but i know how to do it on my pc, cant help you out sorry.
I did google quite a bit, and my bios seems to hide some menus, but if there is a checkbox, like the one you are describing, I don't know
Since the only idea left is trying to get some error output from a lower level of the system, you might also try redirecting SFML's internal error stream to somewhere you can see it.
It's easier than it sounds. Details here: http://www.sfml-dev.org/documentation/2.1/group__system.php#ga7fe7f475639e26334606b5142c29551f
thanks for the suggestion. However, the file is created but empty. I didn't see anything in the console before either though.
Also, I'm wondering why it hits me twice independently :P Is really nobody else having this issue with integrated graphics cards?
-
Is really nobody else having this issue with integrated graphics cards?
Mine's integrated and I certainly don't have it. My memory isn't that great, but the only other RenderTexture bugs I can think of were all caused by people declaring RenderTextures in global scope (ditto for RenderWindow).