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

View File

View File

View File

@@ -5,15 +5,19 @@
#include "../materialsystem/igamewindow.h"
#include "tier2/iappsystem.h"
abstract_class IRenderFont
abstract_class IKotRenderFont
{
public:
virtual IImage *GetAtlas();
virtual bool IsLetterPresent( uint32_t letter );
virtual float GetLetterX( uint32_t letter );
virtual float GetLetterY( uint32_t letter );
virtual float GetWidthX( uint32_t letter );
virtual float GetWidthY( uint32_t letter );
virtual IImage *GetAtlas() = 0;
virtual bool IsLetterPresent( uint32_t letter ) = 0;
virtual float GetLetterX( uint32_t letter ) = 0;
virtual float GetLetterY( uint32_t letter ) = 0;
virtual float GetWidth( uint32_t letter ) = 0;
virtual float GetHeight( uint32_t letter ) = 0;
virtual bool IsMono() = 0;
virtual uint32_t GetLetterWidth() = 0;
virtual uint32_t GetLetterHeight() = 0;
};
abstract_class IKotUIBuffer
@@ -29,18 +33,21 @@ public:
virtual void PutChar( char c ) = 0;
virtual void Printf(const char *szFormat, ...) = 0;
virtual void Draw( IRenderContext *pRenderContext );
virtual void Draw( IImage *pImage ) = 0;
virtual void SetTextSize( int iY, int iX ) = 0;
virtual void SetTextFont( IRenderFont *pFont ) = 0;
virtual void SetTextFont( IKotRenderFont *pFont ) = 0;
};
abstract_class IKotUIManager: public IAppSystem
abstract_class IKotUIManager: public IAppSystem2
{
public:
virtual void CreateBuffer( int iWidth, int iHeight ) = 0;
virtual IKotRenderFont *LoadFont( const char *szPath ) = 0;
virtual IKotUIBuffer *CreateBuffer( int iWidth, int iHeight ) = 0;
virtual void DeleteBuffer( IKotUIBuffer *pBuffer ) = 0;
};
IKotUIManager *KotUIManager();
#define KOT_UI_INTEFACE_VERSION "KotUI001"

View File

@@ -166,12 +166,18 @@ public:
virtual EMultisampleType GetMultisampleType() = 0;
};
abstract_class ISampler : public IRenderingObject
{
};
abstract_class ITextureArray: public IRenderingObject
{
public:
virtual void Build() = 0;
virtual uint32_t LoadTexture( const char *szPath ) = 0;
virtual uint32_t GetTextureID( const char *szPath ) = 0;
virtual IImage *GetTexture( uint32_t uTextureID ) = 0;
virtual void UnloadTexture( uint32_t uTextureID ) = 0;
};
@@ -250,6 +256,8 @@ public:
virtual void VSSetConstantsBuffer( uint32_t uRegister, IBuffer *pImage ) = 0;
virtual void PSSetConstantsBuffer( uint32_t uRegister, IBuffer *pImage ) = 0;
virtual void PSSetTextureArray( uint32_t uSet, ITextureArray *pArray ) = 0;
virtual void PSSetTexture( uint32_t uRegister, IImage *pImage ) = 0;
virtual void PSSetSampler( uint32_t uRegister, ISampler *pImage ) = 0;
};
abstract_class IRenderCommandList
@@ -259,6 +267,7 @@ public:
virtual void SetRenderTarget( uint32_t uIndex, IImage *pImage ) = 0;
virtual void SetClearColor( uint32_t uIndex, float r, float g, float b, float a ) = 0;
virtual void SetLoadStoreModes( uint32_t uIndex, ELoadMode eLoadMode, EStoreMode eStoreMode ) = 0;
virtual void SetDepthTarget( IImage *pDepth ) = 0;
virtual void SetClearDepth( float fVal ) = 0;
@@ -321,6 +330,8 @@ public:
virtual ITextureArray *CreateTextureArray() = 0;
virtual void DestroyTextureArray() = 0;
virtual ISampler *GetDefaultSampler() = 0;
};
#define RENDER_CONTEXT_INTERFACE_VERSION "RenderContext001"

View File