Code Monkey home page Code Monkey logo

nanogui's People

Contributors

alwaysgeeky avatar avasilkov avatar bsdbeard avatar dalerank avatar devmiyax avatar ermarch avatar fairlight1337 avatar greatattractor avatar iamthecarl avatar longjon avatar merlinnd avatar meumeu avatar michalkaptur avatar mottosso avatar mrzv avatar nhojb avatar omochi avatar petterarvidsson avatar r-lyeh avatar rymut avatar selfshadow avatar svenevs avatar thorius avatar tom94 avatar tony avatar valpackett avatar vincentdchan avatar willxinc avatar wjakob avatar yurivict avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nanogui's Issues

Question: how to use correctly vscrollpanel ?

It seem the only situation were the vertical scoll bar is working correctly is the case showed in the example 1

I tried to wrap windows content under a vscrollpanel and it never worked correctly.

Is it possible to use a vscroll bar for a window using a group layout for instance ?

Compile errors on VS 2015, win32

lots of issues with the build in VS 2015 [x86]:

1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because D:/dev/nanogui/build/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/dev/nanogui/build/ext_build/glfw/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/dev/nanogui/build/ext_build/glfw/src/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: bin2c, Configuration: Debug Win32 ------
3>------ Rebuild All started: Project: glfw_objects, Configuration: Debug Win32 ------
4>------ Skipped Rebuild All: Project: mkdoc, Configuration: Debug Win32 ------
4>Project not selected to build for this solution configuration
2> Building Custom Rule D:/dev/nanogui/CMakeLists.txt
2> CMake does not need to re-run because D:\dev\nanogui\build\CMakeFiles\generate.stamp is up-to-date.
3> Building Custom Rule D:/dev/nanogui/ext/glfw/src/CMakeLists.txt
3> CMake does not need to re-run because D:\dev\nanogui\build\ext_build\glfw\src\CMakeFiles\generate.stamp is up-to-date.
2> bin2c.c
3> context.c
3> init.c
3> input.c
2> bin2c.vcxproj -> D:\dev\nanogui\build\Debug\bin2c.exe
3> monitor.c
3> window.c
3> win32_init.c
3> win32_monitor.c
3> win32_time.c
3> win32_tls.c
3> win32_window.c
3> winmm_joystick.c
3> wgl_context.c
3> Generating Code...
3> glfw_objects.vcxproj -> D:\dev\nanogui\build\ext_build\glfw\src\glfw_objects.dir\Debug\glfw_objects.lib
5>------ Rebuild All started: Project: nanogui, Configuration: Debug Win32 ------
6>------ Rebuild All started: Project: glfw, Configuration: Debug Win32 ------
6> Building Custom Rule D:/dev/nanogui/ext/glfw/src/CMakeLists.txt
5> Building Custom Rule D:/dev/nanogui/CMakeLists.txt
6> CMake does not need to re-run because D:\dev\nanogui\build\ext_build\glfw\src\CMakeFiles\generate.stamp is up-to-date.
5> CMake does not need to re-run because D:\dev\nanogui\build\CMakeFiles\generate.stamp is up-to-date.
5> Running bin2c
5> nanovg.c
6> Creating library D:/dev/nanogui/build/ext_build/glfw/src/Debug/glfw3dll.lib and object D:/dev/nanogui/build/ext_build/glfw/src/Debug/glfw3dll.exp
6> glfw.vcxproj -> D:\dev\nanogui\build\ext_build\glfw\src\Debug\glfw3.dll
5> glew.c
5> resources.cpp
5> glutil.cpp
5> common.cpp
5> widget.cpp
5> theme.cpp
5> layout.cpp
5> screen.cpp
5> label.cpp
5> window.cpp
5>D:\dev\nanogui\src\screen.cpp(213): warning C4316: 'nanogui::Theme': object allocated on the heap may not be aligned 16
5>D:\dev\nanogui\src\layout.cpp(428): warning C4018: '>': signed/unsigned mismatch
5> popup.cpp
5> checkbox.cpp
5>d:\dev\nanogui\src\screen.cpp(380): warning C4702: unreachable code
5>d:\dev\nanogui\src\screen.cpp(432): warning C4702: unreachable code
5>d:\dev\nanogui\src\screen.cpp(481): warning C4702: unreachable code
5> button.cpp
5> popupbutton.cpp
5> combobox.cpp
5> progressbar.cpp
5> slider.cpp
5> messagedialog.cpp
5>D:\dev\nanogui\src\combobox.cpp(52): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5> textbox.cpp
5> imagepanel.cpp
5> imageview.cpp
5> vscrollpanel.cpp
5> colorwheel.cpp
5> colorpicker.cpp
5>D:\dev\nanogui\src\messagedialog.cpp(37): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
5>D:\dev\nanogui\src\messagedialog.cpp(39): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
5>D:\dev\nanogui\src\messagedialog.cpp(46): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5>D:\dev\nanogui\src\messagedialog.cpp(49): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5> graph.cpp
5>D:\dev\nanogui\src\colorpicker.cpp(26): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5> Creating library D:/dev/nanogui/build/Debug/nanogui.lib and object D:/dev/nanogui/build/Debug/nanogui.exp
5> nanogui.vcxproj -> D:\dev\nanogui\build\Debug\nanogui.dll
7>------ Rebuild All started: Project: example1, Configuration: Debug Win32 ------
8>------ Rebuild All started: Project: example2, Configuration: Debug Win32 ------
9>------ Rebuild All started: Project: nanogui_python, Configuration: Debug Win32 ------
7> Building Custom Rule D:/dev/nanogui/CMakeLists.txt
8> Building Custom Rule D:/dev/nanogui/CMakeLists.txt
8> CMake does not need to re-run because D:\dev\nanogui\build\CMakeFiles\generate.stamp is up-to-date.
9> Building Custom Rule D:/dev/nanogui/CMakeLists.txt
8> example2.cpp
9> CMake does not need to re-run because D:\dev\nanogui\build\CMakeFiles\generate.stamp is up-to-date.
9> python.cpp
7> CMake does not need to re-run because D:\dev\nanogui\build\CMakeFiles\generate.stamp is up-to-date.
7> example1.cpp
8>D:\dev\nanogui\include\nanogui/formhelper.h(82): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
8>D:\dev\nanogui\include\nanogui/formhelper.h(130): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
8>D:\dev\nanogui\include\nanogui/formhelper.h(146): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
9>D:\dev\nanogui\include\nanogui/formhelper.h(82): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
9>D:\dev\nanogui\include\nanogui/formhelper.h(130): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
9>D:\dev\nanogui\include\nanogui/formhelper.h(146): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
8>D:\dev\nanogui\include\nanogui/formhelper.h(122): error C2719: 'v': formal parameter with requested alignment of 16 won't be aligned
8> D:\dev\nanogui\src\example2.cpp(54): note: see reference to function template instantiation 'nanogui::detail::FormWidgetnanogui::Color,std::true_type *nanogui::FormHelper::addVariablenanogui::Color(const std::string &,Type &,bool)' being compiled
8> with
8> [
8> Type=nanogui::Color
8> ]
8>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\functional(272): error C2719: '<_Args_0>': formal parameter with requested alignment of 16 won't be aligned
8> C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\functional(464): note: see reference to class template instantiation 'std::_Func_class<_Ret,Type>' being compiled
8> with
8> [
8> _Ret=void,
8> Type=nanogui::Color
8> ]
8> D:\dev\nanogui\include\nanogui/formhelper.h(125): note: see reference to class template instantiation 'std::function<void (Type)>' being compiled
8> with
8> [
8> Type=nanogui::Color
8> ]
9>D:\dev\nanogui\python\python.cpp(650): error C2719: 'unnamed-parameter': formal parameter with requested alignment of 16 won't be aligned
7>D:\dev\nanogui\src\example1.cpp(54): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(56): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(58): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(62): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(63): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(67): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(68): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(70): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(73): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(78): warning C4316: 'nanogui::ToolButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(79): warning C4316: 'nanogui::ToolButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(80): warning C4316: 'nanogui::ToolButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(81): warning C4316: 'nanogui::ToolButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(83): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(84): warning C4316: 'nanogui::PopupButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(87): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(89): warning C4316: 'nanogui::PopupButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(98): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(102): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(107): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(112): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(121): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(122): warning C4316: 'nanogui::PopupButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(146): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(150): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(155): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(161): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(162): warning C4316: 'nanogui::ComboBox': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(163): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(171): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(174): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(180): warning C4316: 'nanogui::Slider': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(201): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(203): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(204): warning C4316: 'nanogui::Graph': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(224): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(236): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(248): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(255): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(257): warning C4316: 'nanogui::ComboBox': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(261): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(262): warning C4316: 'nanogui::PopupButton': object allocated on the heap may not be aligned 16
7>D:\dev\nanogui\src\example1.cpp(272): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
7> example1.vcxproj -> D:\dev\nanogui\build\Debug\example1.exe
10>------ Skipped Rebuild All: Project: ALL_BUILD, Configuration: Debug Win32 ------
10>Project not selected to build for this solution configuration
========== Rebuild All: 6 succeeded, 2 failed, 2 skipped ==========

