wjakob / nanogui

Minimalistic GUI library for OpenGL
Other
4.64k stars 603 forks source link

Beginner tutorial for Visual Studio #405

Open AlexFundorin opened 5 years ago

AlexFundorin commented 5 years ago

I am currently writing a DLL for Cockos Reaper DAW and I want it to have a configuration GUI. Visual Studio, Win10. For now, I was able to build nanogui as a static library and link it to my project.

I'm trying to add "Example 2" code into my project just to test it out. The first error that I'm getting is related to Eigen. Obviously, I don't use that library in my project, yet it seems like nanogui depends on it.

I only copied nano-gui's "include" contents to my project and the compiled static library, though it seems like nanogui repo does contain "eigen", "nanovg" and other sources inside "ext" folder.

How do I properly add nanogui to my Visual Studio project, so it would be possible to call/create a GUI window with a hotkey, from within a DLL?

mbpictures commented 5 years ago

Hi!

I had the same issue and solved it:

  1. Convert your VS Project into CMake Project (i used a python script called "cmake-converter")
  2. Clone nanogui in subfolder of your choice in your project (e.g. ext/nanogui)
  3. Adjust the CMakeList.txt file like in the docs described
  4. Open the Project in VS as a Cmake-Project

Good luck!