2008-07-12 17:40:22 +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/
|
|
|
|
|
2008-07-18 19:33:55 +00:00
|
|
|
#ifndef GCOGL_RENDER
|
|
|
|
#define GCOGL_RENDER
|
|
|
|
|
|
|
|
#include "TextureMngr.h"
|
|
|
|
|
2008-10-17 11:30:14 +00:00
|
|
|
#include <Cg/cg.h>
|
|
|
|
#include <Cg/cgGL.h>
|
|
|
|
|
2008-07-18 19:33:55 +00:00
|
|
|
extern CGcontext g_cgcontext;
|
|
|
|
extern CGprofile g_cgvProf, g_cgfProf;
|
|
|
|
|
2008-10-17 11:30:14 +00:00
|
|
|
extern float MValueX, MValueY;
|
|
|
|
extern int frameCount;
|
|
|
|
|
2008-07-18 19:33:55 +00:00
|
|
|
class Renderer
|
|
|
|
{
|
|
|
|
static void FlushZBufferAlphaToTarget();
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum RenderMode
|
|
|
|
{
|
|
|
|
RM_Normal=0, // normal target as color0, ztarget as color1
|
|
|
|
RM_ZBufferOnly, // zbuffer as color 0
|
|
|
|
RM_ZBufferAlpha // zbuffer as color0, also will dump alpha info to regular target once mode is switched
|
|
|
|
// use stencil buffer to indicate what pixels were written
|
|
|
|
};
|
|
|
|
|
|
|
|
static bool Create2();
|
|
|
|
static void Shutdown();
|
|
|
|
|
|
|
|
// initialize opengl standard values (like viewport)
|
|
|
|
static bool Initialize();
|
|
|
|
|
|
|
|
static void AddMessage(const char* str, u32 ms);
|
|
|
|
static void ProcessMessages(); // draw the current messages on the screen
|
2008-08-10 21:06:03 +00:00
|
|
|
static void RenderText(const char* pstr, int left, int top, u32 color);
|
2008-07-18 19:33:55 +00:00
|
|
|
static void SetAA(int aa); // sets the anti-aliasing level
|
|
|
|
|
|
|
|
static void ReinitView(int nNewWidth, int nNewHeight);
|
|
|
|
|
|
|
|
static int GetTargetWidth();
|
|
|
|
static int GetTargetHeight();
|
|
|
|
static bool CanBlendLogicOp();
|
|
|
|
static void SetCgErrorOutput(bool bOutput);
|
|
|
|
|
|
|
|
static void ResetGLState();
|
|
|
|
static void RestoreGLState();
|
|
|
|
static bool IsUsingATIDrawBuffers();
|
|
|
|
static bool HaveStencilBuffer();
|
|
|
|
|
|
|
|
static void SetZBufferRender(); // sets rendering of the zbuffer using MRTs
|
|
|
|
static u32 GetZBufferTarget();
|
|
|
|
|
|
|
|
static void SetRenderMode(RenderMode mode);
|
|
|
|
static RenderMode GetRenderMode();
|
|
|
|
|
|
|
|
static void SetRenderTarget(u32 targ); // if targ is 0, sets to original render target
|
|
|
|
static void SetDepthTarget(u32 targ);
|
|
|
|
static void SetFramebuffer(u32 fb);
|
|
|
|
static u32 GetRenderTarget();
|
|
|
|
|
|
|
|
// Finish up the current frame, print some stats
|
|
|
|
static void Swap(const TRectangle& rc);
|
|
|
|
|
2008-10-15 14:07:03 +00:00
|
|
|
static void SwapBuffers();
|
|
|
|
|
2008-07-18 19:33:55 +00:00
|
|
|
static bool SaveRenderTarget(const char* filename, int jpeg);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|