Suggestion: Removing external libraries from this repo

I would love to use nanogui in my projects for graphical applications. As nanogui is, my project is also dependent on Eigen, and it makes a bit difficult to build them together. I understand that having all the external libraries in the same repo is very convenient when developing the library. However, it could cause dependency conflicts when the they have common dependencies.

To avoid this problem, I would like to suggest removing all the external libraries from this repo and changing nanogui to build with installed libraries using CMake find_package.

If this makes sense to you, then I'm willing to help the change. Please let me know what you think. Thanks!

Resize windows

It would be great to have the ability to resize windows (by dragging a corner with a mouse, or something like that).

mTheme accessed in some widget's constructor

Hi Wenzel,

Some widgets (in particular Label and Textbox) access mTheme in their constructor. mTheme is however copied from the parent widget otherwise it is a null pointer. This means you cannot create such a widget without parent and attach it later to the GUI. This not a bug per say but it would be convenient as I am doing this regularly in my code.

Thanks!

problem about framebuffer render

hi, I came across a problem with framebuffer. below is my rendering code in drawContents(), I initialized nanogui::GLFramebuffer and ready() return OK. If rendering directly to window, it works well. Did I missed anything about framebuffer in nanogui ?

           mFramebuffer.bind();
           glEnable(GL_DEPTH_TEST);
    glDepthFunc(GL_LESS);
    glClearDepth(1);          
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glClearColor(1.0, 0.3, 0.3, 1.0);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    glBindVertexArray(vao);
    glUseProgram(shader_progm);
    glDrawArrays(GL_TRIANGLES, 0, 3);
    glUseProgram(0);
    mFramebuffer.release();
    //mFramebuffer.downloadTGA("tmp.tga");
    // read 
    mFramebuffer.bind();
    cv::Mat dispImg;
    unsigned char* colorDisp = new unsigned char[4 * 1024 * 768];
    glReadPixels(0, 0, 1024, 768, GL_RGBA, GL_UNSIGNED_BYTE, colorDisp);
    cv::Mat _tmp = cv::Mat(768, 1024, CV_8UC4, colorDisp);
    _tmp.copyTo(dispImg);
    delete colorDisp;
    cv::imshow("Simple", dispImg);
    cv::waitKey(10);
    mFramebuffer.release();

