}
//TODO
- return 0;
+ //return 0;
glfwSetKeyCallback(win, clbk_key);
glfwSetCursorPosCallback(win, clbk_motion);
while(!glfwWindowShouldClose(win)) {
display();
- glfwSwapBuffers(win);
+ gfx_swapbuffers();
glfwPollEvents();
}
break;
// case 'F':
- // fog_density = fog_density < 1 - 0.0009 ? fog_density + 0.0001 : 1;
- // break;
+ // fog_density = fog_density < 1 - 0.0009 ? fog_density + 0.0001 : 1;
+ // break;
// case 'U':
- // fog_density = fog_density > 0.0001 ? fog_density - 0.0001 : 0;
- // break;
+ // fog_density = fog_density > 0.0001 ? fog_density - 0.0001 : 0;
+ // break;
+
+ case 'P':
+ gfx_wireframe(true);
+ break;
+
+ case 'F':
+ gfx_wireframe(false);
+ break;
default:
break;
static void clbk_reshape(GLFWwindow *win, int width, int height)
{
+ gfx_reshape(width, height);
gfx_viewport(0, 0, width, height);
aspect = (float)width / (float)height;
mprojection = calc_projection_matrix(45, aspect, 0.5, 1000.0);
camera->set_orbit_params(cam_theta, cam_phi, cam_dist);
camera->set_position(cam_pos.x, cam_pos.y, cam_pos.z);
+ gfx_begin_drawing();
+
gfx_clear(0.1, 0.1, 0.1);
terrain_rend->draw();
cow_rend->draw();
+
+ gfx_end_drawing();
}
static bool gen_poisson(std::vector<Vec2> &points, float min_dist, float radius)
}
}
return false;
-}
\ No newline at end of file
+}