mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 14:03:26 +02:00
fix use with, improve move, change icons, improve topbar
This commit is contained in:
@@ -28,6 +28,8 @@ uint FrameBuffer::boundFbo = 0;
|
||||
|
||||
FrameBuffer::FrameBuffer(const Size& size)
|
||||
{
|
||||
m_clearColor = Fw::alpha;
|
||||
|
||||
glGenFramebuffers(1, &m_fbo);
|
||||
if(!m_fbo)
|
||||
logFatal("Unable to create framebuffer object");
|
||||
@@ -68,8 +70,10 @@ void FrameBuffer::bind(bool clear)
|
||||
g_painter.setProjectionMatrix(projectionMatrix);
|
||||
g_graphics.setViewportSize(m_texture->getSize());
|
||||
|
||||
if(clear)
|
||||
if(clear) {
|
||||
glClearColor(m_clearColor.rF(), m_clearColor.gF(), m_clearColor.bF(), m_clearColor.aF());
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
}
|
||||
|
||||
void FrameBuffer::release()
|
||||
|
@@ -30,12 +30,14 @@ class FrameBuffer
|
||||
public:
|
||||
FrameBuffer(const Size& size);
|
||||
virtual ~FrameBuffer();
|
||||
|
||||
|
||||
void resize(const Size& size);
|
||||
void bind(bool clear = true);
|
||||
void release();
|
||||
void draw(const Rect& dest);
|
||||
|
||||
void setClearColor(const Color& color) { m_clearColor = color; }
|
||||
|
||||
TexturePtr getTexture() { return m_texture; }
|
||||
|
||||
private:
|
||||
@@ -48,6 +50,7 @@ private:
|
||||
Size m_oldViewportSize;
|
||||
uint m_fbo;
|
||||
uint m_prevBoundFbo;
|
||||
Color m_clearColor;
|
||||
|
||||
static uint boundFbo;
|
||||
};
|
||||
|
@@ -43,7 +43,6 @@ void Graphics::init()
|
||||
#endif
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
|
||||
logInfo("GPU ", glGetString(GL_RENDERER));
|
||||
logInfo("OpenGL ", glGetString(GL_VERSION));
|
||||
@@ -93,6 +92,7 @@ void Graphics::resize(const Size& size)
|
||||
|
||||
void Graphics::beginRender()
|
||||
{
|
||||
glClearColor(0, 0, 0, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user