+int drawFloorRecurse = 10;\r
+/*void drawSquare(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) {\r
+ drawSquare(0, x1, y1, x2, y2);\r
+}*/\r
+\r
+void drawSquare(int recurseLevel, GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) {\r
+\r
+ if ( drawFloorRecurse != recurseLevel ) {\r
+ GLfloat xm = (x2 - x1) / 2;\r
+ if ( x1 > x2 ) {\r
+ xm = (x1 - x2) / 2;\r
+ }\r
+\r
+ drawSquare(recurseLevel + 1, x1, y1, xm, y2);\r
+ drawSquare(recurseLevel + 1, xm, y1, x2, y2);\r
+ } else {\r
+ printf("Drawing (%f, %f) -> (%f, %f)", x1, y2, x2, y2);\r
+ glBegin(GL_QUADS);\r
+ glVertex3f(x1, 0.0, y1);\r
+ glVertex3f(x1, 0.0, y2);\r
+ glVertex3f(x2, 0.0, y2);\r
+ glVertex3f(x2, 0.0, y1);\r
+ glEnd();\r
+ }\r
+\r
+}\r
+\r