improved font rendering

This commit is contained in:
2026-05-26 01:29:26 +03:00
parent f127ac3801
commit 5fdb17b773
21 changed files with 217 additions and 158 deletions

View File

@@ -38,8 +38,6 @@ IEngineBridge *EngineBridge()
EXPOSE_INTERFACE_FN(EngineBridge, IEngineBridge, ENGINE_BRIDGE_INTERFACE_VERSION)
static IKotUIBuffer *s_pUIBuffer;
void CFunnyGameBridge::Init()
{
Console()->AddCommand("exec game/core/default.cfg\n");
@@ -77,16 +75,6 @@ void CFunnyGameBridge::Init()
g_pKotUI->ConnectInterface(g_pRenderContext, RENDER_CONTEXT_INTERFACE_VERSION);
g_pKotUI->Init();
IKotRenderFont *pFont = g_pKotUI->LoadFont("game/core/fonts/IBMPlexMono-Regular");
s_pUIBuffer = g_pKotUI->CreateBuffer(40, 30);
s_pUIBuffer->SetTextFont(pFont);
s_pUIBuffer->SetTextSize(, int iX)
s_pUIBuffer->Move(0, 0);
s_pUIBuffer->Printf("hello %f", 20.0);
s_pUIBuffer->Move(1, 0);
s_pUIBuffer->Printf("hello %f", 40.0);
s_pUIBuffer->Move(2, 0);
s_pUIBuffer->Printf("hello %f", 40.0);
}
void CFunnyGameBridge::Tick( float fDelta )
@@ -183,7 +171,6 @@ void CFunnyGameBridge::Frame( float fDelta )
EntitySystem()->NetSendThink(pCurrentServer);
}
g_pWorldRenderer->Frame(fDelta);
s_pUIBuffer->Draw(g_pMainWindow->GetOutputImage());
}
void CFunnyGameBridge::Shutdown()

View File

@@ -1,90 +0,0 @@
#include "mainmenu.h"
#include "fgui/label.h"
#include "fgui/rect.h"
#include "fgui/widget.h"
#include "tier1/interface.h"
class CMOBAMainMenuGUI: public CFGUI_Widget
{
public:
CMOBAMainMenuGUI();
virtual void Event( FGUI_Event_t event ) override;
virtual void Draw() override;
virtual void Frame() override;
private:
CFGUI_Rect *m_pBackground;
CFGUI_Label *m_pGameName;
};
CMOBAMainMenuGUI::CMOBAMainMenuGUI()
{
SetPosition(0, 0);
m_pBackground = new CFGUI_Rect;
m_pBackground->SetParent(this);
m_pBackground->SetPosition(90,90);
m_pBackground->SetSize(300, 400);
m_pBackground->SetBoxColor(0.1, 0.1, 0.1, 1);
m_pGameName = new CFGUI_Label;
m_pGameName->SetParent(this);
m_pGameName->SetFont("fonts/IBMPlexMono-Regular");
m_pGameName->SetLabel("funnygame");
m_pGameName->SetGlyphSize(24);
m_pGameName->SetPosition(100, 100);
};
void CMOBAMainMenuGUI::Event( FGUI_Event_t event )
{
}
void CMOBAMainMenuGUI::Draw()
{
}
void CMOBAMainMenuGUI::Frame()
{
}
class CMOBAMainMenu: public IMainMenu
{
public:
virtual void Init() override;
virtual void Frame() override;
virtual void Deinit() override;
virtual void SetVisibility( bool bIsVisible ) override;
private:
CMOBAMainMenuGUI *m_pMainMenu;
};
void CMOBAMainMenu::Init()
{
m_pMainMenu = new CMOBAMainMenuGUI;
m_pMainMenu->SetVisibility(true);
}
void CMOBAMainMenu::Frame()
{
}
void CMOBAMainMenu::SetVisibility( bool bIsVisible )
{
m_pMainMenu->SetVisibility(bIsVisible);
}
void CMOBAMainMenu::Deinit()
{
}
DECLARE_ENGINE_INTERFACE(MainMenu, CMOBAMainMenu);

View File

@@ -32,7 +32,7 @@ void C_MOBAPlayer::Think( float fDelta )
g_pWorldRenderer->SetCameraPosition(vCameraPos);
Quat vCameraRot;
glm_euler_yxz_quat((vec3){m_fPitch, m_fYaw, 0}, *(versor*)&vCameraRot);
//g_pWorldRenderer->SetCameraRotation(vCameraRot);
g_pWorldRenderer->SetCameraRotation(vCameraRot);
}
BaseClass::Think(fDelta);
};

View File

View File

View File

View File