2015-04-16 16:55:32 +00:00
|
|
|
#ifndef MAC_OPENGL_WINDOW_H
|
|
|
|
#define MAC_OPENGL_WINDOW_H
|
|
|
|
|
2015-04-16 22:52:30 +00:00
|
|
|
#include "../CommonInterfaces/CommonWindowInterface.h"
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
#define b3gDefaultOpenGLWindow MacOpenGLWindow
|
|
|
|
|
2015-04-17 00:35:34 +00:00
|
|
|
class MacOpenGLWindow : public CommonWindowInterface
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
struct MacOpenGLWindowInternalData* m_internalData;
|
|
|
|
|
2015-04-16 16:55:32 +00:00
|
|
|
public:
|
2018-09-23 21:17:31 +00:00
|
|
|
MacOpenGLWindow();
|
|
|
|
virtual ~MacOpenGLWindow();
|
|
|
|
|
|
|
|
void init(int width, int height, const char* windowTitle);
|
|
|
|
|
|
|
|
void closeWindow();
|
|
|
|
|
|
|
|
void startRendering();
|
|
|
|
|
|
|
|
void endRendering(); //swap buffers
|
|
|
|
|
|
|
|
virtual bool requestedExit() const;
|
|
|
|
|
|
|
|
virtual void setRequestExit();
|
|
|
|
|
|
|
|
void getMouseCoordinates(int& x, int& y);
|
|
|
|
|
|
|
|
void runMainLoop();
|
|
|
|
|
|
|
|
virtual bool isModifierKeyPressed(int key);
|
|
|
|
|
|
|
|
void setMouseButtonCallback(b3MouseButtonCallback mouseCallback);
|
|
|
|
|
|
|
|
void setMouseMoveCallback(b3MouseMoveCallback mouseCallback);
|
|
|
|
|
|
|
|
void setResizeCallback(b3ResizeCallback resizeCallback);
|
|
|
|
|
|
|
|
void setKeyboardCallback(b3KeyboardCallback keyboardCallback);
|
2017-04-03 06:00:06 +00:00
|
|
|
|
|
|
|
virtual b3MouseMoveCallback getMouseMoveCallback();
|
|
|
|
|
|
|
|
virtual b3MouseButtonCallback getMouseButtonCallback();
|
|
|
|
|
2015-04-16 16:55:32 +00:00
|
|
|
virtual b3ResizeCallback getResizeCallback();
|
2015-05-07 18:44:16 +00:00
|
|
|
|
2017-04-03 06:00:06 +00:00
|
|
|
virtual b3WheelCallback getWheelCallback();
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
b3KeyboardCallback getKeyboardCallback();
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void setWheelCallback(b3WheelCallback wheelCallback);
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
float getRetinaScale() const;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual void setAllowRetina(bool allow);
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual void createWindow(const b3gWindowConstructionInfo& ci);
|
|
|
|
|
|
|
|
virtual float getTimeInSeconds();
|
|
|
|
|
|
|
|
virtual int getWidth() const;
|
|
|
|
virtual int getHeight() const;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual void setRenderCallback(b3RenderCallback renderCallback);
|
|
|
|
|
|
|
|
virtual void setWindowTitle(const char* title);
|
|
|
|
|
|
|
|
int fileOpenDialog(char* filename, int maxNameLength);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|