2008-01-16 11:45:17 +00:00
|
|
|
#ifndef BLUECORE_RENDER_WINDOW_H
|
|
|
|
#define BLUECORE_RENDER_WINDOW_H
|
|
|
|
|
|
|
|
// system includes
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
// library includes
|
2008-01-17 16:42:24 +00:00
|
|
|
#include "GL/glew.h"
|
2008-01-16 11:45:17 +00:00
|
|
|
#include "GL/glfw.h"
|
|
|
|
|
|
|
|
// project includes
|
|
|
|
#include "Math/Vector.h"
|
|
|
|
#include "Utilities/sigslot.h"
|
|
|
|
#include "Utilities/Referenced.h"
|
|
|
|
|
|
|
|
namespace BlueCore
|
|
|
|
{
|
|
|
|
|
|
|
|
class RenderWindow : public Referenced
|
|
|
|
{
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
static void WindowSizeCallback(int width, int height);
|
|
|
|
static int WindowCloseCallback();
|
|
|
|
static void WindowRefreshCallback();
|
|
|
|
|
|
|
|
static void MousePosCallback(int x, int y);
|
|
|
|
static void MouseButtonCallback(int button, int action);
|
|
|
|
static void MouseWheelCallback(int pos);
|
|
|
|
static void KeyCallback(int key, int action);
|
|
|
|
static void CharCallback(int character, int action);
|
|
|
|
|
|
|
|
bool _Resized;
|
|
|
|
bool _Initialized;
|
|
|
|
bool _Closed;
|
|
|
|
int _Width, _Height;
|
|
|
|
|
|
|
|
void resizeWindow(int width, int height);
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
sigslot::signal0<> WindowCloseSignal;
|
|
|
|
sigslot::signal2<int, int> WindowResizeSignal;
|
|
|
|
sigslot::signal0<> WindowRefreshSignal;
|
|
|
|
|
|
|
|
sigslot::signal2<int, int> MouseMoveSignal;
|
|
|
|
sigslot::signal2<int, int> MouseButtonSignal;
|
|
|
|
sigslot::signal1<int> MouseWheelSignal;
|
|
|
|
sigslot::signal2<int, int> KeySignal;
|
|
|
|
sigslot::signal1<int> CharSignal;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
RenderWindow();
|
|
|
|
~RenderWindow();
|
|
|
|
|
|
|
|
bool create(int width, int height, int pixelbits, int depthbits,
|
|
|
|
int stencilbits, bool fullscreen);
|
|
|
|
|
|
|
|
void destroy();
|
|
|
|
void closeWindow();
|
|
|
|
int getWidth();
|
|
|
|
int getHeight();
|
|
|
|
|
|
|
|
bool isOpen();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|