Add XCUI new editor sandbox phase 1
This commit is contained in:
35
new_editor/src/XCUIBackend/ImGuiTextAtlasProvider.h
Normal file
35
new_editor/src/XCUIBackend/ImGuiTextAtlasProvider.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "IXCUITextAtlasProvider.h"
|
||||
|
||||
struct ImGuiContext;
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Editor {
|
||||
namespace XCUIBackend {
|
||||
|
||||
class ImGuiTextAtlasProvider final : public IXCUITextAtlasProvider {
|
||||
public:
|
||||
ImGuiTextAtlasProvider() = default;
|
||||
explicit ImGuiTextAtlasProvider(::ImGuiContext* context);
|
||||
|
||||
void SetContext(::ImGuiContext* context);
|
||||
::ImGuiContext* GetContext() const;
|
||||
|
||||
bool GetAtlasTextureView(PixelFormat preferredFormat, AtlasTextureView& outView) const override;
|
||||
std::size_t GetFontCount() const override;
|
||||
FontHandle GetFont(std::size_t index) const override;
|
||||
FontHandle GetDefaultFont() const override;
|
||||
bool GetFontInfo(FontHandle font, FontInfo& outInfo) const override;
|
||||
bool GetBakedFontInfo(FontHandle font, float fontSize, BakedFontInfo& outInfo) const override;
|
||||
bool FindGlyph(FontHandle font, float fontSize, std::uint32_t codepoint, GlyphInfo& outInfo) const override;
|
||||
|
||||
private:
|
||||
::ImGuiContext* ResolveContext() const;
|
||||
|
||||
::ImGuiContext* m_context = nullptr;
|
||||
};
|
||||
|
||||
} // namespace XCUIBackend
|
||||
} // namespace Editor
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user