|
| OpenGL3DEngine (const OpenGL3DEngine &)=delete |
| do not allow engines to be copied
|
|
OpenGL3DEngine & | operator= (const OpenGL3DEngine &)=delete |
| do not allow engines to be copied
|
|
virtual GLboolean | isLeftMouseDown () const noexcept final |
| the status of the left mouse button being down
|
|
virtual void | setLeftMouseDown (GLboolean isDown) final |
| set the status of the left mouse button being down
|
|
virtual GLboolean | isShiftDown () const noexcept final |
| the status of either shift key being down
|
|
virtual void | setShiftDown (GLboolean isDown) final |
| set the status of the shift keys being down
|
|
virtual glm::vec2 | getMousePosition () const noexcept final |
| the location of the mouse within the window
|
|
virtual void | setMousePosition (glm::vec2 mousePos) final |
| set the location of the mouse within the window
|
|
virtual void | setArcballCameraAngles (glm::vec3 angles) final |
| sets the object space position of the arcball camera in spherical world coordinates
|
|
virtual glm::vec3 | getArcballCameraEyePoint () const noexcept final |
| the world space position the arcball camera is located at
|
|
virtual glm::vec3 | getArcballCameraLookAtPoint () const noexcept final |
| the world space position the arcball camera is looking at and thus centered around
|
|
virtual void | setArcballCameraLookAtPoint (glm::vec3 lookAtPoint) final |
| set the world space position the arcball camera is looking at and thus centered around
|
|
virtual glm::vec3 | getArcballCameraUpVector () const noexcept final |
| the world space vector the arcball camera is oriented upwards along
|
|
virtual void | setArcballCameraUpVector (glm::vec3 upVector) final |
| sets the world space vector the arcball camera is oriented upwards along
|
|
virtual glm::mat4 | getArcballProjectionMatrix () const final |
| returns the current projection matrix for the arcball camera
|
|
virtual glm::mat4 | getArcballViewMatrix () const final |
| returns the current view matrix for the arcball camera
|
|
virtual void | addToArcballCameraAngles (glm::vec3 angleAdditions) final |
| moves the arcball spherical object space coordinate by the associated amounts
|
|
virtual void | updateArcballCameraDirection () final |
| recomputes the arcball camera's world space position
|
|
virtual void | handleCameraCursorPosEvent (double x, double y) final |
| moves camera for active cursor movement
|
|
virtual void | handleCameraKeyEvent (int key, int scancode, int action, int mods) final |
| tracks if either shift key is currently being pressed
|
|
virtual void | handleCameraMouseButtonEvent (int button, int action, int mods) final |
| tracks left mouse button state
|
|
virtual void | handleCameraScrollEvent (double xOffset, double yOffset) |
| zooms camera inward/outward based on scroll direction
|
|
void | handleCameraAspectRatioEvent (int width, int height) |
| resizes camera aspect ratio
|
|
| OpenGLEngine (const OpenGLEngine &)=delete |
| do not allow engines to be copied
|
|
OpenGLEngine & | operator= (const OpenGLEngine &)=delete |
| do not allow engines to be copied
|
|
virtual void | initialize () |
| Initialize everything needed for OpenGL Rendering. This includes in order: GLFW, function pointers, OpenGL, Shader Programs, Buffer Objects, Textures, and any Scene information.
|
|
virtual void | run ()=0 |
| Initiate the draw loop.
|
|
virtual void | shutdown () |
| Cleanup everything needed for OpenGL Rendering. This includes freeing memory for data used in: any Scene information, Textures, Buffer Objects, Shader Programs, OpenGL, function pointers, GLFW.
|
|
virtual void | turnDebuggingOn () noexcept final |
| Enable logging to command line.
|
|
virtual void | turnDebuggingOff () noexcept final |
| Disable logging to command line.
|
|
virtual bool | isDebuggingEnabled () const noexcept final |
| Returns if logging is enabled.
|
|
virtual bool | isExtensionEnabled (const std::string EXT) const noexcept final |
| Returns if OpenGL extension exists.
|
|
virtual void | setCurrentWindowSize (const int WINDOW_WIDTH, const int WINDOW_HEIGHT) final |
| Set the new window size.
|
|
virtual int | getWindowHeight () const noexcept final |
| Return the height of the window.
|
|
virtual int | getWindowWidth () const noexcept final |
| Return the width of the window.
|
|
virtual GLFWwindow * | getWindow () const noexcept final |
| Return the window object.
|
|
virtual void | setWindowShouldClose () final |
| Tell our engine's window to close.
|
|
virtual unsigned short | getError () noexcept final |
| Return current value of error code and clear the error code back to no error.
|
|
|
| OpenGL3DEngine (int OPENGL_MAJOR_VERSION, int OPENGL_MINOR_VERSION, int WINDOW_WIDTH, int WINDOW_HEIGHT, const char *WINDOW_TITLE, bool WINDOW_RESIZABLE=GLFW_FALSE) |
| creates OpenGLEngine for given context and window state as well as creating a default arcball camera and setting the shift + left mouse button to be up
|
|
| ~OpenGL3DEngine () override |
| cleans up OpenGL 3D Engine by deleting arcball camera object
|
|
| OpenGLEngine (int OPENGL_MAJOR_VERSION, int OPENGL_MINOR_VERSION, int WINDOW_WIDTH, int WINDOW_HEIGHT, const char *WINDOW_TITLE, bool WINDOW_RESIZABLE=GLFW_FALSE) |
| initializes our OpenGL Engine by setting the OpenGL context and GLFW window parameters
|
|
virtual | ~OpenGLEngine () |
| cleans up our OpenGL Engine by destroying the OpenGL context, GLFW window, and cleaning up all GPU resources
|
|
virtual void | mSetupGLFW () |
| Used to setup everything GLFW related. This includes the OpenGL context and our window.
By default, completes the following steps in order:
|
|
virtual void | mSetupOpenGL ()=0 |
| override to enable specific OpenGL features
|
|
virtual void | mSetupShaders () |
| override to register any shaders with the GPU
|
|
virtual void | mSetupBuffers () |
| override to register any buffer objects with the GPU
|
|
virtual void | mSetupTextures () |
| override to register any textures with the GPU
|
|
virtual void | mSetupScene () |
| override to setup any scene specific information
|
|
virtual void | mCleanupScene () |
| override to cleanup any scene specific information
|
|
virtual void | mCleanupTextures () |
| override to cleanup any textures from the GPU
|
|
virtual void | mCleanupBuffers () |
| override to cleanup any buffer objects from the GPU
|
|
virtual void | mCleanupShaders () |
| override to cleanup any shaders from the GPU
|
|
virtual void | mCleanupOpenGL () |
| override to cleanup any specific OpenGL features
|
|
virtual void | mCleanupGLFW () |
| Destroys the associated GLFW window and terminates the GLFW instance.
|
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_NO_ERROR = 0 |
| no error is present, everything is currently working
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_GLFW_INIT = 1 |
| an error occurred while initializing GLFW
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_GLFW_WINDOW = 2 |
| an error occurred while creating the GLFW window
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_GLEW_INIT = 3 |
| an error occurred while initializing GLEW
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_GLAD_INIT = 4 |
| an error occurred while initializing GLAD
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_UNKNOWN = 5 |
| a new error that does not correspond to a predefined scenario has occurred
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_LAST = OPENGL_ENGINE_ERROR_UNKNOWN |
| stores the error code number of the last possible error, this corresponds to the max error code value.
|
|
static const unsigned short | OPENGL_ENGINE_ERROR_SIZE = OPENGL_ENGINE_ERROR_LAST + 1 |
| stores the number of unique error codes that can be generated
|
|
static void | mErrorCallback (int error, const char *DESCRIPTION) |
| We will register this function as GLFW's error callback. When an error within OpenGL occurs, GLFW will tell us by calling this function. We can then print this info to the terminal to alert the user.
|
|
static void | mDebugMessageCallback (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam) |
| callback called whenever a debug message is signaled
|
|
static void | mWindowResizeCallback (GLFWwindow *pWindow, int width, int height) |
|
Abstract Class to run an OpenGL application with a 3D environment.
Creates and contains a default ArcballCam implementation, tracks the status of the left mouse button, shift key, and mouse position.
The following methods must be overridden: