{
vg_info( "SDL_INIT\n" );
- if( SDL_Init( SDL_INIT_VIDEO ) != 0 )
- {
+ if( SDL_Init( SDL_INIT_VIDEO ) != 0 ){
vg_error( "SDL_Init failed: %s\n", SDL_GetError() );
exit(0);
}
*/
vg_info( "Getting display count\n" );
int display_count = 0, display_index = 0, mode_index = 0;
- if( (display_count = SDL_GetNumVideoDisplays()) < 1 )
- {
+ if( (display_count = SDL_GetNumVideoDisplays()) < 1 ){
vg_error( "SDL_GetNumVideoDisplays returned: %i\n", display_count );
exit(0);
}
SDL_Quit();
}
-/*
- * Immediately transfer away from calling thread into a safe loop, signal for
- * others to shutdown, then free everything once the user closes the window.
- *
- * FIXME(bug): glfwWindowShouldClose() never returns 1 in windows via wine, ONLY
- * when calling the program from outside its normal directory.
- */
-VG_STATIC void vg_fatal_exit_loop( const char *error )
+void vg_print_backtrace(void)
{
- /*
- * https://www.gnu.org/software/libc/manual/html_node/Backtraces.html
- * thanks gnu <3
- *
- * TODO: this on windows?
- */
-
#ifndef _WIN32
void *array[20];
free( strings );
#endif
+}
+
+/*
+ * Immediately transfer away from calling thread into a safe loop, signal for
+ * others to shutdown, then free everything once the user closes the window.
+ *
+ * FIXME(bug): glfwWindowShouldClose() never returns 1 in windows via wine, ONLY
+ * when calling the program from outside its normal directory.
+ */
+VG_STATIC void vg_fatal_exit_loop( const char *error )
+{
+ /*
+ * https://www.gnu.org/software/libc/manual/html_node/Backtraces.html
+ * thanks gnu <3
+ *
+ * TODO: this on windows?
+ */
+ vg_print_backtrace();
vg_error( "Fatal error: %s\n", error );
SDL_AtomicLock( &vg.sl_context );