Support Forum       G3D Web Page     
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
G3D::OSWindow Class Referenceabstract


Interface to window APIs for window management, event processing, and OpenGL context management. More...

Inherited by G3D::GLFWWindow.

Classes

class  Settings
 

Public Member Functions

virtual ~OSWindow ()
 Closes the window and frees any resources associated with it. More...
 
virtual String caption ()=0
 The window title. More...
 
virtual String className () const =0
 
virtual Rect2D clientRect () const =0
 Size of the inside of the window (the part that the program can render to) More...
 
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 =0
 
Shape of the window, including borders More...
 
virtual String getAPIName () const =0
 Description of the windowing API for logging purposes (e.g. More...
 
virtual String getAPIVersion () const =0
 Description of the windowing API for logging purposes (e.g. More...
 
virtual void getDroppedFilenames (Array< String > &files)=0
 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 > &button) const =0
 
Returns the state of the given joystick. More...
 
virtual void getRelativeMouseState (Vector2 &position, uint8 &mouseButtons) const =0
 Returns the current mouse position and the state of the mouse buttons. More...
 
virtual void getRelativeMouseState (int &x, int &y, uint8 &mouseButtons) const =0
 
virtual void getRelativeMouseState (double &x, double &y, uint8 &mouseButtons) const =0
 
virtual void getSettings (OSWindow::Settings &settings) const =0
 Return the actual properties of this window (as opposed to the desired settings from which it was initialized) More...
 
virtual bool hasFocus () const =0
 Returns true if this window currently has [keyboard] focus (i.e. More...
 
virtual int height () const =0
 
virtual void hide () const
 
virtual void incInputCaptureCount ()
 
virtual void incMouseHideCount ()
 
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
 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 =0
 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...
 
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 int numJoysticks () const =0
 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
 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 setCaption (const String &caption)=0
 
virtual void setClientPosition (int x, int y)=0
 
virtual void setClientRect (const Rect2D &dims)=0
 
virtual void setFullPosition (int x, int y)=0
 
Fails silently if unable to change the position. More...
 
virtual void setFullRect (const Rect2D &dims)=0
 
Fails silently if unable to change the dimensions. More...
 
virtual void setGammaRamp (const Array< uint16 > &gammaRamp)=0
 gammaRamp.length() = 256 More...
 
virtual void setIcon (const shared_ptr< Image > &image)
 Set the icon (if supported). More...
 
virtual void setIcon (const String &imageFilename)
 
virtual void setIconified (bool b)
 
void setInputCaptureCount (int c)
 
void setMouseHideCount (int c)
 
virtual void setRelativeMousePosition (double x, double y)=0
 
virtual void setRelativeMousePosition (const Vector2 &p)=0
 Relative to the window origin. More...
 
const Settingssettings () const
 
virtual void show () const
 
virtual void swapGLBuffers ()=0
 Swap the OpenGL front and back buffers. More...
 
virtual int width () const =0
 
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 OSWindowcreate (const Settings &s=Settings())
 Creates the default instance for this platform: More...
 
static const OSWindowcurrent ()
 
static void getFullScreenResolutions (Array< Vector2int32 > &array)
 Enumerates all full-screen resolutions. More...
 
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

 OSWindow ()
 
virtual String _clipboardText () const =0
 
virtual void _setClipboardText (const String &text) const =0
 
void executeLoopBody ()
 Subclasses should call from their idle function. More...
 
virtual void getOSEvents (Queue< GEvent > &events)
 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 ()
 
virtual void setAsCurrentGraphicsContext () const =0
 Override this with the glMakeCurrent call appropriate for your window. More...
 
virtual void setInputCapture (bool c)=0
 
Capture the keyboard and mouse focus, locking the mouse to the client area of this window. More...
 
virtual void setMouseVisible (bool b)=0
 

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...
 

Friends

class RenderDevice
 

Detailed Description


Interface to window APIs for window management, event processing, and OpenGL context management.

A OSWindow may be a user-level window, with a minimize button and frame, or simply a rectangular area within a larger window. In the latter case, several of the methods (e.g., setCaption) are likely to be ignored by the implementation.

Many parts of G3D assume that there is only one OS-level window, with one OpenGL context. (Although you can have multiple non-GL windows if using a native windowing API and you can even have multiple OpenGL contexts if you manage switching between them yourself).

Subclass this interface to support your preferred window system (e.g. ActiveX window, OS/X Carbon, MFC window, glut) not already implemented in G3D.

All dimensions are of the client area (inside the frame, if the window has a frame).

All mouse and window coordinates are in true device pixels. For logical pixels on high-DPI displays, adjust using GLFWWindow::defaultGuiPixelScale(). Alternatively, the GuiXXX classes take the logical scale into account for your.

After instantiation, a OSWindow guarantees that the OpenGL context for this window is bound. It may be unbound by later code–use OSWindow::makeCurrent if you have multiple windows in your application.

Subclassing

It is common to accept a OSWindow::Settings as an argument to the constructor. OSWindow provides a protected variable OSWindow::m_settings to manage the window settings.

Subclasses are required to call GLCaps::init from the end of their constructor/create function to finish initializing OpenGL.

See also
G3D::GuiWindow

Constructor & Destructor Documentation

◆ OSWindow()

G3D::OSWindow::OSWindow ( )
inlineprotected

◆ ~OSWindow()

virtual G3D::OSWindow::~OSWindow ( )
inlinevirtual

Closes the window and frees any resources associated with it.

When subclassing, put any shutdown code (e.g. SDL_Quit()) in your destructor. Put initialization code (e.g. SDL_Init()) in the constructor.

Member Function Documentation

◆ _clipboardText()

virtual String G3D::OSWindow::_clipboardText ( ) const
protectedpure virtual

Implemented in G3D::GLFWWindow.

◆ _setClipboardText()

virtual void G3D::OSWindow::_setClipboardText ( const String text) const
protectedpure virtual

Implemented in G3D::GLFWWindow.

◆ caption()

virtual String G3D::OSWindow::caption ( )
pure virtual

The window title.

Implemented in G3D::GLFWWindow.

◆ className()

virtual String G3D::OSWindow::className ( ) const
pure virtual

Implemented in G3D::GLFWWindow.

◆ clientRect()

virtual Rect2D G3D::OSWindow::clientRect ( ) const
pure virtual

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

Implemented in G3D::GLFWWindow.

Referenced by G3D::FullScreenWidget::bounds().

◆ clipboardText()

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

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 OSWindow* G3D::OSWindow::create ( const Settings s = Settings())
static

Creates the default instance for this platform:

  • Linux/FreeBSD - SDLWindow
  • OS X - GLFWWindow
  • Windows - Win32Window

◆ current()

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

◆ decInputCaptureCount()

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

◆ decMouseHideCount()

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

◆ executeLoopBody()

void G3D::OSWindow::executeLoopBody ( )
protected

Subclasses should call from their idle function.

Referenced by runMainLoop().

◆ fireEvent()

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

Inserts an event into the queue.

◆ framebuffer()

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

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::OSWindow::fullRect ( ) const
pure virtual


Shape of the window, including borders

Implemented in G3D::GLFWWindow.

◆ getAPIName()

virtual String G3D::OSWindow::getAPIName ( ) const
pure virtual

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

"SDL").

See also
className

Implemented in G3D::GLFWWindow.

◆ getAPIVersion()

virtual String G3D::OSWindow::getAPIVersion ( ) const
pure virtual

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

"1.2.7" for SDL 1.2.7).