Besides, glDrawArrays didn't work when primitive was GL_QUADS ? glGenVertexArrays returns error when Nanogui was built as shared library, I fixed it by building it as static. Is there anything I need to take care when I used my own rendering code based vao.
Thx.

I get errors about std::array<char,0x08>

common.cpp(108): error C2027: use of undefined type 'std::array<char,0x08>'

common.cpp(108): error C2079: 'nanogui::utf8' uses undefined class 'std::array<char,0x08>'

Windows cannot be child of non-Screen.

When you add windows to a Widget (used as panel), they duplicate, because the requestFocus() calls bringWindowToFront() and adds the Window to the children of the Screen.

How do I create a screen with an existing GLFWwindow instance?

I'm calling this code...

Screen *screen = new Screen();
screen->initialize(window /* my GLFWwindow*/, true);

and initialize throws an Exception:

Exception thrown at 0x00000000 in OpenGL-Game.exe: 0xC0000005: Access violation executing location 0x00000000.

Call-Stack:

nanogui.dll!glnvg__createShader(GLNVGshader * shader, const char * name, const char * header, const char * opts, const char * vshader, const char * fshader) Line 407 C++
nanogui.dll!glnvg__renderCreate(void * uptr) Line 649 C++
nanogui.dll!nvgCreateInternal(NVGparams * params) Line 228 C
nanogui.dll!nvgCreateGL3(int flags) Line 1480 C++
nanogui.dll!nanogui::Screen::initialize(GLFWwindow * window, bool shutdownGLFWOnDestruct) Line 207 C++
OpenGL-Game.exe!main() Line 162 C++

Am I doing it wrong, or is it a bug?

handler error

Caught exception in event handler: regex_error
[1] 29360 abort (core dumped) ./example2

when I click the number 12345678 or 3.142 or 3.141593, the program is broken down

Errors when running in linux

Hi! Thank you for offering this opensource library first.
This is my first time to use nanogui. I was trying to use it in Linux Mint 17.1 32bit. I successfully compiled it but when I ran it, errors occurred.

The detailed information as follow:
[example1]
GLFW error 65543: GFX Forward compatibility requested but GLX_ARB_create_context is unavailable
fatal error: Could not create an OpenGL 3.3 context!

[example2]
GLFW error 65543: GFX Forward compatibility requested but GLX_ARB_create_context is unavailable
terminate called after throwing an instance of 'std::runtime_error'
what(): could not create an OpenGL 3.3 context!

Compilation with TDM-GCC under windows

It can be done but the CMakelists.txt must be sligthly updated

First WIN32 must be defined explicitely by adding:

if(WIN32)
    add_definitions ("-DWIN32")
endif()

and also adding -std=c++11 in case we are not using MSVC

if(MSVC)
  if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
    string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
  else()
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
  endif()
else()
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11")
endif()

Beside this nanogui works out of the box with the current TDM (tdm64-gcc-5.1.0-2.exe)

