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 - MBee

Pages: [1]
1
General / Re: Random crashes while loading textures
« on: May 13, 2022, 04:19:36 pm »
A little progress: I've so far tracked it down to having the Linker setting: Link Library Dependencies enabled.
With it off, works fine. With it on, crashes.
Wow, with this setting disabled, It still crashes for me!

2
General / Re: Random crashes while loading textures
« on: May 12, 2022, 05:08:40 pm »
Just to try something, can you move the Window to the top, i.e. before you initiate any of the textures?

IT WORKED

THANK YOU

BUT WHY DID THAT WORK?!
AREN'T THESE SUPPOSED TO BE TECHNICALLY INDEPENDENT?!

3
General / Re: Random crashes while loading textures
« on: May 12, 2022, 04:24:46 pm »
Can you provide a complete and compileable example that reproduces the problem?
Here's my VS project (don't worry, it's tiny)
https://drive.google.com/file/d/1wN1deYhYuigxo9vcFzrHSXVeLqnumkjB/view?usp=sharing

Note that the minimal example i provided is a bit different and cleaned up for readibility.

The equivalent of our for-each loop begins at line 30 of main.cpp.
sprites_to_load.txt contains the list of paths.

Let me know if you can make sense of it - if not, I will clean it up for you when i finish work in a few hours  :)

4
General / Re: Random crashes while loading textures
« on: May 11, 2022, 02:56:13 pm »
What graphics hardware do you have? It seems the crash is in code that checks for opengl extensions, so that might be a driver missing or low hardware.
1050ti, Updated its drivers just now. No difference.

I forgot to mention - I used to compile my SFML projects with gcc/MinGW, one of them included textures (https://github.com/MarvellousBee/plane-trails). They worked fine.

5
General / Re: Random crashes while loading textures
« on: May 11, 2022, 12:04:22 pm »
Run it through VS in debug mode and the debugger should trigger and allow you to retrieve the call stack.
>   sfml-window-d-3.dll!`anonymous namespace'::GlContextImpl::loadExtensions() Line 283   C++
    sfml-window-d-3.dll!sf::priv::GlContext::initResource() Line 365   C++
    sfml-window-d-3.dll!sf::GlResource::GlResource() Line 38   C++
    sfml-graphics-d-3.dll!sf::Texture::Texture() Line 78   C++
    Project2.exe!main(int argc, char * * argv) Line 41   C++
    [External Code]   

Not sure what you do with //other stuff, but I do hope you're saving said texture somewhere.

Hahah, of course. //other stuff's main purpose is filling map<string, sf::Texture> textures

6
General / Random crashes while loading textures
« on: May 10, 2022, 10:59:13 pm »
Hi,

I have a program that loads ~15 sprites from my hard drive, from predetermined paths.

for (std::string path : textures_to_load)
{
     sf::Texture texture;
     if (!texture.loadFromFile(path))
     {
          return 1;
     }
     //other stuff
}
 

This code crashes at some point during the 'for' loop.
Sometimes is successfully parses 4 textures, sometimes 12.
"other stuff" never causes a crash.

The program exits with code -1073741819.

Debugger crashes at GLContext.cpp, line 283. output:

Exception thrown: read access violation.
extensionString was nullptr.

I'm using Visual Studio 2022, compiled SFML from source (for VS2022, Debug, 64).

Pages: [1]