本文整理汇总了C++中AppWindow::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ AppWindow::Create方法的具体用法?C++ AppWindow::Create怎么用?C++ AppWindow::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppWindow
的用法示例。
在下文中一共展示了AppWindow::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) {
// Create and display the main window.
AppWindow mainWindow;
mainWindow.Create(hInstance);
ShowWindow(mainWindow.GetHWnd(), iCmdShow);
UpdateWindow(mainWindow.GetHWnd());
// Stay in the message loop until the application quits.
MSG message;
while (GetMessage(&message, NULL, 0, 0)) {
TranslateMessage(&message);
DispatchMessage(&message);
}
return (int)message.wParam;
}
示例2: wWinMain
int WINAPI wWinMain(
HINSTANCE hInstance, HINSTANCE hPrevInstance,
PWSTR pCmdLine, int nCmdShow)
{
auto hr = CoInitialize(nullptr);
if (FAILED(hr)) {
return -1;
}
AppWindow window;
hr = window.Create(hInstance);
if (FAILED(hr)) {
return -1;
}
window.Show(nCmdShow);
window.RunMessageLoop();
CoUninitialize();
return 0;
}
示例3: ProcessMessage
//.........这里部分代码省略.........
if (ui){
UIElement * element = ui->GetActiveElement();
if (element)
{
element->ProcessMessage(message);
}
}
}
}
case MessageType::STRING:
{
msg.SetComparisonMode(String::NOT_CASE_SENSITIVE);
if (msg.StartsWith("SetLight"))
{
Light::ProcessMessageStatic(message);
}
else if (msg == "ToggleMute")
{
// Mute?
QueueAudio(new AMGlobal(AM_TOGGLE_MUTE));
}
else if (msg.StartsWith("SetGravity"))
{
String gravStr = msg.Tokenize("()")[1];
Vector3f grav;
grav.ReadFrom(gravStr);
PhysicsQueue.Add(new PMSet(PT_GRAVITY, grav));
}
else if (msg.StartsWith("AdjustMasterVolume("))
{
float diff = msg.Tokenize("()")[1].ParseFloat();
QueueAudio(new AMSet(AT_MASTER_VOLUME, AudioMan.MasterVolume() + diff));
}
else if (msg == "CreateEditorCamera")
{
CreateEditorCamera();
}
else if (msg.Contains("CreateNormalMapTestEntities"))
{
// Create some entities.
Entity * entity = MapMan.CreateEntity("NormalMapSprite", ModelMan.GetModel("sprite.obj"), TexMan.GetTexture("0x77"), Vector3f(0,0,0));
GraphicsQueue.Add(new GMSetEntityTexture(entity, NORMAL_MAP, "normalMapTest2"));
}
if (msg == "AcceptInput:false")
inputState->acceptInput = false;
else if (msg.Contains("InputMan.printHoverElement"))
InputMan.printHoverElement = !InputMan.printHoverElement;
else if (msg == "SetGlobalState:NULL")
StateMan.SetGlobalState(NULL);
else if (msg == "SetActiveState:NULL")
StateMan.SetActiveState(NULL);
else if (msg == "StateMan.DeleteStates")
StateMan.DeleteStates();
else if (msg == "NetworkMan.Shutdown")
NetworkMan.Shutdown();
else if (msg == "StateMan.Shutdown")
StateMan.shouldLive = false;
else if (msg == "MultimediaMan.Shutdown")
MultimediaMan.Shutdown();
else if (msg == "AudioMan.Shutdown")
AudioMan.QueueMessage(new AMGlobal(AM_SHUTDOWN));
else if (msg == "GraphicsMan.Shutdown")
Graphics.QueueMessage(new GraphicsMessage(GM_SHUTDOWN));
else if (msg == "PrintScreenshot")
{
Graphics.QueueMessage(new GraphicsMessage(GM_PRINT_SCREENSHOT));