added font rendering
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#define MAX_SHADER_COUNT 1024
|
||||
|
||||
#define MAX_PHYSICS_COUNT 1024
|
||||
#define MAX_FONT_COUNT 128
|
||||
|
||||
template<typename T, uint32_t nCount>
|
||||
class CAssetArc
|
||||
|
||||
@@ -240,14 +240,10 @@ void CEntitySystem::NetRecvPacket( NetPacket_t *pPacket )
|
||||
}
|
||||
break;
|
||||
case k_EMessage_EntityDeleted:
|
||||
C_BaseEntity **ppEntities = m_pEntities;
|
||||
for ( int i = 0; i < MAX_EDICTS; i++ )
|
||||
{
|
||||
if (ppEntities[i] == NULL)
|
||||
{
|
||||
|
||||
}
|
||||
{
|
||||
DestroyEntityByIndex((uint32_t)pPlayerPacket->m_deleteEntity.m_uIndex);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
@@ -298,7 +298,12 @@ void CFunnyWorldRenderer::Frame( float fDelta )
|
||||
m_pRasterCommandList->SetViewport(0, 0, uWidth, uHeight, 0, 1);
|
||||
m_pRasterCommandList->SetScissors(0, 0, uWidth, uHeight);
|
||||
m_pRasterCommandList->SetClearColor(0, 0, 0, 0, 0);
|
||||
m_pRasterCommandList->SetClearColor(1, 0, 0, 0, 0);
|
||||
m_pRasterCommandList->SetClearColor(2, 0, 0, 0, 0);
|
||||
m_pRasterCommandList->SetClearDepth(1);
|
||||
m_pRasterCommandList->SetLoadStoreModes(0, LOAD_MODE_CLEAR, STORE_MODE_STORE);
|
||||
m_pRasterCommandList->SetLoadStoreModes(1, LOAD_MODE_CLEAR, STORE_MODE_STORE);
|
||||
m_pRasterCommandList->SetLoadStoreModes(2, LOAD_MODE_CLEAR, STORE_MODE_STORE);
|
||||
uint32_t uTotalMeshes = 0;
|
||||
uint32_t u = 0;
|
||||
for ( auto mesh: m_pMeshes)
|
||||
|
||||
@@ -40,6 +40,8 @@ extern EngineConsts_t *g_pEngineConstants;
|
||||
extern IPhysics *g_pPhysics;
|
||||
extern IPhysicsWorld *g_pPhysicsWorld;
|
||||
|
||||
extern IKotUIManager *g_pKotUI;
|
||||
|
||||
#define FUNNY_SECURE_PORT 27015
|
||||
#define FUNNY_QUERY_PORT 27016
|
||||
|
||||
|
||||
Reference in New Issue
Block a user