Class ContextHelper¶
Defined in File contexthelper.hpp
Class Documentation¶
-
class
legion::application
::
ContextHelper
¶ Static helper class for calling functions on the GLFW context. https://www.glfw.org/docs/latest/pages.html.
Public Static Functions
-
static bool
initialized
()¶ Checks if the context has been initialized.
-
static bool
init
()¶
-
static bool
addOnInitCallback
(delegate<void()> callback)¶ Binds callback to be executed right after the context has been initialized. The callback will be invoked immediately if the context is already initialized.
-
static void
terminate
()¶
-
static int
getError
(cstring *desc)¶
-
static GLFWmonitor *
getPrimaryMonitor
()¶
-
static GLFWmonitor *
getCurrentMonitor
(GLFWwindow *window)¶
-
static void
setWindowMonitor
(GLFWwindow *window, GLFWmonitor *monitor, math::ivec2 pos, math::ivec2 size, int refreshRate)¶
-
static const GLFWvidmode *
getPrimaryVideoMode
()¶
-
static const GLFWvidmode *
getVideoMode
(GLFWmonitor *monitor)¶
-
static void
windowHint
(int hint, int value)¶
-
static GLFWwindow *
createWindow
(math::ivec2 dim, const char *title, GLFWmonitor *monitor = nullptr, GLFWwindow *share = nullptr)¶
-
static GLFWwindow *
createWindow
(int width, int height, const char *title, GLFWmonitor *monitor = nullptr, GLFWwindow *share = nullptr)¶
-
static void
showWindow
(GLFWwindow *window)¶ Request the input thread to give focus to this window.
-
static void
updateWindowFocus
()¶ Gives focus to the window that has requested it. (may only be called from the input thread)
-
static GLFWglproc
getProcAddress
(cstring procname)¶
-
static void
setWindowShouldClose
(GLFWwindow *window, int value)¶
-
static int
windowShouldClose
(GLFWwindow *window)¶
-
static void
setWindowIcon
(GLFWwindow *window, int count, const GLFWimage *images)¶
-
static void
setWindowAttrib
(GLFWwindow *window, int attrib, int value)¶
-
static void
setWindowPos
(GLFWwindow *window, int x, int y)¶
-
static void
setWindowPos
(GLFWwindow *window, math::ivec2 pos)¶
-
static math::ivec2
getWindowPos
(GLFWwindow *window)¶
-
static void
destroyWindow
(GLFWwindow *window)¶
-
static math::ivec2
getFramebufferSize
(GLFWwindow *window)¶
-
static void
swapBuffers
(GLFWwindow *window)¶
-
static void
swapInterval
(int interval)¶
-
static void
pollEvents
()¶
-
static bool
makeContextCurrent
(GLFWwindow *window)¶
-
static GLFWwindow *
getCurrentContext
()¶
-
static GLFWkeyfun
setKeyCallback
(GLFWwindow *window, GLFWkeyfun callback)¶
-
static GLFWcharfun
setCharCallback
(GLFWwindow *window, GLFWcharfun callback)¶
-
static GLFWcursorposfun
setCursorPosCallback
(GLFWwindow *window, GLFWcursorposfun callback)¶
-
static GLFWscrollfun
setScrollCallback
(GLFWwindow *window, GLFWscrollfun callback)¶
-
static GLFWdropfun
setDropCallback
(GLFWwindow *window, GLFWdropfun callback)¶
-
static GLFWcursorenterfun
setCursorEnterCallback
(GLFWwindow *window, GLFWcursorenterfun callback)¶
-
static GLFWwindowclosefun
setWindowCloseCallback
(GLFWwindow *window, GLFWwindowclosefun callback)¶
-
static GLFWwindowposfun
setWindowPosCallback
(GLFWwindow *window, GLFWwindowposfun callback)¶
-
static GLFWwindowsizefun
setWindowSizeCallback
(GLFWwindow *window, GLFWwindowsizefun callback)¶
-
static GLFWwindowrefreshfun
setWindowRefreshCallback
(GLFWwindow *window, GLFWwindowrefreshfun callback)¶
-
static GLFWwindowfocusfun
setWindowFocusCallback
(GLFWwindow *window, GLFWwindowfocusfun callback)¶
-
static GLFWwindowiconifyfun
setWindowIconifyCallback
(GLFWwindow *window, GLFWwindowiconifyfun callback)¶
-
static GLFWwindowmaximizefun
setWindowMaximizeCallback
(GLFWwindow *window, GLFWwindowmaximizefun callback)¶
-
static GLFWframebuffersizefun
setFramebufferSizeCallback
(GLFWwindow *window, GLFWframebuffersizefun callback)¶
-
static GLFWwindowcontentscalefun
setWindowContentScaleCallback
(GLFWwindow *window, GLFWwindowcontentscalefun callback)¶
-
static GLFWjoystickfun
setJoystickCallback
(GLFWjoystickfun callback)¶
-
static int
getGamepadSate
(int jid, GLFWgamepadstate *state)¶
-
static void
updateGamepadMappings
(const char *name)¶
-
static bool
joystickPresent
(int jid)¶
-
static void
setInputMode
(GLFWwindow *window, int mode, int value)¶
-
static bool