Game Development Reference
In-Depth Information
switch (m.Msg)
{
case WM_LBUTTONDOWN:
case WM_LBUTTONUP:
case WM_LBUTTONDBLCLK:
case WM_RBUTTONDOWN:
case WM_RBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK:
case WM_KEYDOWN:
case WM_KEYUP:
case WM_SYSKEYDOWN:
case WM_SYSKEYUP:
case WM_CLOSE:
{
NativeMethods.WndProc(m_displayPanelHandle,
m.Msg, m.WParam.ToInt32(), m.LParam.ToInt32());
// If the left mouse button is up, try doing a
// raycast to see if it intersects with an actor
if (m.Msg == WM_LBUTTONUP)
{
m_parent.SelectActor();
}
return true;
}
}
}
return false;
}
This class determines if the window handle for these messages matches either the
handle for the EngineDisplayForm , which contains the entire editor interface, or
the DisplayPanel , which is a placeholder for the graphics display rendered by the
EditorHumanView . If this were a message that occurred on another part of the edi-
tor, such as the game assets tree or the component editor, PreFilterMessage()
would simply ignore the message.
One message that the C# editor application needs to trap is WM_LBUTTONUP . This
will call EngineDisplayForm::SelectActor() so that you can click directly on
the actor you are
interested in and have
its properties
show up in the
ActorPropertiesForm .
Search WWH ::




Custom Search