// 初期化。 bool Create(HWND hWnd) { if (failed(_window.Create(hWnd))) { return false; } SIZE sz; _window.GetClientSize(sz); { using namespace std::placeholders; _window.AddMessageHandler(WM_SIZE, std::bind(&Impl::OnWindowSizeMessage, this, _1, _2, _3, _4)); _window.AddMessageHandler(WM_KEYUP, std::bind(&Impl::OnWindowKeyUpMessage, this, _1, _2, _3, _4)); } if (failed(_device.Create(hWnd))) { return false; } if (failed(_renderer.Create(_device))) { return false; } if (failed(CreateModel())) { return false; } ResetProjectionTransform(sz); return true; }
DeviceHandle CreateDevice(const DeviceParameters& dp) { Device* newDevice = new Device(); DeviceHandle newHandle; if (newDevice->Create(dp) == true) { newHandle = DeviceHandle(newDevice, DestroyDevice); } return newHandle; }