Visual Computing Library
Loading...
Searching...
No Matches
vcl::glfw::WindowManager< DerivedRenderApp > Class Template Reference

Public Types

using ParentType = void
 The ParentType is the type of the parent class. It is used to initialize the base class (if any). In the glfw::WindowManager, the parent class is void and it is not managed.
 

Public Member Functions

 WindowManager (ParentType *parent=nullptr)
 
 WindowManager (const std::string &windowTitle, uint width=1024, uint height=768, ParentType *=nullptr)
 
const std::string & windowTitle () const
 
void setWindowTitle (const std::string &title)
 
uint width () const
 
uint height () const
 
void show ()
 
bool isMinimized () const
 Returns true if the window is minimized (i.e. iconified), false otherwise.
 
void update ()
 
Point2f dpiScale () const
 
voidwinId () const
 
voiddisplayId () const
 

Static Public Attributes

static const uint WINDOW_MANAGER_ID = WindowManagerId::GLFW_WINDOW
 The WINDOW_MANAGER_ID is the ID of the window manager. It is used to identify the window manager implementation (if necessary) by the DerivedRenderApp class.
 

Protected Member Functions

voidwindowPtr ()
 
virtual void glfwFramebufferSizeCallback (GLFWwindow *, int width, int height)
 
virtual void glfwContentScaleCallback (GLFWwindow *, float xscale, float yscale)
 
virtual void glfwKeyCallback (GLFWwindow *, int key, int, int action, int mods)
 
virtual void glfwMouseButtonCallback (GLFWwindow *win, int button, int action, int mods)
 
virtual void glfwCursorPosCallback (GLFWwindow *, double xpos, double ypos)
 
virtual void glfwScrollCallback (GLFWwindow *, double xoffset, double yoffset)
 

Protected Attributes

GLFWwindowmWindow = nullptr
 
float mScaleX = 1.0f
 
float mScaleY = 1.0f
 

Private Member Functions

void setCallbacks ()
 
autoderived ()
 
const autoderived () const
 

Static Private Member Functions

static int fixKeyboardMods (int key, int action, int mods)
 

Private Attributes

std::string mTitle
 
double mLastPressedTime = 0.0
 
int mLastPressedButton = NO_BUTTON
 
Point2d mLastPressedPos = {0, 0}
 

Static Private Attributes

static constexpr int NO_BUTTON = GLFW_MOUSE_BUTTON_LAST + 1
 
static constexpr double DOUBLE_CLICK_TIME_SECS = 0.25
 
static constexpr double DOUBLE_CLICK_DIST_PIXELS = 4.0
 

Member Function Documentation

◆ isMinimized()

bool vcl::glfw::WindowManager< DerivedRenderApp >::isMinimized ( ) const
inline

Returns true if the window is minimized (i.e. iconified), false otherwise.

Returns
true if the window is minimized, false otherwise.

The documentation for this class was generated from the following file: