added font rendering

This commit is contained in:
2026-05-25 01:35:19 +03:00
parent a9766d6dd6
commit f127ac3801
27 changed files with 657 additions and 43 deletions

View File

@@ -38,6 +38,7 @@ IEngineBridge *EngineBridge()
EXPOSE_INTERFACE_FN(EngineBridge, IEngineBridge, ENGINE_BRIDGE_INTERFACE_VERSION)
static IKotUIBuffer *s_pUIBuffer;
void CFunnyGameBridge::Init()
{
@@ -70,6 +71,22 @@ void CFunnyGameBridge::Init()
g_pPhysicsWorld = g_pPhysics->CreateWorld();
g_pHumanDeviceManager->SetDefaultInput(g_pMainInput);
CreateInterfaceFn fnEngineFactory = Sys_GetFactory("engine");
g_pKotUI = (IKotUIManager*)fnEngineFactory(KOT_UI_INTEFACE_VERSION, NULL);
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 )
@@ -166,6 +183,7 @@ void CFunnyGameBridge::Frame( float fDelta )
EntitySystem()->NetSendThink(pCurrentServer);
}
g_pWorldRenderer->Frame(fDelta);
s_pUIBuffer->Draw(g_pMainWindow->GetOutputImage());
}
void CFunnyGameBridge::Shutdown()