test
This commit is contained in:
parent
aa9d3eb52a
commit
e75af14fbc
1 changed files with 45 additions and 4 deletions
|
|
@ -12,9 +12,9 @@ GSClient GSClientCreate(GSEngine engine) {
|
||||||
|
|
||||||
client->engine = engine;
|
client->engine = engine;
|
||||||
|
|
||||||
client->camera[0] = 0;
|
client->camera[0] = 5;
|
||||||
client->camera[1] = 0;
|
client->camera[1] = 0;
|
||||||
client->camera[2] = 0;
|
client->camera[2] = 5;
|
||||||
|
|
||||||
client->look_at[0] = 0;
|
client->look_at[0] = 0;
|
||||||
client->look_at[1] = 1;
|
client->look_at[1] = 1;
|
||||||
|
|
@ -43,6 +43,44 @@ void GSClientDestroy(GSClient client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scene(GSClient client) {
|
static void scene(GSClient client) {
|
||||||
|
int i;
|
||||||
|
static double r = 0;
|
||||||
|
|
||||||
|
GSGLTextureSet(client->gl, 2);
|
||||||
|
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glNormal3f(0, 1, 0);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
|
glVertex3f(-2.5, -2, -2.5);
|
||||||
|
glTexCoord2f(0, 2.5);
|
||||||
|
glVertex3f(-2.5, -2, 2.5);
|
||||||
|
glTexCoord2f(2.5, 2.5);
|
||||||
|
glVertex3f(2.5, -2, 2.5);
|
||||||
|
glTexCoord2f(2.5, 0);
|
||||||
|
glVertex3f(2.5, -2, -2.5);
|
||||||
|
glEnd();
|
||||||
|
|
||||||
|
glPushMatrix();
|
||||||
|
glRotatef(r++, 1, 1, 1);
|
||||||
|
for(i = 0; i < 6; i++){
|
||||||
|
glBegin(GL_QUADS);
|
||||||
|
glNormal3f(0, 1, 0);
|
||||||
|
glTexCoord2f(0, 0);
|
||||||
|
glVertex3f(-1, 1, -1);
|
||||||
|
glTexCoord2f(0, 1);
|
||||||
|
glVertex3f(-1, 1, 1);
|
||||||
|
glTexCoord2f(1, 1);
|
||||||
|
glVertex3f(1, 1, 1);
|
||||||
|
glTexCoord2f(1, 0);
|
||||||
|
glVertex3f(1, 1, -1);
|
||||||
|
glEnd();
|
||||||
|
if(i < 3) glRotatef(90, 0, 0, 1);
|
||||||
|
if(i == 3) glRotatef(90, 1, 0, 0);
|
||||||
|
if(i == 4) glRotatef(180, 1, 0, 0);
|
||||||
|
}
|
||||||
|
glPopMatrix();
|
||||||
|
|
||||||
|
GSGLTextureSet(client->gl, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GSClientStep(GSClient client) {
|
void GSClientStep(GSClient client) {
|
||||||
|
|
@ -63,8 +101,11 @@ void GSClientStep(GSClient client) {
|
||||||
|
|
||||||
static double r = 0;
|
static double r = 0;
|
||||||
|
|
||||||
client->look_at[0] = cos(r) * 5;
|
client->look_at[0] = 5 + cos(r) * 5;
|
||||||
client->look_at[2] = sin(r) * 5;
|
client->look_at[2] = 5 + sin(r) * 5;
|
||||||
|
|
||||||
|
client->look_at[0] = 0;
|
||||||
|
client->look_at[2] = 0;
|
||||||
|
|
||||||
r += 0.1;
|
r += 0.1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue