27 #ifndef _CEGuiGLFWSharedBase_h_ 28 #define _CEGuiGLFWSharedBase_h_ 30 #include "CEGUISamplesConfig.h" 31 #include "CEGUI/RendererModules/OpenGL/GL.h" 33 #if CEGUI_USE_GLFW_VER == 3 34 # include <GLFW/glfw3.h> 35 # if (GLFW_VERSION_MINOR < 1) && (GLFW_VERSION_PATCH < 1) 36 # define GLFW_DONT_CARE -1 38 #elif CEGUI_USE_GLFW_VER == 2 41 # error Unsupported "CEGUI_GLFW_VER". 43 #include "CEGuiBaseApplication.h" 44 #include "CEGUI/MouseCursor.h" 61 static void initGLFW();
62 static void createGLFWWindow();
63 static void setGLFWAppConfiguration();
67 #if GLFW_VERSION_MAJOR >= 3 69 static void glfwKeyCallback(GLFWwindow* window,
int key,
int scancode,
int action,
int mods);
70 static void glfwCharCallback(GLFWwindow* window,
unsigned codepoint);
71 static void glfwMouseButtonCallback(GLFWwindow* window,
int button,
int action,
int mods);
72 static void glfwScrollCallback(GLFWwindow* window,
double xoffset,
double yoffset);
73 static void glfwCursorPosCallback(GLFWwindow* window,
double xpos,
double ypos);
75 static void glfwWindowCloseCallback(GLFWwindow* window);
76 static void glfwWindowResizeCallback(GLFWwindow* window,
int width,
int height);
78 #else // GLFW_VERSION_MAJOR <= 2 80 static void GLFWCALL glfwKeyCallback(
int key,
int action);
81 static void GLFWCALL glfwCharCallback(
int character,
int action);
82 static void GLFWCALL glfwMouseButtonCallback(
int key,
int action);
83 static void GLFWCALL glfwMouseWheelCallback(
int position);
84 static void GLFWCALL glfwMousePosCallback(
int x,
int y );
86 static int GLFWCALL glfwWindowCloseCallback(
void);
87 static void GLFWCALL glfwWindowResizeCallback(
int width,
int height);
91 static CEGUI::Key::Scan GlfwToCeguiKey(
int glfwKey);
97 static double d_frameTime;
98 static int d_modifiers;
100 static bool d_windowSized;
101 static int d_newWindowWidth;
102 static int d_newWindowHeight;
104 static bool d_mouseLeftWindow;
105 static bool d_mouseDisableCalled;
106 static double d_oldMousePosX;
107 static double d_oldMousePosY;
109 static const char d_windowTitle[];
111 #if GLFW_VERSION_MAJOR >= 3 112 static GLFWwindow* d_window;
116 #endif // end of guard _CEGuiGLFWSharedBase_h_ Definition: CEGuiGLFWSharedBase.h:46
MouseButton
Enumeration of mouse buttons.
Definition: cegui/include/CEGUI/InputEvent.h:209
void destroyWindow()
The abstract function for destroying the renderer and the window.
Definition: CEGuiGLFWSharedBase.cpp:53
void endRendering()
Implementation function to perform required post-render operations.
Definition: CEGuiGLFW2SharedBase.cpp:70
void run()
The abstract function for running the application.
Definition: CEGuiGLFW2SharedBase.cpp:35
Base application abstract base class.
Definition: CEGuiBaseApplication.h:69
void beginRendering(const float elapsed)
Implementation function to perform required pre-render operations.
Definition: CEGuiGLFWSharedBase.cpp:59