Typedef struct
This commit is contained in:
parent
e214539fe0
commit
7383129a51
8
main.c
8
main.c
@ -12,12 +12,12 @@
|
||||
int SCREEN_WIDTH = 1024;
|
||||
int SCREEN_HEIGHT = 768;
|
||||
|
||||
struct State {
|
||||
typedef struct State {
|
||||
float camX;
|
||||
float camY;
|
||||
float px;
|
||||
float py;
|
||||
};
|
||||
} State;
|
||||
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
|
||||
(void)window;
|
||||
@ -26,7 +26,7 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
|
||||
SCREEN_HEIGHT = height;
|
||||
}
|
||||
|
||||
void processInput(GLFWwindow *window, struct State* state) {
|
||||
void processInput(GLFWwindow *window, State* state) {
|
||||
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) {
|
||||
glfwSetWindowShouldClose(window, true);
|
||||
}
|
||||
@ -141,7 +141,7 @@ int main(void) {
|
||||
|
||||
// float deltaTime = 0.0f;
|
||||
// float lastFrame = 0.0f;
|
||||
struct State state = {0};
|
||||
State state = {0};
|
||||
int frameCount = 0;
|
||||
float elapsed = 0.0f;
|
||||
float lastFrame;
|
||||
|
Loading…
x
Reference in New Issue
Block a user