本文整理汇总了C++中MyWindow::displayMode方法的典型用法代码示例。如果您正苦于以下问题:C++ MyWindow::displayMode方法的具体用法?C++ MyWindow::displayMode怎么用?C++ MyWindow::displayMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyWindow
的用法示例。
在下文中一共展示了MyWindow::displayMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(){
double world_radius = 50;
nav.smooth(0.8);
lens.near(1).far(world_radius);
// set up mesh:
mesh.primitive(Graphics::TRIANGLES);
double tri_size = 2;
int count = 4000;
for (int i=0; i<count; i++) {
double x = rnd::uniformS(world_radius);
double y = rnd::uniformS(world_radius);
double z = rnd::uniformS(world_radius);
for (int v=0; v<3; v++) {
mesh.color(HSV(float(i)/count, v!=2, 1));
mesh.vertex(x+rnd::uniformS(tri_size), y+rnd::uniformS(tri_size), z+rnd::uniformS(tri_size));
}
}
// set up grid:
grid.primitive(Graphics::LINES);
double stepsize = 1./2;
for (double x=-1; x<=1; x+= stepsize) {
for (double y=-1; y<=1; y+= stepsize) {
grid.vertex(x, y, 1);
grid.vertex(x, y, -1);
}}
for (double x=-1; x<=1; x+= stepsize) {
for (double z=-1; z<=1; z+= stepsize) {
grid.vertex(x, 1, z);
grid.vertex(x, -1, z);
}}
for (double y=-1; y<=1; y+= stepsize) {
for (double z=-1; z<=1; z+= stepsize) {
grid.vertex(1, y, z);
grid.vertex(-1, y, z);
}}
grid.scale(world_radius);
// set up cube:
cube.color(1,1,1,1);
cube.primitive(Graphics::TRIANGLES);
addCube(cube);
cube.generateNormals();
win.create(Window::Dim(100, 0, 640, 480), "Cube Map FBO Example", 60);
win.displayMode(win.displayMode() | Window::STEREO_BUF);
win.add(new StandardWindowKeyControls);
win.add(new NavInputControl(nav));
MainLoop::start();
return 0;
}