2015-04-16 16:55:32 +00:00
|
|
|
#ifndef B3G_WINDOW_INTERFACE_H
|
|
|
|
#define B3G_WINDOW_INTERFACE_H
|
|
|
|
|
2017-04-03 06:00:06 +00:00
|
|
|
#include "CommonCallbacks.h"
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct b3gWindowConstructionInfo
|
|
|
|
{
|
|
|
|
int m_width;
|
|
|
|
int m_height;
|
|
|
|
bool m_fullscreen;
|
|
|
|
int m_colorBitsPerPixel;
|
|
|
|
void* m_windowHandle;
|
|
|
|
const char* m_title;
|
|
|
|
int m_openglVersion;
|
|
|
|
|
|
|
|
|
|
|
|
b3gWindowConstructionInfo(int width=1024, int height=768)
|
|
|
|
:m_width(width),
|
|
|
|
m_height(height),
|
|
|
|
m_fullscreen(false),
|
|
|
|
m_colorBitsPerPixel(32),
|
|
|
|
m_windowHandle(0),
|
|
|
|
m_title("title"),
|
|
|
|
m_openglVersion(3)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-04-17 00:35:34 +00:00
|
|
|
class CommonWindowInterface
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2015-04-17 00:35:34 +00:00
|
|
|
virtual ~CommonWindowInterface()
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void createDefaultWindow(int width, int height, const char* title)
|
|
|
|
{
|
|
|
|
b3gWindowConstructionInfo ci(width,height);
|
|
|
|
ci.m_title = title;
|
|
|
|
createWindow(ci);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void createWindow(const b3gWindowConstructionInfo& ci)=0;
|
|
|
|
|
|
|
|
virtual void closeWindow()=0;
|
|
|
|
|
|
|
|
virtual void runMainLoop()=0;
|
|
|
|
virtual float getTimeInSeconds()=0;
|
|
|
|
|
|
|
|
virtual bool requestedExit() const = 0;
|
|
|
|
virtual void setRequestExit() = 0;
|
|
|
|
|
|
|
|
virtual void startRendering()=0;
|
|
|
|
|
|
|
|
virtual void endRendering()=0;
|
|
|
|
|
2015-04-17 00:35:34 +00:00
|
|
|
virtual bool isModifierKeyPressed(int key) = 0;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
virtual void setMouseMoveCallback(b3MouseMoveCallback mouseCallback)=0;
|
|
|
|
virtual b3MouseMoveCallback getMouseMoveCallback()=0;
|
|
|
|
|
|
|
|
virtual void setMouseButtonCallback(b3MouseButtonCallback mouseCallback)=0;
|
|
|
|
virtual b3MouseButtonCallback getMouseButtonCallback()=0;
|
|
|
|
|
|
|
|
virtual void setResizeCallback(b3ResizeCallback resizeCallback)=0;
|
|
|
|
virtual b3ResizeCallback getResizeCallback()=0;
|
|
|
|
|
|
|
|
virtual void setWheelCallback(b3WheelCallback wheelCallback)=0;
|
|
|
|
virtual b3WheelCallback getWheelCallback()=0;
|
|
|
|
|
|
|
|
virtual void setKeyboardCallback( b3KeyboardCallback keyboardCallback)=0;
|
|
|
|
virtual b3KeyboardCallback getKeyboardCallback()=0;
|
|
|
|
|
|
|
|
virtual void setRenderCallback( b3RenderCallback renderCallback) = 0;
|
|
|
|
|
|
|
|
virtual void setWindowTitle(const char* title)=0;
|
|
|
|
|
|
|
|
virtual float getRetinaScale() const =0;
|
2015-08-07 23:21:33 +00:00
|
|
|
virtual void setAllowRetina(bool allow) =0;
|
2016-05-04 06:46:29 +00:00
|
|
|
|
|
|
|
virtual int getWidth() const = 0;
|
|
|
|
virtual int getHeight() const = 0;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
virtual int fileOpenDialog(char* fileName, int maxFileNameLength) = 0;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2017-04-03 06:00:06 +00:00
|
|
|
#endif //B3G_WINDOW_INTERFACE_H
|