added glshim library

This commit is contained in:
lubomyr
2015-02-09 20:25:03 +00:00
parent e5e9109652
commit 967c18296e
143 changed files with 231962 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
int main() {
glBegin(GL_QUADS);
glColor4f(0, 0.1, 0.2, 0.3);
glTexCoord2f(0.4, 0.5);
glVertex3f(0, 1, 2);
glVertex3f(3, 4, 5);
glVertex3f(6, 7, 8);
glVertex3f(9, 10, 11);
glEnd();
GLfloat verts[] = {
0, 1, 2,
3, 4, 5,
6, 7, 8,
9, 10, 11,
};
GLfloat color[] = {
0, 0.1, 0.2, 0.3,
0, 0.1, 0.2, 0.3,
0, 0.1, 0.2, 0.3,
0, 0.1, 0.2, 0.3,
};
GLfloat tex[] = {
0.4, 0.5,
0.4, 0.5,
0.4, 0.5,
0.4, 0.5,
};
GLushort indices[] = {
0, 1, 3,
1, 2, 3,
};
// TODO: out of order glEnableClientState?
test_glColor4f(0.0, 0.1, 0.2, 0.3);
test_glEnableClientState(GL_VERTEX_ARRAY);
test_glVertexPointer(3, GL_FLOAT, 0, verts);
test_glEnableClientState(GL_COLOR_ARRAY);
test_glColorPointer(4, GL_FLOAT, 0, color);
test_glEnableClientState(GL_TEXTURE_COORD_ARRAY);
test_glTexCoordPointer(2, GL_FLOAT, 0, tex);
test_glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
test_glDisableClientState(GL_VERTEX_ARRAY);
test_glDisableClientState(GL_COLOR_ARRAY);
test_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
mock_return;
}

View File

@@ -0,0 +1,18 @@
int main() {
for (int i = 0; i < 3; i++) {
glRectf(0, 0, 1, 1);
test_glEnableClientState(GL_VERTEX_ARRAY);
// TODO: pointers are skipped in verification
GLfloat verts[] = {
0, 0, 0,
1, 0, 0,
1, 1, 0,
0, 1, 0,
};
test_glVertexPointer(3, GL_FLOAT, 0, verts);
test_glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
test_glDisableClientState(GL_VERTEX_ARRAY);
}
mock_return;
}

View File

@@ -0,0 +1,18 @@
int main() {
glBegin(GL_TRIANGLES);
glVertex3f(0, 1, 2);
glVertex3f(3, 4, 5);
glVertex3f(6, 7, 8);
glEnd();
test_glEnableClientState(GL_VERTEX_ARRAY);
GLfloat verts[] = {
0, 1, 2,
3, 4, 5,
6, 7, 8,
};
test_glVertexPointer(3, GL_FLOAT, 0, verts);
test_glDrawArrays(GL_TRIANGLES, 0, 3);
test_glDisableClientState(GL_VERTEX_ARRAY);
mock_return;
}