Launching nanogui Screen in a separate thread

I would like to launch a nanogui Screen in a thread of its own. This works as intended on Linux, but crashes and burns on a Mac. Any suggestions and pointers would be very welcome.

#include <iostream>
#include <thread>
#include <nanogui/screen.h>

namespace ng = nanogui;

int main(int argc, char *argv[])
{
    std::thread t([]()
    {
        try
        {
            nanogui::init();

            ng::Screen* app = new ng::Screen(ng::Vector2i { 800, 600 }, "Test");

            app->drawAll();
            app->setVisible(true);

            nanogui::mainloop();

            delete app;

            nanogui::shutdown();
        } catch (const std::runtime_error &e)
        {
            std::string error_msg = std::string("Caught a fatal error: ") + std::string(e.what());
            #if defined(WIN32)
                MessageBoxA(nullptr, error_msg.c_str(), NULL, MB_ICONERROR | MB_OK);
            #else
                std::cerr << error_msg << '\n';
            #endif
            return -1;
        }
    });
    t.join();

    return 0;
}

Beginner installation & cmake problems

Yo,

When working with nanogui whats the best way to deal with cmake and installation?
Usually with libraries I just make install and find the static libraries from the common library directories.
With nanogui I could not do this so whats the preferred workflow with multiple projects? ExternalProject_Add?

Uhhhh Cmake sure gives me a lot of headaches! : )
Thanks,

  • J

resources.h not found

Hi I try to use the nanogui in my projekt and added it as subdirectory to my cmake project.
As I see you collect the the resources with bin2c into a resources.h and resources.cpp but when I try to compile the projekt it seams the compiler can not find the header file.

Could you maybe give me a hint what went wrong?

[Suggestion] Add a step-by-step guide on including it into an existing project.

I have tried for hours to start with an empty project and then adding nanogui to it but it did not work. I tried mirroring the configuration properties, but the included examples are so different from a default empty project, so if I want to add it to an existing project I am affraid I will mess up other parts.

I have no idea what the issue could be or what I should pay attention to. This makes troubleshooting very difficult. I expected it to be straightforward (adding header and library directories, including nanogui/nanogui.h and linking nanogui.lib) but it is not. Perhaps someone could add a HOWTO on adding it to a VS project to get a minimal working example?

Allow images to scale up to the size of ImageView

Currently, if the size of ImageView is larger than the image, the image will be shown at its native (smaller) size. It would be nice to (maybe, optionally) remove this restriction. The actual change to the code of ImageView::draw requires removing (or rather adjusting a little) the checks for s.x() < w or s.y() < h.

Popup Button offscreen detection

Playing around with the example1, if you move the Basic Widgets window down to the lower right corner of the screen and click the Combobox, you cannot see the sub layout to make a selection. You should detect if the sub layout will have any of its bounds off screen and have it pop from the left side of the control.

bug on creating a MessageDialog with Nanogui

Hi! Recently I was using libigl and nanogui with my project. I want to use nanogui::MessageDialog to create a message dialog and callback my lambda function. But the created window cannot be closed by pushing the OK button. The code I wrote as follow:

viewer.ngui->addButton("MSG", [&] {
            auto dlg = new nanogui::MessageDialog(
                viewer.ngui->window(), 
                nanogui::MessageDialog::Type::Information,
                "Title",
                "This is an information message");
            dlg->setCallback([](int result) { std::cout << "Dialog result: " << result << std::endl; });
        });

image

Opengl calls in application cause GL_INVALID_OPERATION

Pretty simple to test, I was having trouble integrating nanogui in my application, any OpenGL calls I make in my app cause an invalid operation. I worked in it a while on my end, but got nowhere. So, I simply went down into example1.cpp and added

  virtual void drawContents() {
        using namespace nanogui;

        /* Draw the window contents using OpenGL */
        mShader.bind();

        Matrix4f mvp;
        mvp.setIdentity();
        mvp.topLeftCorner<3,3>() = Matrix3f(Eigen::AngleAxisf((float) glfwGetTime(),  Vector3f::UnitZ())) * 0.25f;

        mvp.row(0) *= (float) mSize.y() / (float) mSize.x();

        mShader.setUniform("modelViewProj", mvp);

        /* Draw 2 triangles starting at index 0 */
        mShader.drawIndexed(GL_TRIANGLES, 0, 2);

      GLenum glErr = glGetError();  // Clear any errors.
        glRenderMode(GL_RENDER); // Set state.
        glErr = glGetError();   // Get error

        if (glErr) {
            std::cout << "OpenGL Error: " << glErr << std::endl;
        }
    }

So, if you run you will get a bunch of 1282 errors, GL_INVALID_OPERATION.

roadmap?

Hello wjakob,
What are the upcoming plans?
The lib looks promising :)

