Skip to content

m516/imgui-opengl-glfw-glew-cmake-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgui-opengl-glfw-cmake-demo

This is a demo project for ImGui with opegl, glfw3, glew and CMake.

This project generates a stand alone demo app. Currently it has been built only on Apple and Windows environments, and, due to the structure of the project, linux builds should theoretically take minimal effort.

mac-app.gif


A brief explanation of ImGui

It's easy to use simple GUI library for C++. It suits for 3D pipeline enabled application. The easiest way is just copy and add libraries in your project. That's all.

The next citations are from it's README.

dear imgui (AKA ImGui), is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).

ImGui is designed to enable fast iteration and empower programmers to create content creation tools and visualization/ debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and thus lacks certain features normally found in more high-level libraries.


How to build this project

Mac

Install libraries:

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Install homebrew
$ brew update
$ brew install cmake # Install CMake
$ brew install glfw # Install glfw3
$ brew install glew # Install glew

Build and generate a stand alone app:

$ cd /to/project/root/
$ mkdir build && cd build
$ cmake ..
$ make

Or you can build and run with CLion.

You'll find the app in the build directry.

Windows (Visual Studio)

1. Install Packages with vcpkg

A. Install GLFW

With command prompt or powershell, navigate to the folder where vcpkg is installed and execute the following commands to download the 64-bit and 32-bit versions of GLFW, respectively.

vcpkg install glfw3:x64-windows
vcpkg install glfw3:x86-windows
B. Install GLEW

Vcpkg can also install GLEW with the following commands

vcpkg install glew:x64-windows
vcpkg install glew:x86-windows
C. Verify (optional)

Check that the packages were installed with the command vcpkg list

At this point, running CMake on the root directory of this project should finish without errors.

2. Try it out!

Select imgui-demo.app.exe from the dropdown menu of startup items and press the big play button. A window should appear with fun knobby controls.

app-windows

Linux

Currently no instructions - Your contribution is welcomed.


References


Contributions

  • m516: Windows support and documentation

This project was originally a by-product of my learning of CMake and ImGui. Your comments and pull request are always welcomed.

About

Imgui w/ glfw + glew + cmake

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 81.4%
  • C 18.4%
  • CMake 0.2%