diff --git a/BBGE/AfterEffect.cpp b/BBGE/AfterEffect.cpp index dab87e2..631a055 100644 --- a/BBGE/AfterEffect.cpp +++ b/BBGE/AfterEffect.cpp @@ -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 { diff --git a/BBGE/FrameBuffer.cpp b/BBGE/FrameBuffer.cpp index 2da51d9..03b6473 100644 --- a/BBGE/FrameBuffer.cpp +++ b/BBGE/FrameBuffer.cpp @@ -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 || diff --git a/BBGE/FrameBuffer.h b/BBGE/FrameBuffer.h index 32a6e48..55877ed 100644 --- a/BBGE/FrameBuffer.h +++ b/BBGE/FrameBuffer.h @@ -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; };