Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dear Imgui
#3
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.
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 



Reply


Messages In This Thread
Dear Imgui - by Brian Beuken - 04-09-2019, 08:48 AM
RE: Dear Imgui - by Brian Beuken - 04-10-2019, 01:04 PM
RE: Dear Imgui - by Brian Beuken - 01-07-2020, 12:32 PM
RE: Dear Imgui - by Brian Beuken - 01-07-2020, 01:56 PM
RE: Dear Imgui - by Brian Beuken - 01-10-2020, 10:25 AM
RE: Dear Imgui - by jomoengineer - 01-19-2020, 05:05 AM
RE: Dear Imgui - by Brian Beuken - 02-02-2020, 12:29 AM
RE: Dear Imgui - by Brian Beuken - 11-28-2020, 06:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)