| 207 | } |
| 208 | |
| 209 | PlatformWindow *Win32WindowManager::createWindow(GFXDevice *device, const GFXVideoMode &mode) |
| 210 | { |
| 211 | // Do the allocation. |
| 212 | Win32Window *w32w = new Win32Window(); |
| 213 | w32w->setOffscreenRender(mOffscreenRender); |
| 214 | w32w->mWindowId = getNextId(); |
| 215 | w32w->mOwningManager = this; |
| 216 | |
| 217 | // Link into our list of windows. |
| 218 | linkWindow(w32w); |
| 219 | |
| 220 | DWORD dwExStyle; |
| 221 | DWORD dwStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS; |
| 222 | dwStyle |= WS_OVERLAPPEDWINDOW | WS_THICKFRAME | WS_CAPTION; |
| 223 | dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; |
| 224 | |
| 225 | // If we're parented, we want a different set of window styles. |
| 226 | if(mParentWindow) |
| 227 | dwStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CHILDWINDOW; |
| 228 | |
| 229 | if (mOffscreenRender) |
| 230 | { |
| 231 | dwStyle = WS_OVERLAPPEDWINDOW; |
| 232 | dwExStyle = 0; |
| 233 | } |
| 234 | |
| 235 | // Create the window handle |
| 236 | w32w->mWindowHandle = CreateWindowEx( |
| 237 | dwExStyle, |
| 238 | Win32Window::getWindowClassName(), //class name |
| 239 | String( getEngineProductString() ).utf16(), //window title |
| 240 | dwStyle, //style - need clip siblings/children for opengl |
| 241 | 0, |
| 242 | 0, |
| 243 | 0, |
| 244 | 0, |
| 245 | mParentWindow, //parent window |
| 246 | NULL, //menu? No. |
| 247 | NULL, //the hInstance |
| 248 | NULL ); //no funky params |
| 249 | |
| 250 | // Note the style we created with so we can switch back to it when we're |
| 251 | // done with full-screen mode. |
| 252 | w32w->mWindowedWindowStyle = dwStyle; |
| 253 | |
| 254 | // Set the video mode on the window |
| 255 | w32w->setVideoMode(mode); |
| 256 | |
| 257 | // Associate our window struct with the HWND. |
| 258 | SetWindowLongPtr(w32w->mWindowHandle, GWLP_USERDATA, (LONG_PTR)w32w); |
| 259 | |
| 260 | // Do some error checking. |
| 261 | AssertFatal(w32w->mWindowHandle != NULL, "Win32WindowManager::createWindow - Could not create window!"); |
| 262 | if(w32w->mWindowHandle == NULL) |
| 263 | { |
| 264 | Con::errorf("Win32WindowManager::createWindow - Could not create window!"); |
| 265 | delete w32w; |
| 266 | return NULL; |
nothing calls this directly
no test coverage detected