01-07-2020, 12:32 PM
(This post was last modified: 01-08-2020, 08:14 AM by Brian Beuken.)
As Im now doing some work to select resolutions in game I am using Dear Imgui to do that so I'll document what you need to do
1st, create a small subfilter in your visual solution.
You will need the following files
imconfig.h
imgui.h
imgui_impli_opengl3.h
imgui_internal.h
and
imgui.cpp
imgui_draw.cpp
imgui_impl_opengl3.cpp
imgui_widgets.cpp
Those are the base files you can get from github, either include the whole of the master dir in your work dir, or just do as I did and copy the files
you need of course to undelete the #define IMGUI_IMPL_OPENGL_ES2 (or ES3 if you have it)
You should also add
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
in imconfig.h as indeed we will not be using glfw or sdl or anything else.
That will now allow you to build code with imgui in place, so now its time to use it
After you have done all your setups and initiaisations, of your OpenGL, you can then init img
use these 4 lines
// imgui setup
const char* glsl_version = "#version 100";
ImGui::CreateContext();
ImGui::StyleColorsDark();
ImGui_ImplOpenGL3_Init(glsl_version);
if using GLES3.0 then set version to 300 (not sure about this, you may need to have other things set up, leaving it at 100, works for both es2 and es3 labels)
you're pretty much ready to go, of course no rendering is happening yet, you've just compiled and initialised the system.
I'll detail getting it to work shortly as I need to make some small changes to the input system to allow me to transfer info.
1st, create a small subfilter in your visual solution.
You will need the following files
imconfig.h
imgui.h
imgui_impli_opengl3.h
imgui_internal.h
and
imgui.cpp
imgui_draw.cpp
imgui_impl_opengl3.cpp
imgui_widgets.cpp
Those are the base files you can get from github, either include the whole of the master dir in your work dir, or just do as I did and copy the files
you need of course to undelete the #define IMGUI_IMPL_OPENGL_ES2 (or ES3 if you have it)
You should also add
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
in imconfig.h as indeed we will not be using glfw or sdl or anything else.
That will now allow you to build code with imgui in place, so now its time to use it
After you have done all your setups and initiaisations, of your OpenGL, you can then init img
use these 4 lines
// imgui setup
const char* glsl_version = "#version 100";
ImGui::CreateContext();
ImGui::StyleColorsDark();
ImGui_ImplOpenGL3_Init(glsl_version);
if using GLES3.0 then set version to 300 (not sure about this, you may need to have other things set up, leaving it at 100, works for both es2 and es3 labels)
you're pretty much ready to go, of course no rendering is happening yet, you've just compiled and initialised the system.
I'll detail getting it to work shortly as I need to make some small changes to the input system to allow me to transfer info.
Brian Beuken
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's
Lecturer in Game Programming at Breda University of Applied Sciences.
Author of The Fundamentals of C/C++ Game Programming: Using Target-based Development on SBC's