Fix nanogui menu tutorial

This commit is contained in:
schuellc
2015-12-02 17:38:40 +01:00
parent 7e599d37fc
commit 2ab9b5bab7
2 changed files with 29 additions and 35 deletions
+11 -7
View File
@@ -5,14 +5,15 @@
#include <iostream>
#include "tutorial_shared_path.h"
Eigen::MatrixXd V;
Eigen::MatrixXi F;
bool boolVariable = true;
float floatVariable = 0.1f;
int main(int argc, char *argv[])
{
Eigen::MatrixXd V;
Eigen::MatrixXi F;
bool boolVariable = true;
float floatVariable = 0.1f;
enum Orientation { Up=0,Down,Left,Right } dir = Up;
// Load a mesh in OFF format
igl::readOFF(TUTORIAL_SHARED_PATH "/bunny.off", V, F);
@@ -34,11 +35,14 @@ int main(int argc, char *argv[])
},[&]() {
return boolVariable; // get
});
// Expose an enumaration type
viewer.ngui->addVariable<Orientation>("Direction",dir)->setItems({"Up","Down","Left","Right"});
// Add a button
viewer.ngui->addButton("Print Hello",[](){ std::cout << "Hello\n"; });
// Add an additional bar
// Add an additional menu window
viewer.ngui->addWindow(Eigen::Vector2i(220,10),"New Window");
// Expose the same variable directly ...