Clove
A Simple Physics Engine to simulate Hooke's law in a 2D environment
Loading...
Searching...
No Matches
InputPointers Struct Reference

Struct to hold pointers and variables that we use in GLFW callback functions where it is not possible to pass by reference. Reason for multiple pointers is because 'glfwSetWindowUserPointer' only hold's 1 pointer, so by storing all necessary pointers in a struct and pointing to this struct, we can access more than 1 pointer in callback functions. More...

#include <Pointers.h>

Public Member Functions

 ~InputPointers ()
 Free pointers stored in struct (Needs to be done before deleting struct pointer).

Public Attributes

Shadersshader
 Pointer to a Shader object.
std::vector< Square * > squaresCreated
 Holds all Square's created and their values so we can draw them all to screen as unique objects.
bool lightMode = false
 Theme of app (Light/Dark Mode).
bool drawSquare = false
 Trigger a square to be drawn.
double xpos = 0.0
 X position of where user clicked. Used to determine square object spawn position.
double ypos = 0.0
 Y position of where user clicked. Used to determine square object spawn position.

Detailed Description

Struct to hold pointers and variables that we use in GLFW callback functions where it is not possible to pass by reference. Reason for multiple pointers is because 'glfwSetWindowUserPointer' only hold's 1 pointer, so by storing all necessary pointers in a struct and pointing to this struct, we can access more than 1 pointer in callback functions.


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