Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TKazer/OS-ImGui

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS-ImGui

A simple imgui library, develop based on Dear-ImGui.

Aim to make it easy for people to use imgui, which only takes few minutes.

Chinese -> README-ZH

Feature

  • Compatible for internal and external use, and easy to switch.

If you want to use internal mode, just need define "OSIMGUI_INTERNAL" in preprocessing.

  • Easy to use.

Only one line of code is needed to call.

  • MutipleDrawing

Example

void DrawCallBack()
{
	ImGui::Begin("Menu");
	{
		ImGui::Text("This is a text.");
		if (ImGui::Button("Quit"))
		{
			// Using Gui.Quit() to quit the exe or dll.
			Gui.Quit();
			//...
		}
	}ImGui::End();
}
  1. External Mode
int main()
{
	try {
		/*
		   New a window for using.
		*/
		Gui.NewWindow("WindowName", Vec2(500, 500), DrawCallBack);
		/*
		   Attach to another window by window's name or classname.
		*/
		Gui.AttachAnotherWindow("Title","", DrawCallBack);
	}
	catch (OSImGui::OSException& e)
	{
		std::cout << e.what() << std::endl;
	}

	system("pause");
	return 0;
}
  1. Internal Mode
// Define "OSIMGUI_INTERNAL" in preprocessing before use.

BOOL APIENTRY DllMain(HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
	if (ul_reason_for_call == DLL_PROCESS_ATTACH)
	{
		// Entry
		// Detect directX type automatically.
		Gui.Start(hModule, DrawCallBack, OSImGui::DirectXType::AUTO);
	}
	return TRUE;
}

About

A simple imgui library for easy use.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.