1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-01-26 02:07:26 +00:00

small clarification in framebuffer, no functional change

This commit is contained in:
fgenesis 2023-08-26 02:09:44 +02:00
parent 048a787cb1
commit f1656d2fbc
3 changed files with 17 additions and 23 deletions

View file

@ -273,8 +273,8 @@ void AfterEffectManager::_updateScreenSize()
if (core->frameBuffer.isInited()) if (core->frameBuffer.isInited())
{ {
textureWidth = core->frameBuffer.getWidth(); textureWidth = core->frameBuffer.getTexWidth();
textureHeight = core->frameBuffer.getHeight(); textureHeight = core->frameBuffer.getTexHeight();
} }
else else
{ {

View file

@ -27,8 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
FrameBuffer::FrameBuffer() FrameBuffer::FrameBuffer()
{ {
inited = false; inited = false;
w = 0; texw = 0;
h = 0; texh = 0;
g_frameBuffer = 0; g_frameBuffer = 0;
g_depthRenderBuffer = 0; g_depthRenderBuffer = 0;
g_dynamicTextureID = 0; g_dynamicTextureID = 0;
@ -40,20 +40,14 @@ FrameBuffer::~FrameBuffer()
unloadDevice(); unloadDevice();
} }
float FrameBuffer::getWidthP() float FrameBuffer::getWidthP() const
{ {
float px=0; return (float)core->getWindowWidth()/(float)texw;
int sw=core->getWindowWidth();
px = (float)sw/(float)w;
return px;
} }
float FrameBuffer::getHeightP() float FrameBuffer::getHeightP() const
{ {
float py=0; return (float)core->getWindowHeight()/(float)texh;
int sh=core->getWindowHeight();
py = (float)sh/(float)h;
return py;
} }
bool FrameBuffer::init(int width, int height, bool fitToScreen) 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) if (width == 0 || height == 0)
return false; return false;
texw = width;
texh = height;
w=width;
h=height;
std::ostringstream os; std::ostringstream os;
os << "Loading EXT_framebuffer_object (" << w << ", " << h << ")"; os << "Loading EXT_framebuffer_object (" << texw << ", " << texh << ")";
debugLog(os.str()); debugLog(os.str());
if( !glIsRenderbufferEXT || !glBindRenderbufferEXT || !glDeleteRenderbuffersEXT || if( !glIsRenderbufferEXT || !glBindRenderbufferEXT || !glDeleteRenderbuffersEXT ||

View file

@ -30,14 +30,14 @@ public:
FrameBuffer(); FrameBuffer();
~FrameBuffer(); ~FrameBuffer();
bool init(int width, int height, bool fitToScreen=false); bool init(int width, int height, bool fitToScreen=false);
bool isInited() { return inited; } bool isInited() const { return inited; }
void startCapture() const; void startCapture() const;
void endCapture() const; void endCapture() const;
void bindTexture() const; void bindTexture() const;
int getWidth() { return w; } int getTexWidth() const { return texw; }
int getHeight() { return h; } int getTexHeight() const { return texh; }
float getWidthP(); float getWidthP() const;
float getHeightP(); float getHeightP() const;
void unloadDevice(); void unloadDevice();
void reloadDevice(); void reloadDevice();
@ -48,7 +48,7 @@ protected:
unsigned g_frameBuffer; unsigned g_frameBuffer;
unsigned g_depthRenderBuffer; unsigned g_depthRenderBuffer;
unsigned g_dynamicTextureID; unsigned g_dynamicTextureID;
int w,h; int texw, texh;
bool inited; bool inited;
}; };