Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Code off

Name: Anonymous 2009-07-28 13:59

Welcome to the first annual /prog/ Code off !

The language will be C.

Compeptitors include (in no particular order):

Mr. Ribs
Xarn
FV
Anonymous
W. T. Snacks

Rumor has it, that there may be a special guest appearance from either The Sussman or
Leah Culver.

What's the point of this, you ask?

It's to determine who is an EXPERT PROGRAMMER.

Marking criteria:

Optimization
Elegance

Bonus marks:
indentation

Good luck!

Name: Anonymous 2009-07-30 9:17

>>157
Oops, forgot I was going to use a VBO.  Also enabled double buffering to avoid flickering.
9,11d8
< static struct {
<     GLfloat data[16];
< } square_data[MAX_SQUARE];
21c18
<     glVertexPointer(4, GL_FLOAT, 0, square_data);
---
    glVertexPointer(4, GL_FLOAT, 0, NULL);
40c37
<     memcpy(square_data[square_count++].data, data, sizeof(GLfloat) * 16);
---
    glBufferSubData(GL_ARRAY_BUFFER, square_count++ * sizeof(GLfloat) * 16, sizeof(GLfloat) * 16, data);
81a79
    GLuint vbo;
85c83
<     glutInitDisplayMode(0);
---
    glutInitDisplayMode(GLUT_DOUBLE);
104a103,106
    glGenBuffers(1, &vbo);
    glBindBuffer(GL_ARRAY_BUFFER, vbo);
    glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat) * 16 * MAX_SQUARE, NULL, GL_STATIC_DRAW);

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List