Re: [Vala] Exit out of a Vala OpenGL program by using the ESC key

2013-07-07 Thread Thomas F Steinhauer
If this uses freeglut, you couldalao use glutLeaveMainLoop: this works perfectly, Thanks Tom On 07/04/2013 12:31 PM, Simon Kågedal Reimer wrote: If this uses freeglut, you couldalao use glutLeaveMainLoop: http://freeglut.sourceforge.net/docs/api.php#EventProcessing You might also consider

Re: [Vala] Exit out of a Vala OpenGL program by using the ESC key

2013-07-04 Thread Andrew Benton
You can also add this line to your vala file so that you can use the exit(int) method. extern void exit(int exit_code); via: https://mail.gnome.org/archives/vala-list/2010-July/msg00168.html On 7/4/2013 1:31 PM, Simon Kågedal Reimer wrote: If this uses freeglut, you couldalao use glutLeaveMai

Re: [Vala] Exit out of a Vala OpenGL program by using the ESC key

2013-07-04 Thread Simon Kågedal Reimer
If this uses freeglut, you couldalao use glutLeaveMainLoop: http://freeglut.sourceforge.net/docs/api.php#EventProcessing You might also consider embedding your OpenGL in a GTK+ program, instead of using glut. Some pointers here: http://stackoverflow.com/questions/3815806/gtk-and-opengl-bindings

Re: [Vala] Exit out of a Vala OpenGL program by using the ESC key

2013-07-04 Thread Evan Nemerson
On Thu, 2013-07-04 at 11:32 -0500, Thomas F Steinhauer wrote: > Ok, > > This is a tough one to figure out. This code does not work: > > void keyboard(uchar key, int x, int y) { > switch (key) { > case 27: > exit(0); break; > default : break; > } > } > >

[Vala] Exit out of a Vala OpenGL program by using the ESC key

2013-07-04 Thread Thomas F Steinhauer
Ok, This is a tough one to figure out. This code does not work: void keyboard(uchar key, int x, int y) { switch (key) { case 27: exit(0); break; default : break; } } I understand that the exit(0) call does not work in vala, so what do I replace it with so t