Added missing launcher
[mupen64plus-pandora.git] / source / gles2rice / src / RenderTexture.h
CommitLineData
292f9317 1/*
2Copyright (C) 2002 Rice1964
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18*/
19
20#ifndef _TEXTURE_BUFFER_H_
21#define _TEXTURE_BUFFER_H_
22
23#include "typedefs.h"
24#include "TextureManager.h"
25
26class CRenderTexture;
27typedef struct {
28 CRenderTexture *pRenderTexture;
29 SetImgInfo CI_Info;
30
31 uint32 bufferWidth;
32 uint32 bufferHeight;
33 uint32 N64Width;
34 uint32 N64Height;
35 float scaleX;
36 float scaleY;
37
38 int maxUsedHeight;
39 uint32 updateAtFrame;
40 uint32 updateAtUcodeCount;
41
42 bool isUsed;
43 uint32 knownHeight;
44
45 uint32 crcInRDRAM;
46 uint32 crcCheckedAtFrame;
47
48 TxtrCacheEntry txtEntry;
49} RenderTextureInfo;
50
51
52class CRenderTexture
53{
54public:
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)
61 {
62 m_beingRendered = false;
63 m_width = m_height = 0;
64 m_pTexture = NULL;
65 m_pInfo = pInfo;
66 m_usage = usage;
67 }
68 virtual ~CRenderTexture() {}
69
70 virtual bool SetAsRenderTarget(bool enable)=0;
71 virtual void LoadTexture(TxtrCacheEntry* pEntry)=0;
72
73 virtual void StoreToRDRAM(int infoIdx) {};
74
75 void GetDimension(int &width, int &height)
76 {
77 width = m_width;
78 height = m_height;
79 }
80
81 bool IsBeingRendered()
82 {
83 return m_beingRendered;
84 }
85
86 TextureUsage GetUsage() {return m_usage;}
87
88
89protected:
90 int m_width;
91 int m_height;
92 bool m_beingRendered;
93 TextureUsage m_usage;
94
95 CTexture* m_pTexture;
96 RenderTextureInfo* m_pInfo;
97};
98
99
100class COGLRenderTexture : public CRenderTexture
101{
102 // Haven't implemented yet
103public:
104 COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage);
105 ~COGLRenderTexture();
106
107 bool SetAsRenderTarget(bool enable);
108 void LoadTexture(TxtrCacheEntry* pEntry);
109 void StoreToRDRAM(int infoIdx);
110
111protected:
112 bool InitPBuffer(void);
113 void ShutdownPBuffer(void);
114
115 int m_widthCreated;
116 int m_heightCreated;
117
118
119 COGLTexture *m_pOGLTexture;
120};
121
122#endif
123
124
125