Avoid the need to hard-reset the Dreamcast to exit the samples - use the start button in all samples

This commit is contained in:
T_chan 2021-10-01 19:57:32 +00:00 committed by Luke Benstead
parent efc75db05c
commit 830a985606
27 changed files with 640 additions and 4 deletions

View File

@ -4,6 +4,10 @@
* output and incorrect depth testing * output and incorrect depth testing
*/ */
#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"
@ -42,6 +46,23 @@ 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 DrawQuad(const float* colour) { void DrawQuad(const float* colour) {
glBegin(GL_QUADS); glBegin(GL_QUADS);
@ -98,6 +119,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -34,6 +38,23 @@ 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 DrawSquare(float width, float r, float g, float b, float z) { void DrawSquare(float width, float r, float g, float b, float z) {
width /= 2; width /= 2;
@ -113,6 +134,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -94,6 +98,24 @@ void DrawGLScene()
glKosSwapBuffers(); 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) int main(int argc, char **argv)
{ {
glKosInit(); glKosInit();
@ -104,6 +126,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
DrawGLScene(); DrawGLScene();
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -48,6 +52,24 @@ void DrawSquare(float width, float r, float g, float b, float z) {
glEnd(); // done with the polygon 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. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
{ {
@ -77,6 +99,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -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();
} }

View File

@ -4,6 +4,10 @@
* output and incorrect depth testing * output and incorrect depth testing
*/ */
#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"
@ -42,6 +46,23 @@ 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 DrawQuad(const float* colour) { void DrawQuad(const float* colour) {
glBegin(GL_QUADS); glBegin(GL_QUADS);
@ -99,6 +120,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -2,6 +2,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.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/glext.h" #include "GL/glext.h"
@ -213,6 +217,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 DrawCube(float x, float z) { void DrawCube(float x, float z) {
static float pos = 0.0f; static float pos = 0.0f;
const static float radius = 30.0f; const static float radius = 30.0f;
@ -307,6 +329,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -2,6 +2,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.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/glext.h" #include "GL/glext.h"
@ -175,6 +179,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 DrawQuad() { void DrawQuad() {
glBegin(GL_QUADS); glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left Of The Texture and Quad glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // Bottom Left Of The Texture and Quad
@ -238,6 +260,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -11,6 +11,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.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"
@ -41,6 +45,23 @@ GLfloat TEXCOORD_ARRAY[4 * 2] = { 0, 0,
GLuint ARGB_ARRAY[4] = { 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFF00 }; GLuint ARGB_ARRAY[4] = { 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFF00 };
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;
}
/* Multi-Texture Example using Open GL Vertex Buffer Submission. */ /* Multi-Texture Example using Open GL Vertex Buffer Submission. */
void RenderCallback(GLuint texID0, GLuint texID1) { void RenderCallback(GLuint texID0, GLuint texID1) {
@ -119,6 +140,9 @@ int main(int argc, char **argv) {
GLuint texID1 = glTextureLoadPVR(IMAGE2_FILENAME, 0, 0); GLuint texID1 = glTextureLoadPVR(IMAGE2_FILENAME, 0, 0);
while(1) { while(1) {
if(check_start())
break;
/* Draw the "scene" */ /* Draw the "scene" */
RenderCallback(texID0, texID1); RenderCallback(texID0, texID1);

View File

@ -1,3 +1,7 @@
#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"
@ -34,6 +38,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -116,6 +137,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -36,6 +40,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -87,6 +108,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -36,6 +40,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -79,6 +100,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,6 @@
#ifdef __DREAMCAST__
#include <kos.h>
#endif
#include "GL/gl.h" #include "GL/gl.h"
#include "GL/glu.h" #include "GL/glu.h"
@ -35,6 +38,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -77,6 +97,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -37,6 +41,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -87,6 +108,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -37,6 +41,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -140,6 +161,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -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/glext.h" #include "GL/glext.h"
@ -178,6 +182,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -249,6 +270,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -2,6 +2,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.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"
@ -194,6 +198,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -265,6 +286,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,6 +1,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.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"
@ -200,6 +204,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -271,6 +292,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,3 +1,7 @@
#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"
@ -35,6 +39,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -60,6 +81,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -3,6 +3,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#ifdef __DREAMCAST__
#include <kos.h>
#endif
#include "GL/gl.h" #include "GL/gl.h"
#include "GL/glext.h" #include "GL/glext.h"
#include "GL/glu.h" #include "GL/glu.h"
@ -163,6 +167,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -234,6 +255,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -4,6 +4,10 @@
#include <stdint.h> #include <stdint.h>
#include <assert.h> #include <assert.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/glext.h" #include "GL/glext.h"
@ -233,6 +237,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 DrawPolygon() { void DrawPolygon() {
glBegin(GL_QUADS); // begin drawing a cube glBegin(GL_QUADS); // begin drawing a cube
@ -343,6 +365,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,4 +1,3 @@
typedef enum typedef enum
{ {
false, false,
@ -99,7 +98,7 @@ void drawPolygon()
glEnd(); glEnd();
} }
int frames = 0; int frames = 0;
void check_input() int check_input()
{ {
#ifdef __DREAMCAST__ #ifdef __DREAMCAST__
maple_device_t *cont; maple_device_t *cont;
@ -113,9 +112,12 @@ void check_input()
if (state) if (state)
{ {
if (state->buttons & CONT_START)
return 0;
if (frames <= 0) if (frames <= 0)
{ {
if (state->buttons & CONT_START) if (state->buttons & CONT_A)
{ {
offset = !offset; offset = !offset;
frames = 60; frames = 60;
@ -124,6 +126,8 @@ void check_input()
} }
} }
#endif #endif
return 1;
} }
/* The main drawing function. */ /* The main drawing function. */
@ -211,7 +215,8 @@ int main(int argc, char **argv)
while (1) while (1)
{ {
check_input(); if(!check_input())
break;
DrawGLScene(); DrawGLScene();
xrot += 0.1f; xrot += 0.1f;
yrot += 0.25f; yrot += 0.25f;

View File

@ -1,3 +1,7 @@
#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"
@ -38,6 +42,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -119,6 +140,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -1,6 +1,10 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.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"
@ -91,6 +95,23 @@ 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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
@ -135,6 +156,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -3,6 +3,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.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/glext.h" #include "GL/glext.h"
@ -171,6 +175,23 @@ 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 RenderTower(counter) { void RenderTower(counter) {
counter = counter % 3; counter = counter % 3;
@ -314,6 +335,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -2,6 +2,10 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.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"
@ -41,6 +45,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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
{ {
@ -96,6 +118,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }

View File

@ -2,6 +2,10 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.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"
@ -41,6 +45,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;
}
/* The main drawing function. */ /* The main drawing function. */
void DrawGLScene() void DrawGLScene()
{ {
@ -105,6 +127,9 @@ int main(int argc, char **argv)
ReSizeGLScene(640, 480); ReSizeGLScene(640, 480);
while(1) { while(1) {
if(check_start())
break;
DrawGLScene(); DrawGLScene();
} }