Spectre/Window/Window: refactor out GLContext specific code to its own class (GLWindow)
This commit is contained in:
parent
2de3bd93f7
commit
b1ccea1397
7 changed files with 120 additions and 55 deletions
41
include/Spectre/Window/GLWindow.h
Normal file
41
include/Spectre/Window/GLWindow.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
#ifndef SPECTRE_WINDOW_GLWINDOW_H
|
||||
#define SPECTRE_WINDOW_GLWINDOW_H
|
||||
|
||||
#include <Spectre/Window/Window.h>
|
||||
#include <Spectre/Window/GLContext.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
class GLContext;
|
||||
|
||||
// GLWindow represents a window that has an OpenGL context attached to it.
|
||||
class GLWindow : public Window
|
||||
{
|
||||
public:
|
||||
GLWindow();
|
||||
virtual ~GLWindow();
|
||||
|
||||
virtual bool create(WindowDescription decription);
|
||||
|
||||
virtual void destroy();
|
||||
|
||||
bool activate(bool value);
|
||||
|
||||
// Enable/Disable Vertical Sync.
|
||||
bool enableVSync(bool value);
|
||||
|
||||
void swapBuffers();
|
||||
|
||||
protected:
|
||||
|
||||
virtual void onReshape(int width, int height);
|
||||
|
||||
private:
|
||||
|
||||
GLContext* m_context;
|
||||
};
|
||||
|
||||
} // namepsace sp
|
||||
|
||||
#endif /* SPECTRE_WINDOW_GLWINDOW_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue