2008-12-08 04:46:09 +00:00
|
|
|
// Copyright (C) 2003-2008 Dolphin Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
|
|
|
#ifndef __H_RENDER__
|
|
|
|
#define __H_RENDER__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
2008-12-26 17:02:46 +00:00
|
|
|
#include "pluginspecs_video.h"
|
|
|
|
#include "D3DBase.h"
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-03-01 01:09:32 +00:00
|
|
|
#include <Cg/cg.h>
|
|
|
|
|
|
|
|
extern CGcontext g_cgcontext;
|
|
|
|
extern CGprofile g_cgvProf, g_cgfProf;
|
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
class Renderer
|
|
|
|
{
|
|
|
|
// screen offset
|
2008-12-26 17:02:46 +00:00
|
|
|
static float m_x;
|
|
|
|
static float m_y;
|
|
|
|
static float m_width;
|
|
|
|
static float m_height;
|
|
|
|
static float xScale;
|
|
|
|
static float yScale;
|
2009-03-28 21:07:16 +00:00
|
|
|
static bool m_LastFrameDumped;
|
|
|
|
static bool m_AVIDumping;
|
|
|
|
static int m_recordWidth;
|
|
|
|
static int m_recordHeight;
|
2008-12-08 04:46:09 +00:00
|
|
|
const static int MaxTextureStages = 9;
|
|
|
|
const static int MaxRenderStates = 210;
|
|
|
|
const static DWORD MaxTextureTypes = 33;
|
|
|
|
const static DWORD MaxSamplerSize = 13;
|
|
|
|
const static DWORD MaxSamplerTypes = 15;
|
|
|
|
static std::vector<LPDIRECT3DBASETEXTURE9> m_Textures;
|
2008-12-26 17:02:46 +00:00
|
|
|
static DWORD m_RenderStates[MaxRenderStates+46];
|
2008-12-08 04:46:09 +00:00
|
|
|
static DWORD m_TextureStageStates[MaxTextureStages][MaxTextureTypes];
|
|
|
|
static DWORD m_SamplerStates[MaxSamplerSize][MaxSamplerTypes];
|
|
|
|
static DWORD m_FVF;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void Init(SVideoInitialize &_VideoInitialize);
|
|
|
|
static void Shutdown();
|
|
|
|
|
2009-02-28 22:10:38 +00:00
|
|
|
static void Initialize();
|
2008-12-25 15:56:36 +00:00
|
|
|
|
2008-12-08 04:46:09 +00:00
|
|
|
// must be called if the window size has changed
|
2009-02-28 22:10:38 +00:00
|
|
|
static void ReinitView();
|
2008-12-25 15:56:36 +00:00
|
|
|
|
2009-02-28 22:10:38 +00:00
|
|
|
static void SwapBuffers();
|
2008-12-25 15:56:36 +00:00
|
|
|
|
2009-02-28 22:10:38 +00:00
|
|
|
static float GetXScale() { return xScale; }
|
|
|
|
static float GetYScale() { return yScale; }
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2009-02-28 22:10:38 +00:00
|
|
|
static void SetScissorRect();
|
|
|
|
// static void SetViewport(float* _Viewport);
|
|
|
|
// static void SetProjection(float* _pProjection, int constantIndex = -1);
|
2008-12-08 04:46:09 +00:00
|
|
|
|
2008-12-26 17:02:46 +00:00
|
|
|
// The little status display.
|
2008-12-08 04:46:09 +00:00
|
|
|
static void AddMessage(const std::string &message, unsigned int ms);
|
|
|
|
static void ProcessMessages();
|
|
|
|
static void RenderText(const std::string &text, int left, int top, unsigned int color);
|
|
|
|
|
2008-12-26 17:02:46 +00:00
|
|
|
// The following are "filtered" versions of the corresponding D3Ddev-> functions.
|
2009-02-28 22:10:38 +00:00
|
|
|
static void SetTexture(DWORD Stage, IDirect3DBaseTexture9 *pTexture);
|
|
|
|
static void SetFVF(DWORD FVF);
|
|
|
|
static void SetRenderState(D3DRENDERSTATETYPE State, DWORD Value);
|
|
|
|
static void SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value);
|
|
|
|
static void SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value);
|
2008-12-08 04:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __H_RENDER__
|