diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2011-12-31 09:40:11 +0100 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2011-12-31 09:40:11 +0100 |
| commit | 8a91bfa1ddff0c99d65375b8b5c57e710169543a (patch) | |
| tree | c3a5806cc3b5caf1da378f08533956f53f29b686 /src/engine/client/graphics_threaded.h | |
| parent | 50e75da3334e77d027d5b10d85d4022c5dca0821 (diff) | |
| download | zcatch-8a91bfa1ddff0c99d65375b8b5c57e710169543a.tar.gz zcatch-8a91bfa1ddff0c99d65375b8b5c57e710169543a.zip | |
fixed texture upload support. removed raw gl calls from the text render
Diffstat (limited to 'src/engine/client/graphics_threaded.h')
| -rw-r--r-- | src/engine/client/graphics_threaded.h | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/engine/client/graphics_threaded.h b/src/engine/client/graphics_threaded.h index 876e9410..1ec8c61c 100644 --- a/src/engine/client/graphics_threaded.h +++ b/src/engine/client/graphics_threaded.h @@ -49,6 +49,11 @@ class CCommandBuffer public: enum { + MAX_TEXTURES=1024*4, + }; + + enum + { // CMD_NOP = 0, @@ -65,6 +70,7 @@ public: // texture commands CMD_TEXTURE_CREATE, CMD_TEXTURE_DESTROY, + CMD_TEXTURE_UPDATE, // rendering CMD_CLEAR, @@ -76,6 +82,14 @@ public: enum { + TEXFORMAT_INVALID = 0, + TEXFORMAT_RGB, + TEXFORMAT_RGBA, + TEXFORMAT_ALPHA, + }; + + enum + { // PRIMTYPE_INVALID = 0, PRIMTYPE_LINES, @@ -155,6 +169,44 @@ public: { SCommand_Swap() : SCommand(CMD_SWAP) {} }; + + struct SCommand_Texture_Create : public SCommand + { + SCommand_Texture_Create() : SCommand(CMD_TEXTURE_CREATE) {} + + // texture information + int m_Slot; + + int m_Width; + int m_Height; + int m_Format; + int m_StoreFormat; + void *m_pData; // will be freed by the command processor + }; + + struct SCommand_Texture_Update : public SCommand + { + SCommand_Texture_Update() : SCommand(CMD_TEXTURE_UPDATE) {} + + // texture information + int m_Slot; + + int m_X; + int m_Y; + int m_Width; + int m_Height; + int m_Format; + void *m_pData; // will be freed by the command processor + }; + + + struct SCommand_Texture_Destroy : public SCommand + { + SCommand_Texture_Destroy() : SCommand(CMD_TEXTURE_DESTROY) {} + + // texture information + int m_Slot; + }; // CCommandBuffer(unsigned CmdBufferSize, unsigned DataBufferSize) @@ -261,7 +313,7 @@ class CGraphics_Threaded : public IEngineGraphics struct CTexture { - GLuint m_Tex; + int m_State; int m_MemSize; int m_Flags; int m_Next; @@ -298,6 +350,7 @@ public: virtual int UnloadTexture(int Index); virtual int LoadTextureRaw(int Width, int Height, int Format, const void *pData, int StoreFormat, int Flags); + virtual int LoadTextureRawSub(int TextureID, int x, int y, int Width, int Height, int Format, const void *pData); // simple uncompressed RGBA loaders virtual int LoadTexture(const char *pFilename, int StorageType, int StoreFormat, int Flags); |