Added automatic backtracing via RegisterStacktrace in Backtrace. Added a simple hello world demo that just throws up a window. Started working on TileSet again and skeletoned a demo for it.
This commit is contained in:
28
demo/backtrace/cpp/demo.cpp
Executable file
28
demo/backtrace/cpp/demo.cpp
Executable file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* This demo starts up and intentionally crashes itself to prove the backtrace stuff works
|
||||
*/
|
||||
|
||||
#include <libsdlgame/libsdlgame.h>
|
||||
|
||||
class Object {
|
||||
private:
|
||||
int *x;
|
||||
public:
|
||||
int crashme(void);
|
||||
};
|
||||
|
||||
int Object::crashme(void)
|
||||
{
|
||||
this->x = 0;
|
||||
return *(this->x);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
RegisterStacktrace();
|
||||
|
||||
// We don't initialize anything here because we would lose the memory
|
||||
Object x;
|
||||
x.crashme();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user