Giter VIP home page Giter VIP logo

realtime-lab's People

Contributors

liubai01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jack12xl

realtime-lab's Issues

[UI] Add a logger

This is a feature request for a basic logger.

Background

  • The framework of the code is in CoreLoggerWidget.cpp
  • The GUI of the editor is based on Dear ImGui.
  • Logger bases on spdlog.
  • Logger helps users debug. The output of other components/widgets should be in the logger.

Goal

image

References and guidance

Show the widget

To show the CoreLoggerWidget.cpp widget, toggle Widget/Logger in menubar.

image

Quick-start

For example, add a line of ImGui::Text("Hello") in CoreLoggerWidget.cpp \ void CoreLoggerWidget::Update().

image

You could then see a line of text in that.

image

Use user-defined sink spdlog as backend

There is a simple example of using spdlog in Debugout.h.

ImGui Front-end example

Dear ImGUI demo shows an example of a log(imgui_demo.cpp/ShowExampleAppLog(...)).

You could uncomment ImGui::ShowDemoWindow(); to show example of widgets of dearImGui in CoreApp.cpp.

void CoreApp::BeforeUpdate()
{
    mGUIManager->Update();
    //ImGui::ShowDemoWindow();
}

A deeper introduction to constructing a widget could refer to this video (in Mandarin Chinese).

[UI] Add detail bar of selected asset.

This is a feature request for a detailed info bar of an asset.

Background

image

  • Asset explorer helps users organize resources in the filesystem.
  • Current implementation of asset icon in 4f19414 is in CoreAssetWidget.cpp.
  • The GUI of the editor is based on Dear ImGui.

Goal

  • Define a pointer of the selected asset.
  • When the user does a single mouse left click over an icon, the asset is selected (not opened.).
  • Show the asset's path(full name) in an info bar.

Example of unity:
image

References and guidance

For a quick start of getting handy on Dear imGUI, refer to imgui_demo.cpp.

A quick introduction to construct a widget could refer to this video (in Mandarin Chinese).

You could uncomment ImGui::ShowDemoWindow(); to show example of widgets of dearImGui in CoreApp.cpp

void CoreApp::BeforeUpdate()
{
    mGUIManager->Update();
    //ImGui::ShowDemoWindow();
}

For example, the logic of a folder.

...
} else if (assetNode->GetAssetType() == BaseAssetType::ASSET_FOLDER) {
				ImVec2 pos = ImGui::GetCursorPos();
				if (ImGui::Selectable(assetNode->mID.c_str(), false, ImGuiSelectableFlags_AllowDoubleClick, ImVec2(iconSize, iconSize)))
				{
					ImGuiIO& io = ImGui::GetIO();
					if (io.MouseDoubleClicked[0])
					{
						mNowSelectedAssetNodeDir = assetNode.get();
					}
				}

				// manually set a padding of 20.0 pixel (TBD: remove this magic number in the future)
				ImGui::SetCursorPos(ImVec2(pos.x + 20.0f, pos.y + 20.0f));
				BaseResourceImage* img = mResourceManager->LoadByURL<BaseResourceImage>("EditorAsset\\icon\\folder.png");
				ImGui::Image(img->GetImGuiRuntimeID(), ImVec2(iconSize - 40.0f, iconSize - 40.0f));

				ImGui::SetCursorPos(ImVec2(pos.x, pos.y + iconSize));
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.