Path: blob/master/libmupen64plus/mupen64plus-video-rice/src/DeviceBuilder.h
2 views
/*1Copyright (C) 2003 Rice196423This program is free software; you can redistribute it and/or4modify it under the terms of the GNU General Public License5as published by the Free Software Foundation; either version 26of the License, or (at your option) any later version.78This program is distributed in the hope that it will be useful,9but WITHOUT ANY WARRANTY; without even the implied warranty of10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11GNU General Public License for more details.1213You should have received a copy of the GNU General Public License14along with this program; if not, write to the Free Software15Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.1617*/1819#ifndef _DEVICE_BUILDER_H20#define _DEVICE_BUILDER_H2122#include "Blender.h"23#include "Combiner.h"24#include "Config.h"25#include "GraphicsContext.h"26#include "TextureManager.h"2728//========================================================================2930class CDeviceBuilder31{32public:33virtual CGraphicsContext * CreateGraphicsContext(void)=0;34virtual CRender * CreateRender(void)=0;35virtual CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL)=0;36virtual CColorCombiner * CreateColorCombiner(CRender *pRender)=0;37virtual CBlender * CreateAlphaBlender(CRender *pRender)=0;3839void DeleteGraphicsContext(void);40void DeleteRender(void);41void DeleteColorCombiner(void);42void DeleteAlphaBlender(void);4344static void DeleteBuilder(void);45static CDeviceBuilder* GetBuilder(void);46static void SelectDeviceType(SupportedDeviceType type);47static SupportedDeviceType GetDeviceType(void);48static SupportedDeviceType GetGeneralDeviceType(void);49static SupportedDeviceType m_deviceGeneralType;50protected:51CDeviceBuilder();52virtual ~CDeviceBuilder();5354static CDeviceBuilder* CreateBuilder(SupportedDeviceType type);55static SupportedDeviceType m_deviceType;56static CDeviceBuilder* m_pInstance;5758CRender* m_pRender;59CGraphicsContext* m_pGraphicsContext;60CColorCombiner* m_pColorCombiner;61CBlender* m_pAlphaBlender;62};6364class OGLDeviceBuilder : public CDeviceBuilder65{66friend class CDeviceBuilder;67public:68CGraphicsContext * CreateGraphicsContext(void);69CRender * CreateRender(void);70CTexture * CreateTexture(uint32 dwWidth, uint32 dwHeight, TextureUsage usage = AS_NORMAL);71CColorCombiner * CreateColorCombiner(CRender *pRender);72CBlender * CreateAlphaBlender(CRender *pRender);7374protected:75OGLDeviceBuilder() {};76virtual ~OGLDeviceBuilder() {};7778};7980#endif8182838485