Avoid the need to hard-reset the Dreamcast to exit the sample
This commit is contained in:
parent
e08a9f084e
commit
87e1869134
|
@ -3,6 +3,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef __DREAMCAST__
|
||||||
|
#include <kos.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "GL/gl.h"
|
#include "GL/gl.h"
|
||||||
#include "GL/glu.h"
|
#include "GL/glu.h"
|
||||||
#include "GL/glkos.h"
|
#include "GL/glkos.h"
|
||||||
|
@ -199,6 +203,24 @@ void ReSizeGLScene(int Width, int Height)
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
void DrawTexturedQuad(int tex, float x, float y, float z)
|
void DrawTexturedQuad(int tex, float x, float y, float z)
|
||||||
{
|
{
|
||||||
GLfloat texW = 10;
|
GLfloat texW = 10;
|
||||||
|
@ -303,6 +325,9 @@ int main(int argc, char **argv)
|
||||||
ReSizeGLScene(640, 480);
|
ReSizeGLScene(640, 480);
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
|
if(check_start())
|
||||||
|
break;
|
||||||
|
|
||||||
DrawGLScene();
|
DrawGLScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user