|
@@ -22,7 +22,10 @@
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
#include <math.h>
|
|
#include <time.h>
|
|
#include <time.h>
|
|
|
|
+
|
|
#ifdef __linux__
|
|
#ifdef __linux__
|
|
|
|
+#include <execinfo.h>
|
|
|
|
+#include <signal.h>
|
|
#include <sys/time.h>
|
|
#include <sys/time.h>
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xutil.h>
|
|
#include <X11/Xutil.h>
|
|
@@ -378,6 +381,15 @@ void la_DestroySystemWindowWin32(laWindow* w) {
|
|
};
|
|
};
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+void la_HandlerSIGSEGV(int sig) {
|
|
|
|
+ void *array[30];
|
|
|
|
+ size_t sz;
|
|
|
|
+ sz = backtrace(array, 30);
|
|
|
|
+
|
|
|
|
+ fprintf(stdout, "LaGUI recieved error signal %d:\n The program terminated unexpectedly.\n", sig);
|
|
|
|
+ backtrace_symbols_fd(array, sz, STDERR_FILENO);
|
|
|
|
+ exit(1);
|
|
|
|
+}
|
|
|
|
|
|
void la_glDebugOutput(GLenum source, GLenum type, unsigned int id,
|
|
void la_glDebugOutput(GLenum source, GLenum type, unsigned int id,
|
|
GLenum severity, GLsizei length, const char* message, const void* userParam) {
|
|
GLenum severity, GLsizei length, const char* message, const void* userParam) {
|
|
@@ -805,6 +817,8 @@ void laProcessInitArguments(int argc, char* argv[],laInitArguments* ia) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int laGetReadyWith(laInitArguments* ia){
|
|
int laGetReadyWith(laInitArguments* ia){
|
|
|
|
+ signal(SIGSEGV,la_HandlerSIGSEGV);
|
|
|
|
+
|
|
memcpy(&MAIN.InitArgs,ia,sizeof(laInitArguments));
|
|
memcpy(&MAIN.InitArgs,ia,sizeof(laInitArguments));
|
|
if(MAIN.InitArgs.GLMajor>4||MAIN.InitArgs.GLMajor<1){ MAIN.InitArgs.GLMajor=3; }
|
|
if(MAIN.InitArgs.GLMajor>4||MAIN.InitArgs.GLMajor<1){ MAIN.InitArgs.GLMajor=3; }
|
|
if(MAIN.InitArgs.GLMinor<1){ MAIN.InitArgs.GLMinor=3; }
|
|
if(MAIN.InitArgs.GLMinor<1){ MAIN.InitArgs.GLMinor=3; }
|