Implemented in G3D::GLFWWindow.

◆ getDroppedFilenames()

virtual void G3D::OSWindow::getDroppedFilenames ( Array< String > &  files)
pure virtual

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

Implemented in G3D::GLFWWindow.

◆ getFullScreenResolutions()

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

Enumerates all full-screen resolutions.

◆ getGameControllerState()

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

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

◆ getJoystickState()

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


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

Implemented in G3D::GLFWWindow.

◆ getOSEvents()

virtual void G3D::OSWindow::getOSEvents ( Queue< GEvent > &  events)
protectedvirtual

Extract new events from the underlying operating system.

Reimplemented in G3D::GLFWWindow.

◆ getRelativeMouseState() [1/3]

virtual void G3D::OSWindow::getRelativeMouseState ( Vector2 position,
uint8 mouseButtons 
) const
pure virtual

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.

Implemented in G3D::GLFWWindow.

◆ getRelativeMouseState() [2/3]

virtual void G3D::OSWindow::getRelativeMouseState ( int &  x,
int &  y,
uint8 mouseButtons 
) const
pure virtual

Implemented in G3D::GLFWWindow.

◆ getRelativeMouseState() [3/3]

virtual void G3D::OSWindow::getRelativeMouseState ( double &  x,
double &  y,
uint8 mouseButtons 
) const
pure virtual

Implemented in G3D::GLFWWindow.

◆ getSettings()

virtual void G3D::OSWindow::getSettings ( OSWindow::Settings settings) const
pure virtual

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

Deprecated:
Use settings()

Implemented in G3D::GLFWWindow.

◆ handleResize()

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

Handles updating size settings and viewport for window size changes.

Referenced by G3D::GLFWWindow::handleResizeFromCallback().

◆ hasFocus()

virtual bool G3D::OSWindow::hasFocus ( ) const
pure virtual

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

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

Implemented in G3D::GLFWWindow.

◆ height()

virtual int G3D::OSWindow::height ( ) const
pure virtual

◆ hide()

virtual void G3D::OSWindow::hide ( ) const
inlinevirtual

Reimplemented in G3D::GLFWWindow.

◆ incInputCaptureCount()

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

◆ incMouseHideCount()

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

◆ inputCaptureCount()

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

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 decInputCaptureCount(), and incInputCaptureCount().

◆ isIconified()

virtual bool G3D::OSWindow::isIconified ( ) const
inlinevirtual

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 in G3D::GLFWWindow.

◆ joystickName()

virtual String G3D::OSWindow::joystickName ( unsigned int  sticknum) const
pure virtual

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

"Gravis Gamepad")

Implemented in G3D::GLFWWindow.

◆ makeCurrent()

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

Makes the OpenGL context of this window current.

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

◆ mouseHideCount()

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

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 decMouseHideCount(), and incMouseHideCount().

◆ notDone()

bool G3D::OSWindow::notDone ( )
inlineprotected

Referenced by runMainLoop().

◆ numDisplays()

static int G3D::OSWindow::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::OSWindow::numJoysticks ( ) const
pure virtual

Returns 0 if there are no joysticks available.

Implemented in G3D::GLFWWindow.

◆ pollEvent()

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

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 ( )
static

Pop window off the top of the stack.

◆ popLoopBody()

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

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::OSWindow::primaryDisplayRefreshRate ( int  width,
int  height 
)
static

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

◆ primaryDisplaySize()

static Vector2 G3D::OSWindow::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::OSWindow::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)
static

Push the current window on the stack.

◆ pushLoopBody() [1/2]

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

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

◆ pushLoopBody() [2/2]

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

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

◆ renderDevice()

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


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

Otherwise returns nullptr.

◆ requiresMainLoop()

virtual bool G3D::OSWindow::requiresMainLoop ( ) const
inlinevirtual

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 in G3D::GLFWWindow.

Referenced by runMainLoop().

◆ runMainLoop()

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


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::OSWindow::setAsCurrentGraphicsContext ( ) const
protectedpure virtual

Override this with the glMakeCurrent call appropriate for your window.

Protected because user methods should call push/pop methods.

Implemented in G3D::GLFWWindow.

◆ setCaption()

virtual void G3D::OSWindow::setCaption ( const String caption)
pure virtual

Implemented in G3D::GLFWWindow.

◆ setClientPosition()

virtual void G3D::OSWindow::setClientPosition ( int  x,
int  y 
)
pure virtual

Implemented in G3D::GLFWWindow.

◆ setClientRect()

virtual void G3D::OSWindow::setClientRect ( const Rect2D dims)
pure virtual

Implemented in G3D::GLFWWindow.

◆ setClipboardText()

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

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::OSWindow::setFullPosition ( int  x,
int  y 
)
pure virtual


Fails silently if unable to change the position.

Sets the window (not client) position.

Implemented in G3D::GLFWWindow.

◆ setFullRect()

virtual void G3D::OSWindow::setFullRect ( const Rect2D dims)
pure virtual


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.

Implemented in G3D::GLFWWindow.

◆ setGammaRamp()

virtual void G3D::OSWindow::setGammaRamp ( const Array< uint16 > &  gammaRamp)
pure virtual

gammaRamp.length() = 256

Implemented in G3D::GLFWWindow.

◆ setIcon() [1/2]

virtual void G3D::OSWindow::setIcon ( const shared_ptr< Image > &  image)
inlinevirtual

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 in G3D::GLFWWindow.

Referenced by setIcon().

◆ setIcon() [2/2]

virtual void G3D::OSWindow::setIcon ( const String imageFilename)
inlinevirtual

Reimplemented in G3D::GLFWWindow.

◆ setIconified()

virtual void G3D::OSWindow::setIconified ( bool  b)
inlinevirtual

Reimplemented in G3D::GLFWWindow.

◆ setInputCapture()

virtual void G3D::OSWindow::setInputCapture ( bool  c)
protectedpure virtual


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

Implemented in G3D::GLFWWindow.

Referenced by setInputCaptureCount().

◆ setInputCaptureCount()

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

◆ setMouseHideCount()

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

◆ setMouseVisible()

virtual void G3D::OSWindow::setMouseVisible ( bool  b)
protectedpure virtual

Implemented in G3D::GLFWWindow.

Referenced by setMouseHideCount().

◆ setRelativeMousePosition() [1/2]

virtual void G3D::OSWindow::setRelativeMousePosition ( double  x,
double  y 
)
pure virtual

Implemented in G3D::GLFWWindow.

◆ setRelativeMousePosition() [2/2]

virtual void G3D::OSWindow::setRelativeMousePosition ( const Vector2 p)
pure virtual

Relative to the window origin.

Implemented in G3D::GLFWWindow.

◆ settings()

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

◆ show()

virtual void G3D::OSWindow::show ( ) const
inlinevirtual

Reimplemented in G3D::GLFWWindow.

◆ swapGLBuffers()

virtual void G3D::OSWindow::swapGLBuffers ( )
pure virtual

Swap the OpenGL front and back buffers.

Called by RenderDevice::endFrame.

Implemented in G3D::GLFWWindow.

◆ virtualDisplaySize()

static Vector2 G3D::OSWindow::virtualDisplaySize ( )
static

Dimensions of the bounding rectangle of all displays.

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

◆ width()

virtual int G3D::OSWindow::width ( ) const
pure virtual


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

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

Implemented in G3D::GLFWWindow.

Referenced by G3D::MonitorXR::MonitorHMD::getResolution().

Friends And Related Function Documentation

◆ RenderDevice

friend class RenderDevice
friend

Member Data Documentation

◆ m_eventQueue

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

◆ m_framebuffer

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

◆ m_inputCaptureCount

int G3D::OSWindow::m_inputCaptureCount
protected

◆ m_mouseHideCount

int G3D::OSWindow::m_mouseHideCount
protected

◆ m_renderDevice

RenderDevice* G3D::OSWindow::m_renderDevice
protected

◆ m_settings

Settings G3D::OSWindow::m_settings
protected

Use this to maintain settings in sub-classes.

Referenced by settings().


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