GLContext: remove setSize() and set glViewport() in Display::onReshape()
This commit is contained in:
parent
60333f6d02
commit
c1f1dd75bd
6 changed files with 8 additions and 33 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#include <Spectre/Graphics/Image.h>
|
||||
#include <Platform/PlatformDisplay.h>
|
||||
|
||||
#include <Graphics/GL/gl.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
#define CAPTION_DEFAULT "Spectre"
|
||||
|
|
@ -182,8 +184,12 @@ void Display::swapBuffers()
|
|||
|
||||
void Display::onReshape(int width, int height)
|
||||
{
|
||||
// Resize context if the windows resizes.
|
||||
m_context->setSize(width, height);
|
||||
// TODO: This should even not be here.
|
||||
// Generic Display should not have any GL calls.
|
||||
// But it's better to have it here then in the platform specific GLContext
|
||||
if (activate(true)) {
|
||||
glViewport(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace sp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue