fix use with, improve move, change icons, improve topbar

This commit is contained in:
Eduardo Bart
2012-01-24 16:39:16 -02:00
parent fb386b3845
commit 24aab00431
46 changed files with 185 additions and 108 deletions

View File

@@ -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()

View File

@@ -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;
};

View File

@@ -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);
}