9.2 C
New York
Monday, November 24, 2025

enter – GameInput::GetCurrentReading error – Recreation Growth Stack Alternate


I lastly created an account. I’ve began coding MS GameInput, and have an issue retrieving keystrokes. I feel I’ve a linking error however cannot make certain I simply began coding once more after 15 years. The entire NUGET factor is new to me however within the bundle config it is there



  
  
'

I am not crashing, the inputreading and the gadget will not be NULL; however the depend is zero and KeyState is NULL;
Within the debugger is says to load symbols for extra data so I am not doing one thing proper. This is some code known as within the sport loop:

 IGameInputReading* inputReading = NULL;
 GameInputKeyState* keyState = NULL;

  gameInput->GetCurrentReading(GameInputKindKeyboard, gameKeyboard, &inputReading);

  int depend = inputReading->GetKeyCount();

  inputReading->GetKeyState(depend, keyState);

  for (int ok = 0; ok < depend; ok++)
  {
      if (keyState[k].virtualKey == 0x57)
      {
          MessageBoxA(NULL, "Key Pressed", "w Key pressed", MB_OK);
      }
  }

forgive no error checking, it’s going to come

Edit: I regarded nearer on the debug string and it is this:

gameInput   0x0000022fadb55c70     IGameInput *

now should not that be gameinput.dll in that case what can I do?

This is a fundamental program I’ve:

#embody 
#embody 

IGameInput* gameInput = NULL;
IGameInputDevice* gameKeyboard = NULL;
IGameInputReading* inputReading = NULL;


int essential()
{
GameInputCreate(&gameInput);


// passing gameKeyboard as NULL gadget reads all gadgets related, nevertheless we're filtering to the keyboard
gameInput->GetCurrentReading(GameInputKindKeyboard, gameKeyboard, &inputReading);

if (inputReading)
    inputReading->GetDevice(&gameKeyboard);  // since filterd the one gadget IS the keyboard

whereas (true)
{
    inputReading = NULL;
    GameInputKeyState* keyState = NULL;

    gameInput->GetCurrentReading(GameInputKindKeyboard, gameKeyboard, &inputReading);

    if (inputReading)
    {
        int depend = inputReading->GetKeyCount();

        inputReading->GetKeyState(depend, keyState);

        if (keyState)
            for (int ok = 0; ok < depend; ok++)
            {
                if (keyState[k].virtualKey == 0x57)
                {
                    MessageBoxA(NULL, "Key Pressed", "w Key pressed", MB_OK);
                }
            }
    }

    if (inputReading)
       inputReading->Launch();
}

if (gameKeyboard) gameKeyboard->Launch();
if (gameInput) gameInput->Launch();

return 0;

}

I am nonetheless questioning concerning the debug symbols not being loaded although.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles