mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-24 17:26:41 +00:00
small clarification in framebuffer, no functional change
This commit is contained in:
parent
048a787cb1
commit
f1656d2fbc
3 changed files with 17 additions and 23 deletions
|
@ -273,8 +273,8 @@ void AfterEffectManager::_updateScreenSize()
|
|||
|
||||
if (core->frameBuffer.isInited())
|
||||
{
|
||||
textureWidth = core->frameBuffer.getWidth();
|
||||
textureHeight = core->frameBuffer.getHeight();
|
||||
textureWidth = core->frameBuffer.getTexWidth();
|
||||
textureHeight = core->frameBuffer.getTexHeight();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
FrameBuffer::FrameBuffer()
|
||||
{
|
||||
inited = false;
|
||||
w = 0;
|
||||
h = 0;
|
||||
texw = 0;
|
||||
texh = 0;
|
||||
g_frameBuffer = 0;
|
||||
g_depthRenderBuffer = 0;
|
||||
g_dynamicTextureID = 0;
|
||||
|
@ -40,20 +40,14 @@ FrameBuffer::~FrameBuffer()
|
|||
unloadDevice();
|
||||
}
|
||||
|
||||
float FrameBuffer::getWidthP()
|
||||
float FrameBuffer::getWidthP() const
|
||||
{
|
||||
float px=0;
|
||||
int sw=core->getWindowWidth();
|
||||
px = (float)sw/(float)w;
|
||||
return px;
|
||||
return (float)core->getWindowWidth()/(float)texw;
|
||||
}
|
||||
|
||||
float FrameBuffer::getHeightP()
|
||||
float FrameBuffer::getHeightP() const
|
||||
{
|
||||
float py=0;
|
||||
int sh=core->getWindowHeight();
|
||||
py = (float)sh/(float)h;
|
||||
return py;
|
||||
return (float)core->getWindowHeight()/(float)texh;
|
||||
}
|
||||
|
||||
bool FrameBuffer::init(int width, int height, bool fitToScreen)
|
||||
|
@ -77,11 +71,11 @@ bool FrameBuffer::init(int width, int height, bool fitToScreen)
|
|||
if (width == 0 || height == 0)
|
||||
return false;
|
||||
|
||||
texw = width;
|
||||
texh = height;
|
||||
|
||||
w=width;
|
||||
h=height;
|
||||
std::ostringstream os;
|
||||
os << "Loading EXT_framebuffer_object (" << w << ", " << h << ")";
|
||||
os << "Loading EXT_framebuffer_object (" << texw << ", " << texh << ")";
|
||||
debugLog(os.str());
|
||||
|
||||
if( !glIsRenderbufferEXT || !glBindRenderbufferEXT || !glDeleteRenderbuffersEXT ||
|
||||
|
|
|
@ -30,14 +30,14 @@ public:
|
|||
FrameBuffer();
|
||||
~FrameBuffer();
|
||||
bool init(int width, int height, bool fitToScreen=false);
|
||||
bool isInited() { return inited; }
|
||||
bool isInited() const { return inited; }
|
||||
void startCapture() const;
|
||||
void endCapture() const;
|
||||
void bindTexture() const;
|
||||
int getWidth() { return w; }
|
||||
int getHeight() { return h; }
|
||||
float getWidthP();
|
||||
float getHeightP();
|
||||
int getTexWidth() const { return texw; }
|
||||
int getTexHeight() const { return texh; }
|
||||
float getWidthP() const;
|
||||
float getHeightP() const;
|
||||
|
||||
void unloadDevice();
|
||||
void reloadDevice();
|
||||
|
@ -48,7 +48,7 @@ protected:
|
|||
unsigned g_frameBuffer;
|
||||
unsigned g_depthRenderBuffer;
|
||||
unsigned g_dynamicTextureID;
|
||||
int w,h;
|
||||
int texw, texh;
|
||||
bool inited;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue