19 #if !defined(__MITSUBA_HW_NSGLDEVICE_H_)
20 #define __MITSUBA_HW_NSGLDEVICE_H_
30 #include <Cocoa/Cocoa.h>
32 @interface CustomView : NSView < NSWindowDelegate > {
34 unsigned int m_keymap[0xFF];
35 unsigned int m_modifiers;
36 unsigned int m_buttonMask;
38 bool m_firstMouseMotion;
40 bool m_ignoreNextMouseEvent;
44 - (
unsigned int) extractModifiers: (
unsigned int) modifiers;
45 - (void) setDevice: (mitsuba::NSGLDevice *) device;
46 - (void) ignoreNextMouseEvent;
47 - (void) ignoreFirstMouseMotion;
77 void setTitle(
const std::string &title);
80 void showCursor(
bool enabled);
83 void warpMouse(
const Point2i &position);
89 void setGrab(
bool grab);
99 bool isMouseInWindow();
108 void processEvents();
124 NSOpenGLPixelFormat *m_fmt;
125 NSOpenGLContext *m_currentContext;
130 void *m_currentContext;
134 std::vector<DeviceEvent> m_deviceEvents;
The device event structure encapsulates event information such as mouse movement or key presses...
Definition: device.h:34
A MacOS X (NSGL) device.
Definition: nsgldevice.h:56
virtual void setPosition(const Point2i &position)
Set the position of the device.
virtual void flip()
Flip the buffers (when using double buffering)
A MacOS X (NSGL) windowing environment session.
Definition: nsglsession.h:29
virtual void shutdown()
Shut the device down.
virtual void makeCurrent(Renderer *renderer)=0
Associate the renderer with this device.
virtual void setVisible(bool visible)=0
Only applies to devices, which are UI windows.
void * getWindow()
Return the NSWindow.
Definition: nsgldevice.h:111
virtual void init(Device *other=NULL)
An abstract drawing device.
Definition: device.h:136
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
Reference counting helper.
Definition: ref.h:40
Abstract renderer implementation.
Definition: renderer.h:79
virtual void setTitle(const std::string &title)
Set the window title.
void * getPixelFormat()
Return the pixel format.
Definition: nsgldevice.h:114
bool getCursor() const
Is the NSGL cursor shown?
Definition: nsgldevice.h:96