Debug Assertion Failed!
Program: C:\Windows\system32\MSVCP140D.dll
File: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\xtree
Line: 237
Expression: map/set iterator not dereferencable
int main(int argc, char *argv[]){
m_WindowMode = sf::VideoMode(1024, 768);
m_Title = "Brawler";
m_ContextSettings = sf::ContextSettings(24U, 8U, 4U, 3U, 1U, 0U);
m_Style = sf::Style::None;
m_Style |= sf::Style::Titlebar;
m_Style |= sf::Style::Resize;
m_Style |= sf::Style::Close;
//m_Style |= sf::Style::Fullscreen;
Window = new sf::Window();
delete Window;
return 0;
}
Expression: map/set iterator not dereferencable... which involves you're using a std::map or std::set. So please show us your real code, it's just a waste of time otherwise.
namespace OpenGLNamespace
{
class clsOpenGL
{
public:
clsOpenGL();
~clsOpenGL();
void Init(int ScreenWidth, int ScreenHeight, std::string Filepath);
void LoadResources();
void Resize();
static void CheckOGLerror();
public:
std::string Filepath;
sf::Window* Window;
public:
int m_ScreenWidth;
int m_ScreenHeight;
std::string m_ShaderPath;
sf::VideoMode m_WindowMode;
std::string m_Title;
sf::ContextSettings m_ContextSettings;
sf::Uint32 m_Style;
sf::WindowHandle m_WindowHandle;
std::map<std::string, clsShader*> m_Shaders;
RECT m_WindowBorder;
clsCamera* m_Camera;
};
};
void clsOpenGL::Init(int a_ScreenWidth, int a_ScreenHeight, std::string a_Filepath)
{
m_ScreenWidth = a_ScreenWidth;
m_ScreenHeight = a_ScreenHeight;
Filepath = a_Filepath;
// Initialize window, ~OpenGL deletes it
m_WindowMode = sf::VideoMode(1024, 768);
m_Title = "Brawler";
m_ContextSettings = sf::ContextSettings(24U, 8U, 4U, 3U, 1U, 0U);
m_Style = sf::Style::None;
m_Style |= sf::Style::Titlebar;
m_Style |= sf::Style::Resize;
m_Style |= sf::Style::Close;
//m_Style |= sf::Style::Fullscreen;
Window = new sf::Window();
}
clsOpenGL::~clsOpenGL()
{
delete Window;
}
int main(int argc, char *argv[])
{
// OpenGL
OpenGL.Init(Main.m_ScreenResolutionWidth, Main.m_ScreenResolutionHeight, Main.Filepath);
// Clean up
return 0;
}
> msvcp140d.dll!std::_Debug_message(const wchar_t * message, const wchar_t * file, unsigned int line) Line 17 C++
BrawlerEngine.exe!std::_Tree_const_iterator<class std::_Tree_val<struct std::_Tree_simple_types<class sf::priv::GlContext *> > >::operator*(void) Unknown
BrawlerEngine.exe!sf::priv::GlContext::globalCleanup(void) Unknown
BrawlerEngine.exe!sf::GlResource::~GlResource(void) Unknown
BrawlerEngine.exe!sf::Window::~Window(void) Unknown
BrawlerEngine.exe!sf::Window::`vector deleting destructor'(unsigned int) Unknown
BrawlerEngine.exe!OpenGLNamespace::clsOpenGL::~clsOpenGL() Line 14 C++
BrawlerEngine.exe!`dynamic atexit destructor for 'OpenGL''() C++
ucrtbased.dll!__crt_scoped_stack_ptr<char>::__crt_scoped_stack_ptr<char>(struct __crt_scoped_stack_ptr_tag<char>) Unknown
ucrtbased.dll!__crt_seh_guarded_call<int>::operator()<class <lambda_d22e02de4d14401f49897516b29a2b7c>,class <lambda_e971338317bfa523bb8920b43d823727> &,class <lambda_b0b8599c9027f5b14541fbbd6863d1f1> >(class <lambda_d22e02de4d14401f49897516b29a2b7c> &&,class <lambda_e971338317bfa523bb8920b43d823727> &,class <lambda_b0b8599c9027f5b14541fbbd6863d1f1> &&) Unknown
ucrtbased.dll!__acrt_lock_and_call<class <lambda_e971338317bfa523bb8920b43d823727> >(enum __acrt_lock_id,class <lambda_e971338317bfa523bb8920b43d823727> &&) Unknown
ucrtbased.dll!_execute_onexit_table() Unknown
ucrtbased.dll!__crt_hmodule_traits::close(struct HINSTANCE__ *) Unknown
ucrtbased.dll!exit() Unknown
BrawlerEngine.exe!__scrt_common_main_seh() Line 266 C++
BrawlerEngine.exe!__scrt_common_main() Line 300 C++
BrawlerEngine.exe!mainCRTStartup() Line 17 C++
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
As for creating the OpenGL instance, I haven't even reached that point yet. So far, I'm only trying to create and destroy a window.By OpenGL instance, I mean the OpenGL instance of your clsOpenGL object - the one on which you call Init.
As for creating the OpenGL instance, I haven't even reached that point yet. So far, I'm only trying to create and destroy a window.By OpenGL instance, I mean the OpenGL instance of your clsOpenGL object - the one on which you call Init.
Don't construct SFML resources at global scope.
Don't construct SFML resources at global scope.
When will it be destroyed?
The other SFML objects inside that class will be created as globals, including your map of shaders.