Skip to content

CleanImGuiWin.h provides integration of GLFW, GLEW, ImGui and custom procedures to create a clean independent GUI window quickly

Notifications You must be signed in to change notification settings

VarunKhambhata/Clean-Imgui-Window

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Clean-Imgui-Window

This header file works as an extension of ImGui namespace. It provides integration of GLFW, GLEW, ImGui and custom procedures to create a clean independent GUI window quickly.

To use this wrapper, GLFW, GLEW and ImGui must be setup first. After ImGui is functionally working with GLFW and GLEW, add CleanImGuiWin.h to the project files

Below is the sample code to create a clean window using this header file

#include<CleanImGuiWin.h>
int main()
{	
	GLFWwindow* window = ImGui::initGLFW();
	ImGui::initImGui(window, "Title");

        //Edit ImGui Theme
	ImGui::GetStyle().Colors[ImGuiCol_WindowBg].w = 1.0f;
	ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 15);

	while(!glfwWindowShouldClose(window))
	{
	   ImGui::StartCleanWindow(window);
	   // Add ImGui UI elemnts here--------------------
	   	ImGui::Text("Add ImGui UI elements here");
		ImGui::Button("Like This");
	   // ---------------------------------------------
	   ImGui::EndCleanWindow(window);
	}
  
	ImGui::terminateImGui();
	ImGui::terminateGLFW(window);
	return 0;
}

Result: image

This header file will add following functions to ImGui namespace:

GLFWwindow* initGLFW(int width, int height)
void initImGui(GLFWwindow* window, const char* Title)
void StartCleanWindow(GLFWwindow* window)
void EndCleanWindow(GLFWwindow* window)
void terminateImGui()
void terminateGLFW(GLFWwindow* window)




ImGui: https://github.com/ocornut/imgui

GLFW: https://www.glfw.org/

GLEW: http://glew.sourceforge.net/

About

CleanImGuiWin.h provides integration of GLFW, GLEW, ImGui and custom procedures to create a clean independent GUI window quickly

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages