void drawGameMeshes(void) { skybox.render(); glmaze.render(); for (unsigned int i=0; i<Player_List.size(); ++i) { Player_List[i]->draw(); } cone1.render(); cone2.render(); }
void run() { glUseProgram(wireframeShaderProgram); Vertex centre = {0,0,0}; Cone cone = Cone(1, 1, centre, 30, 0); mat4 Projection = perspective(45.0f, 1.0f, 0.1f, 100.0f); mat4 View = lookAt(vec3(0,2,1), vec3(0,0,0), vec3(0,1,0)); View = scale(View, vec3(0.7f)); mat4 Model = mat4(1.0f); mat4 MVP; GLuint MatrixID = glGetUniformLocation(wireframeShaderProgram, "MVP"); //Running stuff running = GL_TRUE; double old_time = 0, current_time = 0; ostringstream title; float rotation = 0.f; while( running ) { current_time = glfwGetTime(); rotation = (float)((current_time - old_time) * speed); if (rotation >= 360.f) { rotation = 0.f; } old_time = current_time; View = rotate(View, rotation, vec3(1, 1, 1)); MVP = Projection * View * Model; glUniformMatrix4fv(MatrixID, 1, GL_FALSE, &MVP[0][0]); glClearColor(0,0,0,0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); cone.render(); glFlush(); glfwSwapBuffers(); if (!glfwGetWindowParam(GLFW_OPENED)) { running = GL_FALSE; } } }