rename graphic into Gui

This commit is contained in:
sillysagiri 2024-11-06 16:44:24 +07:00
parent 7a9ef864a6
commit 80015a530e
2 changed files with 7 additions and 15 deletions

View File

@ -144,15 +144,17 @@ namespace panda
// ############################################################################################
// # Graphic
// ### GUI
#ifdef PANDA_INCLUDE_IMGUI
void GuiInit();
void GuiDestroy();
void GuiBegin();
void GuiEnd();
void GuiThemeSetup();
#endif
// ### atlas
bool LoadTextureAtlas(const char *image_path, const char *ini_path, std::string AtlasKey);
bool UnloadTextureAtlas(std::string AtlasKey);

View File

@ -2,9 +2,10 @@
#include <rlImGui.h>
#include <rlgl.h>
#include <stdbool.h>
#include <raylib.h>
#ifdef PANDA_INCLUDE_IMGUI
#include "Panda.hpp"
#include <raylib.h>
#if PLATFORM_ANDROID
@ -143,19 +144,8 @@ void panda::GuiThemeSetup()
style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
}
#endif
void panda::DrawRenderTexture(const RenderTexture &buffer, const float &x, const float &y, const Color &color)
{
DrawTextureRec(
buffer.texture,
{0.0f, 0.0f, 1.0f*buffer.texture.width, -1.0f*buffer.texture.height},
{x, y}, color);
}
Rectangle panda::GetTextureRect(const Texture &tex, bool flipX, bool flipY)
{
return { 0.0f, 0.0f, (flipX ? -tex.width : tex.width)*1.0f, (flipY ? -tex.height : tex.height)*1.0f };
}
/////////////////////////////////