direct input fini

Le code ne fonctionne pas encore, il doit être merge avec le tuto 14.
This commit is contained in:
GolfOcean334
2024-03-29 14:38:48 +01:00
parent 41b2b9e024
commit f5554587bd
9 changed files with 214 additions and 225 deletions

View File

@@ -21,8 +21,17 @@ InputClass::~InputClass()
bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int screenHeight)
{
HRESULT result;
int i;
// Initialize all the keys to being released and not pressed.
for (i = 0; i < 256; i++)
{
m_keys[i] = false;
}
return;
// Store the screen size which will be used for positioning the mouse cursor.
m_screenWidth = screenWidth;
m_screenHeight = screenHeight;
@@ -97,42 +106,30 @@ bool InputClass::Initialize(HINSTANCE hinstance, HWND hwnd, int screenWidth, int
return true;
}
//void InputClass::Initialize()
//{
// int i;
//
//
// // Initialize all the keys to being released and not pressed.
// for (i = 0; i < 256; i++)
// {
// m_keys[i] = false;
// }
//
// return;
//}
//void InputClass::KeyDown(unsigned int input)
//{
// // If a key is pressed then save that state in the key array.
// m_keys[input] = true;
// return;
//}
//
//
//void InputClass::KeyUp(unsigned int input)
//{
// // If a key is released then clear that state in the key array.
// m_keys[input] = false;
// return;
//}
//
//
//bool InputClass::IsKeyDown(unsigned int key)
//{
// // Return what state the key is in (pressed/not pressed).
// return m_keys[key];
//}
void InputClass::KeyDown(unsigned int input)
{
// If a key is pressed then save that state in the key array.
m_keys[input] = true;
return;
}
void InputClass::KeyUp(unsigned int input)
{
// If a key is released then clear that state in the key array.
m_keys[input] = false;
return;
}
bool InputClass::IsKeyDown(unsigned int key)
{
// Return what state the key is in (pressed/not pressed).
return m_keys[key];
}
void InputClass::Shutdown()
{