Calling detaching a window when importing a module doesn't work

Not sure what's causing it, but when I try to call mainloop(detach = ...) during the initialization of my own module exposed using pybind11, not only does it not detach, but it hangs even after I close the window. Here's an example code:

struct MyScreen: public ng::Screen
{
    MyScreen():
        ng::Screen({ 1200, 800 }, "Test")           {}
};

struct Environment
{
    Environment(py::module m, py::module nanogui): nanogui_(nanogui)
    {
        py::object ng_init     = nanogui_.attr("init");
        py::object ng_mainloop = nanogui_.attr("mainloop");

        ng_init();

        auto* viewer = new MyScreen;
        viewer->drawAll();
        viewer->setVisible(true);

        py::object viewer_obj = py::cast(viewer);
        m.attr("viewer") = viewer_obj;

        py::tuple args;
        py::dict kwargs;
        kwargs["detach"] = viewer_obj;

        handle_ = ng_mainloop(*args, **kwargs);
    }

    ~Environment()
    {
        py::object ng_shutdown = nanogui_.attr("shutdown");
        py::object handle_join = handle_.attr("join");
        handle_join();
        ng_shutdown();
    }

    py::module nanogui_;
    py::object handle_;
};

PYBIND11_PLUGIN(mymod)
{
    py::module m("mymod", "mymod bindings");

    auto nanogui = py::module::import("nanogui");
    py::object screen = nanogui.attr("Screen");

    py::class_<MyScreen>(m, "MyScreen", screen);

    py::class_<Environment>(m, "Environment");

    m.attr("_env") = py::cast(new Environment(m,nanogui));

    return m.ptr();
}

Exposing derived widgets in Python

Suppose I'm writing a library that has some new widgets, maybe some new screens in it. I can expose those to Python using pybind11 without a problem, but I cannot find a way to express that they derive from the respective nanogui classes. It seems the solution would be to expose instances like widget as the static variables of nanogui.so (and define them for all the classes). It would probably mean that the new libraries would have to link against the nanogui.so, which is not ideal, but not a deal-breaker either.

I hope it makes sense what I'm after.

vscrollpanel correction to be able to scroll any widgets

I was able to solve the issue about vscrollpanel

image

The correction is a one liner (the base implementation was not called for the layout)

void VScrollPanel::performLayout(NVGcontext *ctx) {
    Widget::performLayout(ctx); // This is the new line that is needed to correct the issue

    if (mChildren.empty())
        return;
    Widget *child = mChildren[0];
    mChildPreferredHeight = child->preferredSize(ctx).y();
    child->setPosition(Vector2i(0, 0));
    child->setSize(Vector2i(mSize.x()-12, mChildPreferredHeight));
}

Best regards.

Rounded button do not work

Hello,

I increased mButtonCornerRadius (in theme) from 2 to 4 or 8
but it doesn't change the aspect of the buttons

Port to SDL?

Nice GUI!

How hard would it be to use this on SDL? I don't mind doing the work, but having a quick look through the code I can't see the obvious doc/path to take.

Compilation Error Ubuntu 14.04

Hello,

I followed the instructions to install required packages and cmake but when I try to do "make" (after cmake) I have the following error.

nanogui_bug-report

Here is the output of my cmake (just in case it could help).
nanogui_bug-report_2

I tried my best to solve the problem or to get around it but I failed, sorry.
In any case, thank you for developing this project. That's very cool.
Best regards

compiling without admin privileges?

I'd really like to try this out. I did git clone --recursive, configured with cmake. When I build, it fails when it tries to install into /usr/local. I don't have admin privileges, and even if I did wouldn't want to install into /usr/local. Modifying CMAKE_INSTALL_PREFIX has no effect.

[  6%] Performing install step for 'glfw_p'
[100%] Built target glfw
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/GLFW
CMake Error at cmake_install.cmake:31 (file):
  file INSTALL cannot make directory "/usr/local/include/GLFW": No such file
  or directory

eigen 3.2.4 has memory issue on MSVC 2015

I've encountered a crash when I call slice() function of libigl in debug mode.
The problem seems due to the Eigen 3.2.4 ("libigl\external\nanogui\ext\eigen") under MSVC 2015.
The latest Eigen does not have such problem. Maybe you guys could update Eigen too.

[Suggestion] Add documentation to the project

Nanogui seems like a great GUI library for cross platform development. Unfortunately the lack of documentation creates a barrier to entry to developers such as myself. I would love to avoid using a monolithic GUI library like Qt. What can we do to add some documentation? I realize there's already an open suggestion to add instructions to using this library in other code but I think this suggestion would address even more future issues.

Crash when clicking on numeric field.

Clicking inside any editable numeric field crashes the program with:

Caught exception in event handler: regex_error

Using Ubuntu 14.04 / Nvidia card / OpenGL 3.3

Compilation error in visual studio 2015

