PANDORA: Make GLES context compatible with latest driver (FB only, no X11)
[mupen64plus-pandora.git] / source / rice_gles / src / RenderTexture.cpp
CommitLineData
d07c171f 1/*
2Copyright (C) 2005 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#include "osal_opengl.h"
20
21#include "Debugger.h"
22#include "FrameBuffer.h"
23#include "OGLTexture.h"
24
25// ===========================================================================
26COGLRenderTexture::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
45COGLRenderTexture::~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
59bool COGLRenderTexture::InitPBuffer( void )
60{
61 return true;
62}
63
64void COGLRenderTexture::ShutdownPBuffer(void)
65{
66}
67
68bool COGLRenderTexture::SetAsRenderTarget(bool enable)
69{
70 return true;
71}
72
73void COGLRenderTexture::LoadTexture(TxtrCacheEntry* pEntry)
74{
75}
76
77void COGLRenderTexture::StoreToRDRAM(int infoIdx)
78{
79}
80