mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Clean up OpenGL code and introduce the Framebuffer Manager. More work is forthcoming; I plan to implement resolution switching (while the game is running) and also multiple virtual XFBs for game-controlled buffer swapping.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3587 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
68
Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.h
Normal file
68
Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.h
Normal file
@ -0,0 +1,68 @@
|
||||
// Copyright (C) 2003-2009 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 _FRAMEBUFFERMANAGER_H_
|
||||
#define _FRAMEBUFFERMANAGER_H_
|
||||
|
||||
#include "GLUtil.h"
|
||||
|
||||
class FramebufferManager
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
FramebufferManager() :
|
||||
m_efbFramebuffer(0),
|
||||
m_efbColor(0),
|
||||
m_efbDepth(0),
|
||||
m_resolvedFramebuffer(0),
|
||||
m_resolvedColorTexture(0),
|
||||
m_resolvedDepthTexture(0),
|
||||
m_xfbFramebuffer(0)
|
||||
{}
|
||||
|
||||
void Init(int targetWidth, int targetHeight, int msaaSamples, int msaaCoverageSamples);
|
||||
void Shutdown();
|
||||
|
||||
// To get the EFB in texture form, these functions may have to transfer
|
||||
// the EFB to a resolved texture first.
|
||||
GLuint GetEFBColorTexture(const TRectangle& sourceRc) const;
|
||||
GLuint GetEFBDepthTexture(const TRectangle& sourceRc) const;
|
||||
|
||||
GLuint GetEFBFramebuffer() const { return m_efbFramebuffer; }
|
||||
|
||||
private:
|
||||
|
||||
int m_targetWidth;
|
||||
int m_targetHeight;
|
||||
int m_msaaSamples;
|
||||
int m_msaaCoverageSamples;
|
||||
|
||||
GLuint m_efbFramebuffer;
|
||||
GLuint m_efbColor; // Renderbuffer in MSAA mode; Texture otherwise
|
||||
GLuint m_efbDepth; // Renderbuffer in MSAA mode; Texture otherwise
|
||||
|
||||
// Only used in MSAA mode.
|
||||
GLuint m_resolvedFramebuffer;
|
||||
GLuint m_resolvedColorTexture;
|
||||
GLuint m_resolvedDepthTexture;
|
||||
|
||||
GLuint m_xfbFramebuffer; // Only used in MSAA mode
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user