Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
G3D::GLFWWindow Class Reference

Inherits G3D::OSWindow.

Public Member Functions

virtual ~GLFWWindow ()
 
virtual String _clipboardText () const override
 
virtual void _setClipboardText (const String &text) const override
 
void appendFileToFileList (String file)
 
virtual String caption () override
 The window title. More...
 
virtual String className () const override
 
void clearDroppedFileList ()
 
virtual Rect2D clientRect () const override
 Size of the inside of the window (the part that the program can render to) More...
 
bool cursorActive ()
 
virtual void decInputCaptureCount ()
 
virtual void decMouseHideCount ()
 
virtual void fireEvent (const GEvent &event)
 Inserts an event into the queue. More...
 
const shared_ptr< Framebuffer > & framebuffer () const
 Returns the Framebuffer object for this window modeling the OpenGL "Hardware framebuffer", which is not an OpenGL object. More...
 
virtual Rect2D fullRect () const override
 
Shape of the window, including borders More...
 
String getAPIName () const override
 Description of the windowing API for logging purposes (e.g. More...
 
String getAPIVersion () const override
 Description of the windowing API for logging purposes (e.g. More...
 
GKeyMod::Value getCurrentKeyMod ()
 
virtual void getDroppedFilenames (Array< String > &files) override
 Clears the files array and then sets it to a list of all files that were dropped in the last GEventType::FILE_DROP event. More...
 
virtual void getGameControllerState (unsigned int stickNum, Array< float > &axis, Array< bool > &button) const
 Remapping of getJoystickState() to be consistent on Windows and OS X for official Xbox360 game controllers. More...
 
virtual void getJoystickState (unsigned int stickNum, Array< float > &axis, Array< bool > &buttons) const override
 
Returns the state of the given joystick. More...
 
void getMouseButtonState (uint8 &mouseButtons) const
 
void getMousePosition (int &x, int &y) const
 
virtual void getRelativeMouseState (Vector2 &position, uint8 &mouseButtons) const override
 Returns the current mouse position and the state of the mouse buttons. More...
 
virtual void getRelativeMouseState (int &x, int &y, uint8 &mouseButtons) const override
 
virtual void getRelativeMouseState (double &x, double &y, uint8 &mouseButtons) const override
 
virtual void getSettings (OSWindow::Settings &settings) const override
 Return the actual properties of this window (as opposed to the desired settings from which it was initialized) More...
 
void handleCursorEnter (int action)
 
void handleResizeFromCallback (int width, int height)
 
virtual bool hasFocus () const override
 Returns true if this window currently has [keyboard] focus (i.e. More...
 
virtual int height () const override
 
virtual void hide () const override
 
virtual void incInputCaptureCount ()
 
virtual void incMouseHideCount ()
 
virtual bool inputCapture () const
 
int inputCaptureCount () const
 If the count is 1 or greater, then the keyboard and mouse focus is captured, locking the mouse to the client area of this window. More...
 
virtual bool isIconified () const override
 Methods for returning and setting whether a window is iconified: currently, these are only implemented in GLFWWindow, so in any other case isIconified() returns false. More...
 
virtual String joystickName (unsigned int stickNum) const override
 The name by which the OS refers to this joystick (e.g. More...
 
void makeCurrent () const
 Makes the OpenGL context of this window current. More...
 
void modifyCurrentKeyMod (GKeyMod::Value button, GButtonState state)
 
int mouseHideCount () const
 If the count is 1 or greater, then the keyboard and mouse focus is captured, locking the mouse to the client area of this window. More...
 
virtual bool mouseVisible () const
 
virtual int numJoysticks () const override
 Returns 0 if there are no joysticks available. More...
 
virtual bool pollEvent (GEvent &e)
 Checks to see if any events are waiting. More...
 
virtual void popLoopBody ()
 Pops a loop body off the stack. More...
 
virtual void pushLoopBody (void(*body)(void *), void *arg)
 Pushes a function onto the stack of functions called by runMainLoop. More...
 
virtual void pushLoopBody (GApp *app)
 Invokes GApplet::beginRun after the applet is on the stack. More...
 
RenderDevicerenderDevice () const
 
If a RenderDevice has been created and initialized for this window, returns that renderDevice. More...
 
virtual bool requiresMainLoop () const override
 Windows for which this is true require a program to hand control of the main loop to OSWindow::startMainLoop. More...
 
virtual void runMainLoop ()
 
Executes an event loop, invoking callback repeatedly. More...
 
virtual void setAsCurrentGraphicsContext () const override
 Override this with the glMakeCurrent call appropriate for your window. More...
 
virtual void setCaption (const String &title) override
 
virtual void setClientPosition (int x, int y) override
 
virtual void setClientRect (const Rect2D &dims) override
 
virtual void setFullPosition (int x, int y) override
 Only differs from setClientPosition properly on Windows. More...
 
virtual void setFullRect (const Rect2D &dims) override
 
Fails silently if unable to change the dimensions. More...
 
virtual void setGammaRamp (const Array< uint16 > &gammaRamp) override
 gammaRamp.length() = 256 More...
 
virtual void setIcon (const shared_ptr< Image > &src) override
 Set the icon (if supported). More...
 
virtual void setIcon (const String &imageFilename) override
 
virtual void setIconified (bool b) override
 
virtual void setInputCapture (bool c) override
 
Capture the keyboard and mouse focus, locking the mouse to the client area of this window. More...
 
void setInputCaptureCount (int c)
 
void setMouseHideCount (int c)
 
virtual void setMouseVisible (bool b) override
 
virtual void setRelativeMousePosition (double x, double y) override
 
virtual void setRelativeMousePosition (const Vector2 &p) override
 Relative to the window origin. More...
 
void setSize (int width, int height)
 
const Settingssettings () const
 
virtual void show () const override
 
virtual void swapGLBuffers () override
 Swap the OpenGL front and back buffers. More...
 
int visibleCursorMode ()
 
virtual int width () const override
 
Measured in pixels, this is the client area of the window. More...
 

Static Public Member Functions

static String clipboardText ()
 Uses the current() OSWindow instance to obtain text from the operating system clipboard. More...
 
static GLFWWindowcreate (const OSWindow::Settings &settings=OSWindow::Settings())
 
static const OSWindowcurrent ()
 
static float defaultGuiPixelScale ()
 GUI scaling for high-DPI monitors. More...
 
static GLFWWindowgetCurrentWindowPtr ()
 
static void getFullScreenResolutions (Array< Vector2int32 > &array)
 Enumerates all full-screen resolutions. More...
 
static GLFW_api_windowgetMasterWindowPtr ()
 
static int numDisplays ()
 Number of physical displays (e.g., monitors) reported by the operating system.
More...
 
static void popGraphicsContext ()
 Pop window off the top of the stack. More...
 
static float primaryDisplayRefreshRate (int width, int height)
 Return the maximum refresh rate supported at or above this resolution.
More...
 
static Vector2 primaryDisplaySize ()
 Dimensions in pixels of the primary display.
More...
 
static Vector2int32 primaryDisplayWindowSize ()
 Dimensions in pixels of a maximized (but not full-screen) window on the primary display.
More...
 
static void pushGraphicsContext (OSWindow *window)
 Push the current window on the stack. More...
 
static void setClipboardText (const String &text)
 Uses the current() OSWindow instance to put text on the operating system clipboard. More...
 
static Vector2 virtualDisplaySize ()
 Dimensions of the bounding rectangle of all displays.
More...
 

Protected Member Functions

void executeLoopBody ()
 Subclasses should call from their idle function. More...
 
virtual void getOSEvents (Queue< GEvent > &events) override
 Extract new events from the underlying operating system. More...
 
virtual void handleResize (int width, int height)
 Handles updating size settings and viewport for window size changes. More...
 
bool notDone ()
 

Protected Attributes

Queue< GEventm_eventQueue
 
shared_ptr< Framebufferm_framebuffer
 
int m_inputCaptureCount
 
int m_mouseHideCount
 
RenderDevicem_renderDevice
 
Settings m_settings
 Use this to maintain settings in sub-classes. More...
 

Constructor & Destructor Documentation

◆ ~GLFWWindow()

virtual G3D::GLFWWindow::~GLFWWindow ( )
virtual

Member Function Documentation

◆ _clipboardText()

virtual String G3D::GLFWWindow::_clipboardText ( ) const
overridevirtual

Implements G3D::OSWindow.

◆ _setClipboardText()

virtual void G3D::GLFWWindow::_setClipboardText ( const String text) const
overridevirtual

Implements G3D::OSWindow.

◆ appendFileToFileList()

void G3D::GLFWWindow::appendFileToFileList ( String  file)
inline

◆ caption()

virtual String G3D::GLFWWindow::caption ( )
overridevirtual

The window title.

Implements G3D::OSWindow.

◆ className()

virtual String G3D::GLFWWindow::className ( ) const
inlineoverridevirtual

Implements G3D::OSWindow.

◆ clearDroppedFileList()

void G3D::GLFWWindow::clearDroppedFileList ( )
inline

◆ clientRect()

virtual Rect2D G3D::GLFWWindow::clientRect ( ) const
overridevirtual

Size of the inside of the window (the part that the program can render to)

Implements G3D::OSWindow.

◆ clipboardText()

static String G3D::OSWindow::clipboardText ( )
staticinherited

Uses the current() OSWindow instance to obtain text from the operating system clipboard.

Returns the empty string if no OSWindow is currently instantiated.

◆ create()

static GLFWWindow* G3D::GLFWWindow::create ( const OSWindow::Settings settings = OSWindow::Settings())
static

◆ current()

static const OSWindow* G3D::OSWindow::current ( )
inlinestaticinherited

◆ cursorActive()

bool G3D::GLFWWindow::cursorActive ( )
inline

◆ decInputCaptureCount()

virtual void G3D::OSWindow::decInputCaptureCount ( )
inlinevirtualinherited

◆ decMouseHideCount()

virtual void G3D::OSWindow::decMouseHideCount ( )
inlinevirtualinherited

◆ defaultGuiPixelScale()

static float G3D::GLFWWindow::defaultGuiPixelScale ( )
static

GUI scaling for high-DPI monitors.

◆ executeLoopBody()

void G3D::OSWindow::executeLoopBody ( )
protectedinherited

Subclasses should call from their idle function.

Referenced by G3D::OSWindow::runMainLoop().

◆ fireEvent()

virtual void G3D::OSWindow::fireEvent ( const GEvent event)
virtualinherited

Inserts an event into the queue.

◆ framebuffer()

const shared_ptr<Framebuffer>& G3D::OSWindow::framebuffer ( ) const
inherited

Returns the Framebuffer object for this window modeling the OpenGL "Hardware framebuffer", which is not an OpenGL object.

This framebuffer has a size and format (determined by querying OpenGL on construction) but cannot have attachments.

◆ fullRect()

virtual Rect2D G3D::GLFWWindow::fullRect ( ) const
inlineoverridevirtual


Shape of the window, including borders

Implements G3D::OSWindow.

◆ getAPIName()

String G3D::GLFWWindow::getAPIName ( ) const
overridevirtual

Description of the windowing API for logging purposes (e.g.

"SDL").

See also
className

Implements G3D::OSWindow.

◆ getAPIVersion()

String G3D::GLFWWindow::getAPIVersion ( ) const
overridevirtual

Description of the windowing API for logging purposes (e.g.

"1.2.7" for SDL 1.2.7).

Implements G3D::OSWindow.

◆ getCurrentKeyMod()

GKeyMod::Value G3D::GLFWWindow::getCurrentKeyMod ( )
inline

◆ getCurrentWindowPtr()

static GLFWWindow* G3D::GLFWWindow::getCurrentWindowPtr ( )
static

◆ getDroppedFilenames()

virtual void G3D::GLFWWindow::getDroppedFilenames ( Array< String > &  files)
overridevirtual

Clears the files array and then sets it to a list of all files that were dropped in the last GEventType::FILE_DROP event.

Implements G3D::OSWindow.

◆ getFullScreenResolutions()

static void G3D::OSWindow::getFullScreenResolutions ( Array< Vector2int32 > &  array)
staticinherited

Enumerates all full-screen resolutions.

◆ getGameControllerState()

virtual void G3D::OSWindow::getGameControllerState ( unsigned int  stickNum,
Array< float > &  axis,
Array< bool > &  button 
) const
virtualinherited

Remapping of getJoystickState() to be consistent on Windows and OS X for official Xbox360 game controllers.

◆ getJoystickState()

virtual void G3D::GLFWWindow::getJoystickState ( unsigned int  stickNum,
Array< float > &  axis,
Array< bool > &  button 
) const
overridevirtual


Returns the state of the given joystick.

Not all sticks support all buttons and axes and frequently the state of one stick overlaps the state of another. An assertion fails if stickNum > numJoysticks(). Joystick axes are normalized to the range -1, 1. Joystick axes should be in the starting order: X, Y, Z, Slider1, Slider2, rX, rY, rZ

There are few standards for joysticks. Different joysticks may have different mappings, and even a single joystick may be mapped differently on different operating systems or drivers.

See also
getGameControllerState

Implements G3D::OSWindow.

◆ getMasterWindowPtr()

static GLFW_api_window* G3D::GLFWWindow::getMasterWindowPtr ( )
inlinestatic

◆ getMouseButtonState()

void G3D::GLFWWindow::getMouseButtonState ( uint8 mouseButtons) const

◆ getMousePosition()

void G3D::GLFWWindow::getMousePosition ( int &  x,
int &  y 
) const

◆ getOSEvents()

virtual void G3D::GLFWWindow::getOSEvents ( Queue< GEvent > &  events)
overrideprotectedvirtual

Extract new events from the underlying operating system.

Reimplemented from G3D::OSWindow.

◆ getRelativeMouseState() [1/3]

virtual void G3D::GLFWWindow::getRelativeMouseState ( Vector2 position,
uint8 mouseButtons 
) const
overridevirtual

Returns the current mouse position and the state of the mouse buttons.

It is essential to sample both simultaneously so that the mouse has not moved from the location where a click occurred.

Parameters
positionIn pixels, with y=up. Relative to the upper left corner of the window.
mouseButtonsIf button i is currently pressed then bit i is set.

Implements G3D::OSWindow.

◆ getRelativeMouseState() [2/3]

virtual void G3D::GLFWWindow::getRelativeMouseState ( int &  x,
int &  y,
uint8 mouseButtons 
) const
overridevirtual

Implements G3D::OSWindow.

◆ getRelativeMouseState() [3/3]

virtual void G3D::GLFWWindow::getRelativeMouseState ( double &  x,
double &  y,
uint8 mouseButtons 
) const
overridevirtual

Implements G3D::OSWindow.

◆ getSettings()

virtual void G3D::GLFWWindow::getSettings ( OSWindow::Settings settings) const
overridevirtual

Return the actual properties of this window (as opposed to the desired settings from which it was initialized)

Deprecated:
Use settings()

Implements G3D::OSWindow.

◆ handleCursorEnter()

void G3D::GLFWWindow::handleCursorEnter ( int  action)

◆ handleResize()

virtual void G3D::OSWindow::handleResize ( int  width,
int  height 
)
protectedvirtualinherited

Handles updating size settings and viewport for window size changes.

Referenced by handleResizeFromCallback().

◆ handleResizeFromCallback()

void G3D::GLFWWindow::handleResizeFromCallback ( int  width,
int  height 
)
inline

◆ hasFocus()

virtual bool G3D::GLFWWindow::hasFocus ( ) const
overridevirtual

Returns true if this window currently has [keyboard] focus (i.e.

is in the foreground, not minimized, recieves keystrokes.)

Implements G3D::OSWindow.

◆ height()

virtual int G3D::GLFWWindow::height ( ) const
overridevirtual

Implements G3D::OSWindow.

Referenced by handleResizeFromCallback().

◆ hide()

virtual void G3D::GLFWWindow::hide ( ) const
overridevirtual

Reimplemented from G3D::OSWindow.

◆ incInputCaptureCount()

virtual void G3D::OSWindow::incInputCaptureCount ( )
inlinevirtualinherited

◆ incMouseHideCount()

virtual void G3D::OSWindow::incMouseHideCount ( )
inlinevirtualinherited

◆ inputCapture()

virtual bool G3D::GLFWWindow::inputCapture ( ) const
virtual

◆ inputCaptureCount()

int G3D::OSWindow::inputCaptureCount ( ) const
inlineinherited

If the count is 1 or greater, then the keyboard and mouse focus is captured, locking the mouse to the client area of this window.

The use of a count instead of an explicit capture/release API allows multiple parts of a program to capture input without accidentally releasing and enclosing capture.

Referenced by G3D::OSWindow::decInputCaptureCount(), and G3D::OSWindow::incInputCaptureCount().

◆ isIconified()

virtual bool G3D::GLFWWindow::isIconified ( ) const
overridevirtual

Methods for returning and setting whether a window is iconified: currently, these are only implemented in GLFWWindow, so in any other case isIconified() returns false.

Reimplemented from G3D::OSWindow.

◆ joystickName()

virtual String G3D::GLFWWindow::joystickName ( unsigned int  sticknum) const
overridevirtual

The name by which the OS refers to this joystick (e.g.

"Gravis Gamepad")

Implements G3D::OSWindow.

◆ makeCurrent()

void G3D::OSWindow::makeCurrent ( ) const
inlineinherited

Makes the OpenGL context of this window current.

If you have multiple windows, call this before rendering to one of them. beta

◆ modifyCurrentKeyMod()

void G3D::GLFWWindow::modifyCurrentKeyMod ( GKeyMod::Value  button,
GButtonState  state 
)

◆ mouseHideCount()

int G3D::OSWindow::mouseHideCount ( ) const
inlineinherited

If the count is 1 or greater, then the keyboard and mouse focus is captured, locking the mouse to the client area of this window.

The use of a count instead of an explicit capture/release API allows multiple parts of a program to capture input without accidentally releasing and enclosing capture.

Referenced by G3D::OSWindow::decMouseHideCount(), and G3D::OSWindow::incMouseHideCount().

◆ mouseVisible()

virtual bool G3D::GLFWWindow::mouseVisible ( ) const
virtual

◆ notDone()

bool G3D::OSWindow::notDone ( )
inlineprotectedinherited

◆ numDisplays()

static int G3D::GLFWWindow::numDisplays ( )
static

Number of physical displays (e.g., monitors) reported by the operating system.

The OSWindow implementation calls the appropriate subclass override for the current operating system.

◆ numJoysticks()

virtual int G3D::GLFWWindow::numJoysticks ( ) const
overridevirtual

Returns 0 if there are no joysticks available.

Implements G3D::OSWindow.

◆ pollEvent()

virtual bool G3D::OSWindow::pollEvent ( GEvent e)
virtualinherited

Checks to see if any events are waiting.

If there is an event, returns true and fills out the GEvent structure. Otherwise returns false.

◆ popGraphicsContext()

static void G3D::OSWindow::popGraphicsContext ( )
staticinherited

Pop window off the top of the stack.

◆ popLoopBody()

virtual void G3D::OSWindow::popLoopBody ( )
virtualinherited

Pops a loop body off the stack.

If the loop body was a GApplet, invokes GApplet::endRun on it. If the loop body was a GApp2, invokes GApp2::endRun on it.

◆ primaryDisplayRefreshRate()

static float G3D::GLFWWindow::primaryDisplayRefreshRate ( int  width,
int  height 
)
static

Return the maximum refresh rate supported at or above this resolution.

◆ primaryDisplaySize()

static Vector2 G3D::GLFWWindow::primaryDisplaySize ( )
static

Dimensions in pixels of the primary display.

The OSWindow implementation calls the appropriate subclass override for the current operating system.

◆ primaryDisplayWindowSize()

static Vector2int32 G3D::GLFWWindow::primaryDisplayWindowSize ( )
static

Dimensions in pixels of a maximized (but not full-screen) window on the primary display.

Task bars and menus may make this smaller than the primaryDisplaySize().

The OSWindow implementation calls the appropriate subclass override for the current operating system.

◆ pushGraphicsContext()

static void G3D::OSWindow::pushGraphicsContext ( OSWindow window)
staticinherited

Push the current window on the stack.

◆ pushLoopBody() [1/2]

virtual void G3D::OSWindow::pushLoopBody ( void(*)(void *)  body,
void *  arg 
)
inlinevirtualinherited

Pushes a function onto the stack of functions called by runMainLoop.

◆ pushLoopBody() [2/2]

virtual void G3D::OSWindow::pushLoopBody ( GApp app)
virtualinherited

Invokes GApplet::beginRun after the applet is on the stack.

◆ renderDevice()

RenderDevice* G3D::OSWindow::renderDevice ( ) const
inlineinherited


If a RenderDevice has been created and initialized for this window, returns that renderDevice.

Otherwise returns nullptr.

◆ requiresMainLoop()

virtual bool G3D::GLFWWindow::requiresMainLoop ( ) const
inlineoverridevirtual

Windows for which this is true require a program to hand control of the main loop to OSWindow::startMainLoop.

The program's functionality may then be implemented through the "loop body" function.

That is, if requiresMainLoop returns true, you must use the following structure:

   void doEvents() {
      GEvent e;
      while (window->pollEvent(e)) {
          ... // Event handling
      } 
   }

   void doGraphics() {
      renderDevice->beginFrame();
          renderDevice->clear(true, true, true);
          ...  // draw stuff
      renderDevice->endFrame();
   }

   void loopBody(void*) {
      // all per-frame code; event-handling, physics, networking, AI, etc.
      doEvents();
      doLogic();
      doNetwork();
      doAI();
      doGraphics();

      // To end the program, invoke window->popLoopBody
   }

   window->pushLoopBody(callback, nullptr);
   window->runMainLoop(); // doesn't return

When requiresMainLoop returns false, you may use either the above structure or the following one (which puts you in more control of when graphics vs. other code is executed):

    while (true) {
      doEvents();
      doLogic();
      doNetwork();
      doAI();
      doGraphics();
    }       

This design is necessary because some underlying Window APIs (e.g. ActiveX, GLUT) enforce an event-driven structure.

Reimplemented from G3D::OSWindow.

◆ runMainLoop()

virtual void G3D::OSWindow::runMainLoop ( )
inlinevirtualinherited


Executes an event loop, invoking callback repeatedly.

Put everything that you want to execute once per frame into the callback function. It is guaranteed safe to call pollEvents and all other OSWindow methods from the callback function.

The default implementation (for requiresMainLoop() == false GWindows) just calls the callback continuously. Subclasses should use the notDone() and executeLoopBody() functions.

◆ setAsCurrentGraphicsContext()

virtual void G3D::GLFWWindow::setAsCurrentGraphicsContext ( ) const
overridevirtual

Override this with the glMakeCurrent call appropriate for your window.

Protected because user methods should call push/pop methods.

Implements G3D::OSWindow.

◆ setCaption()

virtual void G3D::GLFWWindow::setCaption ( const String title)
overridevirtual

Implements G3D::OSWindow.

◆ setClientPosition()

virtual void G3D::GLFWWindow::setClientPosition ( int  x,
int  y 
)
overridevirtual

Implements G3D::OSWindow.

◆ setClientRect()

virtual void G3D::GLFWWindow::setClientRect ( const Rect2D dims)
overridevirtual

Implements G3D::OSWindow.

◆ setClipboardText()

static void G3D::OSWindow::setClipboardText ( const String text)
staticinherited

Uses the current() OSWindow instance to put text on the operating system clipboard.

Does nothing if no OSWindow is currently instantiated.

◆ setFullPosition()

virtual void G3D::GLFWWindow::setFullPosition ( int  x,
int  y 
)
overridevirtual

Only differs from setClientPosition properly on Windows.

Implements G3D::OSWindow.

◆ setFullRect()

virtual void G3D::GLFWWindow::setFullRect ( const Rect2D dims)
inlineoverridevirtual


Fails silently if unable to change the dimensions.

The value returned by getSettings will not change immediately– it waits for a size event to update.

Implements G3D::OSWindow.

◆ setGammaRamp()

virtual void G3D::GLFWWindow::setGammaRamp ( const Array< uint16 > &  gammaRamp)
overridevirtual

gammaRamp.length() = 256

Implements G3D::OSWindow.

◆ setIcon() [1/2]

virtual void G3D::GLFWWindow::setIcon ( const shared_ptr< Image > &  image)
overridevirtual

Set the icon (if supported).

Fails silently if not supported or the window has no frame. May also fail if the OSWindow implementation's underlying GUI library is too limited.

Parameters
imageMay have any dimension supported by underlying OS.

Reimplemented from G3D::OSWindow.

◆ setIcon() [2/2]

virtual void G3D::GLFWWindow::setIcon ( const String imageFilename)
overridevirtual

Reimplemented from G3D::OSWindow.

◆ setIconified()

virtual void G3D::GLFWWindow::setIconified ( bool  b)
overridevirtual

Reimplemented from G3D::OSWindow.

◆ setInputCapture()

virtual void G3D::GLFWWindow::setInputCapture ( bool  c)
overridevirtual


Capture the keyboard and mouse focus, locking the mouse to the client area of this window.

Sets the inputCaptureCount to 1 if c is true and 0 if c is false

Implements G3D::OSWindow.

◆ setInputCaptureCount()

void G3D::OSWindow::setInputCaptureCount ( int  c)
inlineinherited

◆ setMouseHideCount()

void G3D::OSWindow::setMouseHideCount ( int  c)
inlineinherited

◆ setMouseVisible()

virtual void G3D::GLFWWindow::setMouseVisible ( bool  b)
overridevirtual

Implements G3D::OSWindow.

◆ setRelativeMousePosition() [1/2]

virtual void G3D::GLFWWindow::setRelativeMousePosition ( double  x,
double  y 
)
overridevirtual

Implements G3D::OSWindow.

◆ setRelativeMousePosition() [2/2]

virtual void G3D::GLFWWindow::setRelativeMousePosition ( const Vector2 p)
overridevirtual

Relative to the window origin.

Implements G3D::OSWindow.

◆ setSize()

void G3D::GLFWWindow::setSize ( int  width,
int  height 
)

◆ settings()

const Settings& G3D::OSWindow::settings ( ) const
inlineinherited

◆ show()

virtual void G3D::GLFWWindow::show ( ) const
overridevirtual

Reimplemented from G3D::OSWindow.

◆ swapGLBuffers()

virtual void G3D::GLFWWindow::swapGLBuffers ( )
overridevirtual

Swap the OpenGL front and back buffers.

Called by RenderDevice::endFrame.

Implements G3D::OSWindow.

◆ virtualDisplaySize()

static Vector2 G3D::GLFWWindow::virtualDisplaySize ( )
static

Dimensions of the bounding rectangle of all displays.

For a multi-monitor configuration, this is the net "display" size.

◆ visibleCursorMode()

int G3D::GLFWWindow::visibleCursorMode ( )

◆ width()

virtual int G3D::GLFWWindow::width ( ) const
overridevirtual


Measured in pixels, this is the client area of the window.

Returns the same width as getSettings and clientDimensions(). Convenience method for users.

Implements G3D::OSWindow.

Referenced by handleResizeFromCallback().

Member Data Documentation

◆ m_eventQueue

Queue<GEvent> G3D::OSWindow::m_eventQueue
protectedinherited

◆ m_framebuffer

shared_ptr<Framebuffer> G3D::OSWindow::m_framebuffer
mutableprotectedinherited

◆ m_inputCaptureCount

int G3D::OSWindow::m_inputCaptureCount
protectedinherited

◆ m_mouseHideCount

int G3D::OSWindow::m_mouseHideCount
protectedinherited

◆ m_renderDevice

RenderDevice* G3D::OSWindow::m_renderDevice
protectedinherited

◆ m_settings

Settings G3D::OSWindow::m_settings
protectedinherited

Use this to maintain settings in sub-classes.

Referenced by G3D::OSWindow::settings().


documentation generated on Wed Nov 24 2021 08:01:56 using doxygen 1.8.15