compiling tutorial 1 with mygui

nevarim

07-08-2011 14:01:32

hi all i have some warning with mygui with new versin, it seems that are some function deprecated

1>------ Build started: Project: DECAHandling, Configuration: Debug Win32 ------
1> DECAHandling.cpp
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(441): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyPress': is deprecated, use : bool InputManager::injectKeyPress(KeyCode _key, Char _text = 0)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(442) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyPress'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(536): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyRelease': is deprecated, use : bool InputManager::injectKeyRelease(KeyCode _key)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(444) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyRelease'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(543): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseMove': is deprecated, use : bool InputManager::injectMouseMove(int _absx, int _absy, int _absz)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(436) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseMove'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(551): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMousePress': is deprecated, use : bool InputManager::injectMousePress(int _absx, int _absy, MouseButton _id)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(438) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMousePress'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(559): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseRelease': is deprecated, use : bool InputManager::injectMouseRelease(int _absx, int _absy, MouseButton _id)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(440) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseRelease'
1> DECAHandling.vcxproj -> D:\ogre\Hadling\DECAHandling\DECAHandling\bin\Debug\DECAHandling.exe

MindCalamity

08-08-2011 00:37:58

hi all i have some warning with mygui with new versin, it seems that are some function deprecated

1>------ Build started: Project: DECAHandling, Configuration: Debug Win32 ------
1> DECAHandling.cpp
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(441): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyPress': is deprecated, use : bool InputManager::injectKeyPress(KeyCode _key, Char _text = 0)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(442) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyPress'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(536): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyRelease': is deprecated, use : bool InputManager::injectKeyRelease(KeyCode _key)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(444) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectKeyRelease'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(543): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseMove': is deprecated, use : bool InputManager::injectMouseMove(int _absx, int _absy, int _absz)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(436) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseMove'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(551): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMousePress': is deprecated, use : bool InputManager::injectMousePress(int _absx, int _absy, MouseButton _id)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(438) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMousePress'
1>d:\ogre\hadling\decahandling\decahandling\src\decahandling.cpp(559): warning C4996: 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseRelease': is deprecated, use : bool InputManager::injectMouseRelease(int _absx, int _absy, MouseButton _id)
1> d:\ogre\addon\mygui\myguiengine\include\mygui_backwardcompatibility.h(440) : see declaration of 'MyGUI::MemberObsolete<MyGUI::Gui>::injectMouseRelease'
1> DECAHandling.vcxproj -> D:\ogre\Hadling\DECAHandling\DECAHandling\bin\Debug\DECAHandling.exe


Those are just warnings, I recommend replacing your inject code from

mGUI->injectKeyPress()

to

MyGUI::InputManager::getInstancePtr()->injectKeyPress();

Basically you just replace the old way of injecting input to MyGUI with the nw one, using the Input Manager (the pointer to it).

Do this for every instance of injecting input in your code.

EDIT: Here's my code, for reference:

bool App::keyPressed(const OIS::KeyEvent &arg)
{
MyGUI::InputManager::getInstancePtr()->injectKeyPress(MyGUI::KeyCode::Enum(arg.key), arg.text);

return true;
}
//-------------------------------------------------------------------------------------
bool App::keyReleased(const OIS::KeyEvent &arg)
{
MyGUI::InputManager::getInstancePtr()->injectKeyRelease(MyGUI::KeyCode::Enum(arg.key));

return true;
}
//-------------------------------------------------------------------------------------
bool App::mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id)
{
MyGUI::InputManager::getInstancePtr()->injectMousePress(arg.state.X.abs, arg.state.Y.abs, MyGUI::MouseButton::Enum(id));

return true;
}
//-------------------------------------------------------------------------------------
bool App::mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id)
{
MyGUI::InputManager::getInstancePtr()->injectMouseRelease(arg.state.X.abs, arg.state.Y.abs, MyGUI::MouseButton::Enum(id));

return true;
}
//-------------------------------------------------------------------------------------
bool App::mouseMoved(const OIS::MouseEvent &arg)
{
MyGUI::InputManager::getInstancePtr()->injectMouseMove(arg.state.X.abs, arg.state.Y.abs, arg.state.Z.abs);

return true;
}

Altren

08-08-2011 07:40:01

Thank you for noticing. I fixed wiki page.

nevarim

08-08-2011 08:27:34

thanks for reply :)