added: has mouse

This commit is contained in:
EqUiNoX
2025-10-10 21:36:08 -06:00
parent b7aebd4462
commit 1f2d2cb0aa
3 changed files with 14 additions and 2 deletions
+13
View File
@@ -136,6 +136,19 @@ void input_manager::process_keyboard()
}
}
bool input_manager::has_mouse(int port)
{
for (int i = 0; i < XGetPortCount(); i++)
{
if (port >= 0 && port != i || mMouseHandles[i] == NULL)
{
continue;
}
return true;
}
return false;
}
bool input_manager::mouse_pressed(MOUSE_BUTTON button, int port)
{
for (int i = 0; i < XGetPortCount(); i++)
+1
View File
@@ -53,6 +53,7 @@ public:
static void init();
static void process_mouse();
static void process_keyboard();
static bool has_mouse(int port);
static bool mouse_pressed(MOUSE_BUTTON button, int port);
static bool try_get_mouse_state(int port, MouseState* mouseState);
static bool try_get_keyboard_state(int port, KeyboardState* keyboardState);
-2
View File
@@ -59,8 +59,6 @@ void __cdecl main()
nk_canvas canvas;
canvas_begin(context, &canvas, 0, 0, 0, graphics::getWidth(), graphics::getHeight(), nk_rgb(250,250,250));
{
nk_fill_rect(canvas.painter, nk_rect(15,15,210,210), 5, nk_rgb(247, 230, 154));
nk_fill_rect(canvas.painter, nk_rect(20,20,200,200), 5, nk_rgb(188, 174, 118));
nk_draw_text(canvas.painter, nk_rect(30, 30, 150, 20), "Text to draw", 12, &font->handle, nk_rgb(188,174,118), nk_rgb(0,0,0));