从窗口过程中的原始输入传递值
目前,这是我的窗口过程 (WINDPROC) 中的 WM_INPUT 情况。
case WM_INPUT:
{
// ... Some code to pull out the input from the message
if(InputType == Keyboard)
{
if(KeyCode == KEY_W)
{
// Do Stuff Here
}
}
// And so on...
}
但是,我希望能够执行以下操作...
if(KeyCode == KEY_W)
{
g_InputManager->PressKey(KEY_W);
}
以便我的游戏引擎知道何时按下某个键,我想知道如何将数据输入/输出窗口过程,或者如何处理外部的原始输入的窗口过程。 提前致谢。
Currently, this is the WM_INPUT case in my Window Procedure (WINDPROC).
case WM_INPUT:
{
// ... Some code to pull out the input from the message
if(InputType == Keyboard)
{
if(KeyCode == KEY_W)
{
// Do Stuff Here
}
}
// And so on...
}
But, I want to be able to do the following...
if(KeyCode == KEY_W)
{
g_InputManager->PressKey(KEY_W);
}
So that my game engine knows when a key is pressed, I would like to know how to get data in/out of the window procedure, or how to process raw input outside of the window procedure.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个非常简单的问题,我发现现在我所做的就是创建一个全局类指针,将其暴露给窗口过程,然后用它将数据推送到外部类。
This was a pretty simple question and I see that now, all I did was make a global class pointer, exposed it to the window procedure, and then used it to push data to the external class.