Rice GLES2 (from mupen64plus-ae) plugin. Compile but doesn't works well on the OpenPa...
[mupen64plus-pandora.git] / source / gles2rice / src / RenderTexture.cpp
1 /*
2 Copyright (C) 2005 Rice1964
3
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.
8
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.
13
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.
17 */
18
19 #include "osal_opengl.h"
20
21 #include "Debugger.h"
22 #include "FrameBuffer.h"
23 #include "OGLTexture.h"
24
25 // ===========================================================================
26 COGLRenderTexture::COGLRenderTexture(int width, int height, RenderTextureInfo* pInfo, TextureUsage usage)
27     :   CRenderTexture(width, height, pInfo, usage),
28         m_pOGLTexture(NULL)
29 {
30     if( usage == AS_BACK_BUFFER_SAVE )
31     {
32         m_pTexture = m_pOGLTexture = new COGLTexture(width, height, usage);
33         if( !m_pTexture )
34         {
35             TRACE0("Error to create OGL render_texture");
36             SAFE_DELETE(m_pTexture);
37         }
38     }
39
40     m_width = width;
41     m_height = height;
42     m_beingRendered = false;
43 }
44
45 COGLRenderTexture::~COGLRenderTexture()
46 {
47     if( m_beingRendered )
48     {
49         g_pFrameBufferManager->CloseRenderTexture(false);
50         SetAsRenderTarget(false);
51     }
52
53     ShutdownPBuffer();
54     SAFE_DELETE(m_pTexture);
55     m_pOGLTexture = NULL;
56     m_beingRendered = false;
57 }
58
59 bool COGLRenderTexture::InitPBuffer( void )
60 {
61     return true;
62 }
63
64 void COGLRenderTexture::ShutdownPBuffer(void)
65 {
66 }
67
68 bool COGLRenderTexture::SetAsRenderTarget(bool enable)
69 {
70    return true;
71 }
72
73 void COGLRenderTexture::LoadTexture(TxtrCacheEntry* pEntry)
74 {
75 }
76
77 void COGLRenderTexture::StoreToRDRAM(int infoIdx)
78 {
79 }
80