mirror of
https://github.com/DumbDev69420/EscapeTheBackrooms_Internal.git
synced 2025-06-29 18:22:32 +08:00
Projektdateien hinzufügen.
This commit is contained in:
1617
EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h
Normal file
1617
EscapeTheBackroomsGUiTest/GUI/ZeroGUI.h
Normal file
File diff suppressed because it is too large
Load Diff
72
EscapeTheBackroomsGUiTest/GUI/ZeroInput.h
Normal file
72
EscapeTheBackroomsGUiTest/GUI/ZeroInput.h
Normal file
@ -0,0 +1,72 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
|
||||
namespace ZeroGUI
|
||||
{
|
||||
namespace Input
|
||||
{
|
||||
bool mouseDown[5];
|
||||
bool mouseDownAlready[256];
|
||||
|
||||
bool keysDown[256];
|
||||
bool keysDownAlready[256];
|
||||
|
||||
bool IsAnyMouseDown()
|
||||
{
|
||||
if (mouseDown[0]) return true;
|
||||
if (mouseDown[1]) return true;
|
||||
if (mouseDown[2]) return true;
|
||||
if (mouseDown[3]) return true;
|
||||
if (mouseDown[4]) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsMouseClicked(int button, int element_id, bool repeat)
|
||||
{
|
||||
if (mouseDown[button])
|
||||
{
|
||||
if (!mouseDownAlready[element_id])
|
||||
{
|
||||
mouseDownAlready[element_id] = true;
|
||||
return true;
|
||||
}
|
||||
if (repeat)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
mouseDownAlready[element_id] = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool IsKeyPressed(int key, bool repeat)
|
||||
{
|
||||
if (keysDown[key])
|
||||
{
|
||||
if (!keysDownAlready[key])
|
||||
{
|
||||
keysDownAlready[key] = true;
|
||||
return true;
|
||||
}
|
||||
if (repeat)
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
keysDownAlready[key] = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Handle()
|
||||
{
|
||||
if (GetAsyncKeyState(0x01))
|
||||
{
|
||||
mouseDown[0] = true;
|
||||
}
|
||||
else
|
||||
mouseDown[0] = false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user