Added missing launcher
[mupen64plus-pandora.git] / source / gles2rice / src / DeviceBuilder.h
CommitLineData
292f9317 1/*
2Copyright (C) 2003 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 _DEVICE_BUILDER_H
21#define _DEVICE_BUILDER_H
22
23#include "Blender.h"
24#include "Combiner.h"
25#include "Config.h"
26#include "GraphicsContext.h"
27#include "TextureManager.h"
28
29//========================================================================
30
31class CDeviceBuilder
32{
33public:
34 virtual CGraphicsContext * CreateGraphicsContext(void)=0;
35 virtual CRender * CreateRender(void)=0;
36 virtual CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL)=0;
37 virtual CColorCombiner * CreateColorCombiner(CRender *pRender)=0;
38 virtual CBlender * CreateAlphaBlender(CRender *pRender)=0;
39
40 void DeleteGraphicsContext(void);
41 void DeleteRender(void);
42 void DeleteColorCombiner(void);
43 void DeleteAlphaBlender(void);
44
45 static void DeleteBuilder(void);
46 static CDeviceBuilder* GetBuilder(void);
47 static void SelectDeviceType(SupportedDeviceType type);
48 static SupportedDeviceType GetDeviceType(void);
49 static SupportedDeviceType GetGeneralDeviceType(void);
50 static SupportedDeviceType m_deviceGeneralType;
51protected:
52 CDeviceBuilder();
53 virtual ~CDeviceBuilder();
54
55 static CDeviceBuilder* CreateBuilder(SupportedDeviceType type);
56 static SupportedDeviceType m_deviceType;
57 static CDeviceBuilder* m_pInstance;
58
59 CRender* m_pRender;
60 CGraphicsContext* m_pGraphicsContext;
61 CColorCombiner* m_pColorCombiner;
62 CBlender* m_pAlphaBlender;
63};
64
65class OGLDeviceBuilder : public CDeviceBuilder
66{
67 friend class CDeviceBuilder;
68public:
69 CGraphicsContext * CreateGraphicsContext(void);
70 CRender * CreateRender(void);
71 CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL);
72 CColorCombiner * CreateColorCombiner(CRender *pRender);
73 CBlender * CreateAlphaBlender(CRender *pRender);
74
75protected:
76 OGLDeviceBuilder() {};
77 virtual ~OGLDeviceBuilder() {};
78
79};
80
81#endif
82
83