wjakob / nanogui Goto Github PK
View Code? Open in Web Editor NEWMinimalistic GUI library for OpenGL
License: Other
Minimalistic GUI library for OpenGL
License: Other
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
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
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
.
I was able to solve the issue about vscrollpanel
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.
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.
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 ==========
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?
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>'
Hi,
Recently, I am using libigl,which contains nanogui. But I met a error when I compile it. Detail can be seen in:
libigl/libigl#119 (comment)
Look forward to your help!
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?
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,
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
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".
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.
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)
it is light and nice framework , but when trying to embed it to another application which already init glfw3 , there is need to mix the hosting app code into Screen class ,
this is pain , design as i see it and know should be flexible to add the framework into other .
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).
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)
I'm using glScissor
to implement dirty rect draw, I found that nanovg disable GL_SCISSOR_TEST
first thing when rendering, I've comment that out, I wonder is there any side effects with this?
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?
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;
}
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..
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!
It would be great to have the ability to resize windows (by dragging a corner with a mouse, or something like that).
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.
Hello,
I increased mButtonCornerRadius (in theme) from 2 to 4 or 8
but it doesn't change the aspect of the buttons
std::map<GLFWwindow *, Screen *> __nanogui_screens;
Do you mean you may want to support multiple glfw windows?
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.
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();
}
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?
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.
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
Would you like to add more error handling for a call of a function like "popen"?
Hello wjakob,
What are the upcoming plans?
The lib looks promising :)
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 ==========
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 ?
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.
Here is the output of my cmake (just in case it could help).
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
What you this about subj?
It may be need to add event converter from glfw event to custom event, but will do code clear and more portable.
Thanks
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!
VS IDE defines both WIN32
and _WIN32
directives.
However, command-line compilers, like VS, clang, gcc or Mingw will only look for _WIN32
directive.
So underscore preffix is the correct way to detect Windows as it is the general rule for everybody.
This minor issue also happens in pybind11 :)
Extra null pointer checks are not needed in functions like the following.
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.
I would like to point out that identifiers like "__NANOGUI_CHECKBOX_H
" and "__NANOGUI_GRAPH_H
" do not fit to the expected naming convention of the C++ language standard.
Would you like to adjust your selection for unique names?
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.
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.
I would like to use this library to create some GUI apps on the Raspberry PI, but OpenGL3 is not supported.
Do you think it will be a lot of effort to try and rebuild using OpenGLES2?
Thanks
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.
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; });
});
Thanks, compiling always raise me headache, but it was all smooth.
I will write my process here for log.
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.
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.
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!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.