Heres my output from compiler..

1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1> Checking Build System
1> CMake does not need to re-run because D:/projects/C++/naogui/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: bin2c, Configuration: Debug Win32 ------
3>------ Rebuild All started: Project: glew_p, Configuration: Debug Win32 ------
2> Building Custom Rule D:/projects/C++/naogui/nanogui/CMakeLists.txt
2> CMake does not need to re-run because D:\projects\C++\naogui\CMakeFiles\generate.stamp is up-to-date.
2> bin2c.c
2>D:\projects\C++\naogui\nanogui\resources\bin2c.c(33): warning C4018: '<': signed/unsigned mismatch
2>D:\projects\C++\naogui\nanogui\resources\bin2c.c(34): warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. See online help for details.
2> C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt\string.h(552): note: see declaration of 'strdup'
3> Building Custom Rule D:/projects/C++/naogui/nanogui/CMakeLists.txt
3> CMake does not need to re-run because D:\projects\C++\naogui\CMakeFiles\generate.stamp is up-to-date.
3> Creating directories for 'glew_p'
3> Performing download step (DIR copy) for 'glew_p'
3> No update step for 'glew_p'
3> No patch step for 'glew_p'
3> Performing configure step for 'glew_p'
3> -- Configuring done
3> -- Generating done
3> -- Build files have been written to: D:/projects/C++/naogui/ext_build/src/glew_p-build
3> Performing build step for 'glew_p'
3> Microsoft (R) Build Engine version 14.0.23107.0
3> Copyright (C) Microsoft Corporation. All rights reserved.
3>
3> Build started 9/26/2015 10:35:49 PM.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" on node 1 (default targets).
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (1) is building "D:\projects\C++\naogui\ext_build\src\glew_p-build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
3> InitializeBuildStatus:
3> Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> FinalizeBuildStatus:
3> Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
3> Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ZERO_CHECK.vcxproj" (default targets).
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (1) is building "D:\projects\C++\naogui\ext_build\src\glew_p-build\glew.vcxproj" (3) on node 1 (default targets).
3> InitializeBuildStatus:
3> Creating "glew.dir\Debug\glew.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> ClCompile:
3> D:\PROGRAMS\Visual Studio\VC\bin\CL.exe /c /ID:\projects\C++\naogui\ext_build\src\glew_p\include /I"C:\Program Files (x86)\Visual Leak Detector\include" /Zi /nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D GLEW_BUILD /D GLEW_NO_GLU /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"glew.dir\Debug" /Fd"glew.dir\Debug\glew.pdb" /Gd /TC /analyze- /errorReport:queue D:\projects\C++\naogui\ext_build\src\glew_p\src\glew.c
3> glew.c
2> bin2c.vcxproj -> D:\projects\C++\naogui\Debug\bin2c.exe
4>------ Rebuild All started: Project: glfw_p, Configuration: Debug Win32 ------
4> Building Custom Rule D:/projects/C++/naogui/nanogui/CMakeLists.txt
4> CMake does not need to re-run because D:\projects\C++\naogui\CMakeFiles\generate.stamp is up-to-date.
4> Creating directories for 'glfw_p'
4> Performing download step (DIR copy) for 'glfw_p'
4> No update step for 'glfw_p'
4> No patch step for 'glfw_p'
4> Performing configure step for 'glfw_p'
4>CUSTOMBUILD : CMake error : The source directory "D:/projects/C++/naogui/ext_build/src/glfw_p" does not appear to contain CMakeLists.txt.
4> Specify --help for usage, or press the help button on the CMake GUI.
3> Lib:
3> D:\PROGRAMS\Visual Studio\VC\bin\Lib.exe /OUT:"D:\projects\C++\naogui\ext_build\src\glew_p-build\Debug\glew.lib" /LIBPATH:"C:\Program Files (x86)\Visual Leak Detector\lib\Win32" /NOLOGO glew.dir\Debug\glew.obj
3> glew.vcxproj -> D:\projects\C++\naogui\ext_build\src\glew_p-build\Debug\glew.lib
3> CopyFilesToOutputDirectory:
3> Copying file from "glew.dir\Debug\glew.pdb" to "D:\projects\C++\naogui\ext_build\src\glew_p-build\Debug\glew.pdb".
3> FinalizeBuildStatus:
3> Deleting file "glew.dir\Debug\glew.tlog\unsuccessfulbuild".
3> Touching "glew.dir\Debug\glew.tlog\glew.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\glew.vcxproj" (default targets).
3> InitializeBuildStatus:
3> Creating "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> FinalizeBuildStatus:
3> Deleting file "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
3> Touching "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (default targets).
3>
3> Build succeeded.
3> 0 Warning(s)
3> 0 Error(s)
3>
3> Time Elapsed 00:00:04.20
3> Performing install step for 'glew_p'
3> Microsoft (R) Build Engine version 14.0.23107.0
3> Copyright (C) Microsoft Corporation. All rights reserved.
3>
3> Build started 9/26/2015 10:35:53 PM.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj" on node 1 (default targets).
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj" (1) is building "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (2) on node 1 (default targets).
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (2) is building "D:\projects\C++\naogui\ext_build\src\glew_p-build\ZERO_CHECK.vcxproj" (3) on node 1 (default targets).
3> InitializeBuildStatus:
3> Creating "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> FinalizeBuildStatus:
3> Deleting file "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
3> Touching "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ZERO_CHECK.vcxproj" (default targets).
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (68,11)" does not exist in the project, and will be ignored.
3> The target "_GeneratePrisForPortableLibraries" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.Net.CoreRuntime.targets (177,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (126,11)" does not exist in the project, and will be ignored.
3> The target "AfterGenerateAppxManifest" listed in an AfterTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft.NetNative\Microsoft.NetNative.targets (174,11)" does not exist in the project, and will be ignored.
3> The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (149,61)" does not exist in the project, and will be ignored.
3> Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (2) is building "D:\projects\C++\naogui\ext_build\src\glew_p-build\glew.vcxproj" (4) on node 1 (default targets).
3> InitializeBuildStatus:
3> Creating "glew.dir\Debug\glew.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> ClCompile:
3> All outputs are up-to-date.
3> Lib:
3> All outputs are up-to-date.
3> glew.vcxproj -> D:\projects\C++\naogui\ext_build\src\glew_p-build\Debug\glew.lib
3> FinalizeBuildStatus:
3> Deleting file "glew.dir\Debug\glew.tlog\unsuccessfulbuild".
3> Touching "glew.dir\Debug\glew.tlog\glew.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\glew.vcxproj" (default targets).
3> InitializeBuildStatus:
3> Creating "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> CustomBuild:
3> All outputs are up-to-date.
3> FinalizeBuildStatus:
3> Deleting file "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
3> Touching "Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\ALL_BUILD.vcxproj" (default targets).
3> InitializeBuildStatus:
3> Creating "Win32\Debug\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
3> PostBuildEvent:
3> setlocal
3> "c:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake
3> if %errorlevel% neq 0 goto :cmEnd
3> :cmEnd
3> endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
3> :cmErrorLevel
3> exit /b %1
3> :cmDone
3> if %errorlevel% neq 0 goto :VCEnd
3> :VCEnd
3> -- Install configuration: "Debug"
3> -- Installing: C:/Program Files (x86)/GLEW/lib/glew.lib
3> CMake Error at cmake_install.cmake:32 (file):
3> file INSTALL cannot copy file
3> "D:/projects/C++/naogui/ext_build/src/glew_p-build/Debug/glew.lib" to
3> "C:/Program Files (x86)/GLEW/lib/glew.lib".
3>
3>
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "setlocal [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: "c:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1 [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 1. [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3> Done Building Project "D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj" (default targets) -- FAILED.
3>
3> Build FAILED.
3>
3> "D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj" (default target) (1) ->
3> (PostBuildEvent target) ->
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: The command "setlocal [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: "c:\Program Files (x86)\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmErrorLevel [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: exit /b %1 [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :cmDone [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(133,5): error MSB3073: :VCEnd" exited with code 1. [D:\projects\C++\naogui\ext_build\src\glew_p-build\install.vcxproj]
3>
3> 0 Warning(s)
3> 1 Error(s)
3>
3> Time Elapsed 00:00:00.96
5>------ Rebuild All started: Project: nanogui, Configuration: Debug Win32 ------
5> Building Custom Rule D:/projects/C++/naogui/nanogui/CMakeLists.txt
5> CMake does not need to re-run because D:\projects\C++\naogui\CMakeFiles\generate.stamp is up-to-date.
5> Running bin2c
5> nanovg.c
5>d:\projects\c++\naogui\nanogui\ext\nanovg\src\stb_image.h(191): warning C4005: '_CRT_SECURE_NO_WARNINGS': macro redefinition
5> d:\projects\c++\naogui\nanogui\ext\nanovg\src\stb_image.h(191): note: command-line arguments: see previous definition of '_CRT_SECURE_NO_WARNINGS'
5> resources.cpp
5> glutil.cpp
5> nanogui.cpp
5> widget.cpp
5> theme.cpp
5> layout.cpp
5> screen.cpp
5>D:\projects\C++\naogui\nanogui\src\screen.cpp(221): warning C4316: 'nanogui::Theme': object allocated on the heap may not be aligned 16
5> label.cpp
5> window.cpp
5> popup.cpp
5> checkbox.cpp
5> button.cpp
5> popupbutton.cpp
5> combobox.cpp
5>D:\projects\C++\naogui\nanogui\src\combobox.cpp(11): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5>D:\projects\C++\naogui\nanogui\src\combobox.cpp(31): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5> progressbar.cpp
5> slider.cpp
5> messagedialog.cpp
5>D:\projects\C++\naogui\nanogui\src\messagedialog.cpp(24): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
5>D:\projects\C++\naogui\nanogui\src\messagedialog.cpp(26): warning C4316: 'nanogui::Label': object allocated on the heap may not be aligned 16
5>D:\projects\C++\naogui\nanogui\src\messagedialog.cpp(32): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5>D:\projects\C++\naogui\nanogui\src\messagedialog.cpp(35): warning C4316: 'nanogui::Button': object allocated on the heap may not be aligned 16
5> textbox.cpp
5> imagepanel.cpp
5> imageview.cpp
5> Generating Code...
5> Compiling...
5> vscrollpanel.cpp
5> colorwheel.cpp
5>D:\projects\C++\naogui\nanogui\src\colorwheel.cpp(178): warning C4800: 'nanogui::ColorWheel::Region': forcing value to bool 'true' or 'false' (performance warning)
5> graph.cpp
5>D:\projects\C++\naogui\nanogui\src\graph.cpp(31): warning C4018: '<': signed/unsigned mismatch
5> Generating Code...
5> nanogui.vcxproj -> D:\projects\C++\naogui\Debug\nanogui.lib
========== Rebuild All: 3 succeeded, 2 failed, 0 skipped ==========

glew shared library

i don't use glew shared library. i removed glew.c from project
i added glew32.lib to additional dependencies. i used GLEW_BUILD preprocessor definitions. but i still get errors. (LNK2019: unresolved external symbol __glewBindBuffer referenced in function) bla bla..

How can I create a Checkbox in libigl?

Hi! I want to add a Checkbox to my viewer in libigl. However, I can only add variable, button, variable, widget and window by viewer.ngui default member functions. After referring to example2 in Nanogui, I add the following code but failed.

CheckBox *cb = new CheckBox(viewer.ngui->window(), "Flag 1",
    [](bool state) { cout << "Check box 1 state: " << state << endl; }
);
cb->setChecked(true);

Can anyone help me on solving this problem and add a customized Checkbox? Thanks in advance.

No input of floats, doubles and ints possible.

Hello,
the adding of variables that are not boolean seems to be broken. This can even be observed in the provided examples:
You can comile the examples (via cmake) and run them, but as soon as you click into the value field (eg. of "Floating point") the program crashes with "Caught exception in event handler: regex_error".

Incompatible function arguments on user-defined Screen

I'm trying to create my own screen class and expose it to Python:

struct TestScreen: ng::Screen
{
    void setCallback(const std::function<void()>& c)        {}
};

...

    py::class_<TestScreen>(m, "TestScreen", screen)
      .def(py::init<>())
      .def("setCallback", &TestScreen::setCallback);

This works fine, but when I try to setCallback from Python:

def show():
    print "selected"

s = mymod.TestScreen()
s.setCallback(show)

I get:

Traceback (most recent call last):
  File "test.py", line 28, in <module>
    s.setCallback(show)
TypeError: Incompatible function arguments. The following argument types are supported:
    1. (mymod.TestScreen, std::__1::function<void ()>) -> NoneType

What am I doing wrong?

compile log

Thanks, compiling always raise me headache, but it was all smooth.

I will write my process here for log.

Debian 8 (jessie)

apt-get install cmake

# the I run cmake CMakeLists.txt
# error encountered: The RandR library and headers were not found
apt-get install xorg-dev libglu1-mesa-dev

# re run cmake CMakeLists.txt
# error encountered: Could NOT find PythonLibs
apt-get install python-dev

cmake CMakeLists.txt

make

Then, run 2 example files which works great.

Thank you for this great GUI.

Very difficult to choose exactly white color

The color picker is a cool UI. I find that it's difficult to choose exact colors at the corner of the triangle. If I click in the triangle, mouse dragging only changes the selection if the mouse cursor stays inside the triangle. Therefore I can't just drag in the extreme direction to pull the selection to the far corner of the triangle (e.g. to select exactly white).
nanovg-color-picker-fitts-law
So, perhaps this is a feature request to capture the mouse dragging on the color picker triangle even if the cursor strays outside the triangle, and then map the cursor point to the closest point on the triangle for selection.

(accidentally posted originally to nanovg memononen/nanovg#243)

Performance

Do you envision using some form of bitmap caching to enhance the global perfromance, or maybe tessalation caching like in the following nanovg fork:

https://github.com/ytsedan/nanovg

I think it would help a lot

thanks

Remove dependencies?

Hi, is there any reason this packs and builds against its own fork of (at least) glew and glfw? This is very common with ui toolkits (dearimgui notable exception), but it makes it near impossible to use them with any pre-existing app/renderer/engine/etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.