2 Copyright (C) 2002 Rice1964
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef _TEXTURE_BUFFER_H_
21 #define _TEXTURE_BUFFER_H_
24 #include "TextureManager.h"
28 CRenderTexture *pRenderTexture;
40 uint32 updateAtUcodeCount;
46 uint32 crcCheckedAtFrame;
48 TxtrCacheEntry txtEntry;
55 friend class CGraphicsContext;
56 friend class CDXGraphicsContext;
57 friend class FrameBufferManager;
58 friend class DXFrameBufferManager;
59 friend class OGLFrameBufferManager;
60 CRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage)
62 m_beingRendered = false;
63 m_width = m_height = 0;
68 virtual ~CRenderTexture() {}
70 virtual bool SetAsRenderTarget(bool enable)=0;
71 virtual void LoadTexture(TxtrCacheEntry* pEntry)=0;
73 virtual void StoreToRDRAM(int infoIdx) {};
75 void GetDimension(int &width, int &height)
81 bool IsBeingRendered()
83 return m_beingRendered;
86 TextureUsage GetUsage() {return m_usage;}
96 RenderTextureInfo* m_pInfo;
100 class COGLRenderTexture : public CRenderTexture
102 // Haven't implemented yet
104 COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage);
105 ~COGLRenderTexture();
107 bool SetAsRenderTarget(bool enable);
108 void LoadTexture(TxtrCacheEntry* pEntry);
109 void StoreToRDRAM(int infoIdx);
112 bool InitPBuffer(void);
113 void ShutdownPBuffer(void);
119 COGLTexture *m_pOGLTexture;