Avoid the need to hard-reset the Dreamcast to exit the sample
This commit is contained in:
parent
5c1789f096
commit
b8d92f5776
|
@ -1,3 +1,7 @@
|
|||
#ifdef __DREAMCAST__
|
||||
#include <kos.h>
|
||||
#endif
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "GL/glu.h"
|
||||
#include "GL/glkos.h"
|
||||
|
@ -94,6 +98,24 @@ void DrawGLScene()
|
|||
glKosSwapBuffers();
|
||||
}
|
||||
|
||||
int check_start() {
|
||||
#ifdef __DREAMCAST__
|
||||
maple_device_t *cont;
|
||||
cont_state_t *state;
|
||||
|
||||
cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER);
|
||||
|
||||
if(cont) {
|
||||
state = (cont_state_t *)maple_dev_status(cont);
|
||||
|
||||
if(state)
|
||||
return state->buttons & CONT_START;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
glKosInit();
|
||||
|
@ -104,6 +126,9 @@ int main(int argc, char **argv)
|
|||
ReSizeGLScene(640, 480);
|
||||
DrawGLScene();
|
||||
while(1) {
|
||||
if(check_start())
|
||||
break;
|
||||
|
||||
DrawGLScene();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user