Skip to content

Commit

Permalink
event callbacks docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvlevi committed May 3, 2024
1 parent a9bdd46 commit 7b2352c
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion src/lu5_event_callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,22 @@

#include <stdio.h>

/**
* @brief mousePressed
*
* Called when a mouse button is pressed.
* The mouse button is passed as the first argument
*/

/**
* @brief mouseReleased
*
* Called when a mouse button is released.
* The mouse button is passed as the first argument
*/

static void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
{

if (!lu5.L) return;

lu5.input.mouse.actions[button] = action;
Expand All @@ -27,6 +40,29 @@ static void mouse_button_callback(GLFWwindow* window, int button, int action, in
}
}


/**
* @brief keyPressed
*
* Called whenever a key is pressed.
* Key is passed as the first argument.
*/

/**
* @brief keyReleased
*
* Called whenever a key is released.
* Key is passed as the first argument.
*/

/**
* @brief keyHeld
*
* Called whenever a key is held down.
* Key is passed as the first argument.
*/


static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
if (!lu5.L) return;
Expand Down

0 comments on commit 7b2352c

Please sign in to comment.