diff --git a/samples/depth_funcs_ortho/main.c b/samples/depth_funcs_ortho/main.c index 837ede0..ccd88c6 100644 --- a/samples/depth_funcs_ortho/main.c +++ b/samples/depth_funcs_ortho/main.c @@ -1,3 +1,7 @@ +#ifdef __DREAMCAST__ +#include +#endif + #include "GL/gl.h" #include "GL/glu.h" #include "GL/glkos.h" @@ -48,6 +52,24 @@ void DrawSquare(float width, float r, float g, float b, float z) { glEnd(); // done with the polygon } +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; +} + /* The main drawing function. */ void DrawGLScene() { @@ -77,6 +99,9 @@ int main(int argc, char **argv) ReSizeGLScene(640, 480); while(1) { + if(check_start()) + break; + DrawGLScene(); }