daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
| 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // Display.cpp: Implements the egl::Display class, representing the abstract |
| 8 | // display on which graphics are drawn. Implements EGLDisplay. |
| 9 | // [EGL 1.4] section 2.1.2 page 3. |
| 10 | |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame] | 11 | #include "libEGL/Display.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 12 | |
daniel@transgaming.com | 1697302 | 2010-03-11 19:22:19 +0000 | [diff] [blame] | 13 | #include <algorithm> |
| 14 | #include <vector> |
| 15 | |
alokp@chromium.org | ea0e1af | 2010-03-22 19:33:14 +0000 | [diff] [blame] | 16 | #include "common/debug.h" |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 17 | |
daniel@transgaming.com | bbf56f7 | 2010-04-20 18:52:13 +0000 | [diff] [blame] | 18 | #include "libEGL/main.h" |
| 19 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 20 | namespace egl |
| 21 | { |
| 22 | Display::Display(HDC deviceContext) : mDc(deviceContext) |
| 23 | { |
| 24 | mD3d9 = NULL; |
| 25 | mDevice = NULL; |
| 26 | |
| 27 | mAdapter = D3DADAPTER_DEFAULT; |
| 28 | mDeviceType = D3DDEVTYPE_HAL; |
| 29 | } |
| 30 | |
| 31 | Display::~Display() |
| 32 | { |
| 33 | terminate(); |
| 34 | } |
| 35 | |
| 36 | bool Display::initialize() |
| 37 | { |
| 38 | if (isInitialized()) |
| 39 | { |
| 40 | return true; |
| 41 | } |
| 42 | |
| 43 | mD3d9 = Direct3DCreate9(D3D_SDK_VERSION); |
| 44 | |
| 45 | if (mD3d9) |
| 46 | { |
| 47 | if (mDc != NULL) |
| 48 | { |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 49 | // UNIMPLEMENTED(); // FIXME: Determine which adapter index the device context corresponds to |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | D3DCAPS9 caps; |
| 53 | HRESULT result = mD3d9->GetDeviceCaps(mAdapter, mDeviceType, &caps); |
| 54 | |
| 55 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 56 | { |
| 57 | return error(EGL_BAD_ALLOC, false); |
| 58 | } |
| 59 | |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 60 | if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 61 | { |
| 62 | mD3d9->Release(); |
| 63 | mD3d9 = NULL; |
| 64 | } |
| 65 | else |
| 66 | { |
| 67 | EGLint minSwapInterval = 4; |
| 68 | EGLint maxSwapInterval = 0; |
| 69 | |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 70 | if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) {minSwapInterval = std::min(minSwapInterval, 0); maxSwapInterval = std::max(maxSwapInterval, 0);} |
| 71 | if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) {minSwapInterval = std::min(minSwapInterval, 1); maxSwapInterval = std::max(maxSwapInterval, 1);} |
| 72 | if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO) {minSwapInterval = std::min(minSwapInterval, 2); maxSwapInterval = std::max(maxSwapInterval, 2);} |
| 73 | if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_THREE) {minSwapInterval = std::min(minSwapInterval, 3); maxSwapInterval = std::max(maxSwapInterval, 3);} |
| 74 | if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR) {minSwapInterval = std::min(minSwapInterval, 4); maxSwapInterval = std::max(maxSwapInterval, 4);} |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 75 | |
| 76 | const D3DFORMAT adapterFormats[] = |
| 77 | { |
| 78 | D3DFMT_A1R5G5B5, |
daniel@transgaming.com | e8c0ca2 | 2010-04-20 18:52:47 +0000 | [diff] [blame] | 79 | //D3DFMT_A2R10G10B10, // The color_ramp conformance test uses ReadPixels with UNSIGNED_BYTE causing it to think that rendering skipped a colour value. |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 80 | D3DFMT_A8R8G8B8, |
| 81 | D3DFMT_R5G6B5, |
| 82 | D3DFMT_X1R5G5B5, |
| 83 | D3DFMT_X8R8G8B8 |
| 84 | }; |
| 85 | |
| 86 | const D3DFORMAT depthStencilFormats[] = |
| 87 | { |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 88 | // D3DFMT_D16_LOCKABLE, |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 89 | D3DFMT_D32, |
| 90 | D3DFMT_D15S1, |
| 91 | D3DFMT_D24S8, |
| 92 | D3DFMT_D24X8, |
| 93 | D3DFMT_D24X4S4, |
| 94 | D3DFMT_D16, |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 95 | // D3DFMT_D32F_LOCKABLE, |
| 96 | // D3DFMT_D24FS8 |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 97 | }; |
| 98 | |
| 99 | D3DDISPLAYMODE currentDisplayMode; |
| 100 | mD3d9->GetAdapterDisplayMode(mAdapter, ¤tDisplayMode); |
| 101 | |
| 102 | for (int formatIndex = 0; formatIndex < sizeof(adapterFormats) / sizeof(D3DFORMAT); formatIndex++) |
| 103 | { |
| 104 | D3DFORMAT renderTargetFormat = adapterFormats[formatIndex]; |
| 105 | |
| 106 | HRESULT result = mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, renderTargetFormat); |
| 107 | |
| 108 | if (SUCCEEDED(result)) |
| 109 | { |
| 110 | for (int depthStencilIndex = 0; depthStencilIndex < sizeof(depthStencilFormats) / sizeof(D3DFORMAT); depthStencilIndex++) |
| 111 | { |
| 112 | D3DFORMAT depthStencilFormat = depthStencilFormats[depthStencilIndex]; |
| 113 | HRESULT result = mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, depthStencilFormat); |
| 114 | |
| 115 | if (SUCCEEDED(result)) |
| 116 | { |
| 117 | HRESULT result = mD3d9->CheckDepthStencilMatch(mAdapter, mDeviceType, currentDisplayMode.Format, renderTargetFormat, depthStencilFormat); // FIXME: Only accept color formats available both in fullscreen and windowed? |
daniel@transgaming.com | fab5a1a | 2010-03-11 19:22:30 +0000 | [diff] [blame] | 118 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 119 | if (SUCCEEDED(result)) |
| 120 | { |
| 121 | // FIXME: Enumerate multi-sampling |
| 122 | |
| 123 | mConfigSet.add(currentDisplayMode, minSwapInterval, maxSwapInterval, renderTargetFormat, depthStencilFormat, 0); |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | mConfigSet.enumerate(); |
| 132 | } |
| 133 | |
| 134 | if (!isInitialized()) |
| 135 | { |
| 136 | terminate(); |
| 137 | |
| 138 | return false; |
| 139 | } |
| 140 | |
| 141 | return true; |
| 142 | } |
| 143 | |
| 144 | void Display::terminate() |
| 145 | { |
| 146 | for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) |
| 147 | { |
| 148 | delete *surface; |
| 149 | } |
| 150 | |
| 151 | for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++) |
| 152 | { |
| 153 | glDestroyContext(*context); |
| 154 | } |
| 155 | |
| 156 | if (mDevice) |
| 157 | { |
| 158 | mDevice->Release(); |
| 159 | mDevice = NULL; |
| 160 | } |
| 161 | |
| 162 | if (mD3d9) |
| 163 | { |
| 164 | mD3d9->Release(); |
| 165 | mD3d9 = NULL; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | bool Display::getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig) |
| 170 | { |
| 171 | return mConfigSet.getConfigs(configs, attribList, configSize, numConfig); |
| 172 | } |
| 173 | |
| 174 | bool Display::getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value) |
| 175 | { |
| 176 | const egl::Config *configuration = mConfigSet.get(config); |
| 177 | |
| 178 | switch (attribute) |
| 179 | { |
| 180 | case EGL_BUFFER_SIZE: *value = configuration->mBufferSize; break; |
| 181 | case EGL_ALPHA_SIZE: *value = configuration->mAlphaSize; break; |
| 182 | case EGL_BLUE_SIZE: *value = configuration->mBlueSize; break; |
| 183 | case EGL_GREEN_SIZE: *value = configuration->mGreenSize; break; |
| 184 | case EGL_RED_SIZE: *value = configuration->mRedSize; break; |
| 185 | case EGL_DEPTH_SIZE: *value = configuration->mDepthSize; break; |
| 186 | case EGL_STENCIL_SIZE: *value = configuration->mStencilSize; break; |
| 187 | case EGL_CONFIG_CAVEAT: *value = configuration->mConfigCaveat; break; |
| 188 | case EGL_CONFIG_ID: *value = configuration->mConfigID; break; |
| 189 | case EGL_LEVEL: *value = configuration->mLevel; break; |
| 190 | case EGL_NATIVE_RENDERABLE: *value = configuration->mNativeRenderable; break; |
| 191 | case EGL_NATIVE_VISUAL_TYPE: *value = configuration->mNativeVisualType; break; |
| 192 | case EGL_SAMPLES: *value = configuration->mSamples; break; |
| 193 | case EGL_SAMPLE_BUFFERS: *value = configuration->mSampleBuffers; break; |
| 194 | case EGL_SURFACE_TYPE: *value = configuration->mSurfaceType; break; |
| 195 | case EGL_TRANSPARENT_TYPE: *value = configuration->mTransparentType; break; |
| 196 | case EGL_TRANSPARENT_BLUE_VALUE: *value = configuration->mTransparentBlueValue; break; |
| 197 | case EGL_TRANSPARENT_GREEN_VALUE: *value = configuration->mTransparentGreenValue; break; |
| 198 | case EGL_TRANSPARENT_RED_VALUE: *value = configuration->mTransparentRedValue; break; |
| 199 | case EGL_BIND_TO_TEXTURE_RGB: *value = configuration->mBindToTextureRGB; break; |
| 200 | case EGL_BIND_TO_TEXTURE_RGBA: *value = configuration->mBindToTextureRGBA; break; |
| 201 | case EGL_MIN_SWAP_INTERVAL: *value = configuration->mMinSwapInterval; break; |
| 202 | case EGL_MAX_SWAP_INTERVAL: *value = configuration->mMaxSwapInterval; break; |
| 203 | case EGL_LUMINANCE_SIZE: *value = configuration->mLuminanceSize; break; |
| 204 | case EGL_ALPHA_MASK_SIZE: *value = configuration->mAlphaMaskSize; break; |
| 205 | case EGL_COLOR_BUFFER_TYPE: *value = configuration->mColorBufferType; break; |
| 206 | case EGL_RENDERABLE_TYPE: *value = configuration->mRenderableType; break; |
| 207 | case EGL_MATCH_NATIVE_PIXMAP: *value = false; UNIMPLEMENTED(); break; |
| 208 | case EGL_CONFORMANT: *value = configuration->mConformant; break; |
| 209 | default: |
| 210 | return false; |
| 211 | } |
| 212 | |
| 213 | return true; |
| 214 | } |
| 215 | |
| 216 | egl::Surface *Display::createWindowSurface(HWND window, EGLConfig config) |
| 217 | { |
| 218 | const egl::Config *configuration = mConfigSet.get(config); |
| 219 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 220 | D3DPRESENT_PARAMETERS presentParameters = {0}; |
| 221 | |
| 222 | presentParameters.AutoDepthStencilFormat = configuration->mDepthStencilFormat; |
| 223 | presentParameters.BackBufferCount = 1; |
| 224 | presentParameters.BackBufferFormat = configuration->mRenderTargetFormat; |
| 225 | presentParameters.BackBufferWidth = 0; |
| 226 | presentParameters.BackBufferHeight = 0; |
| 227 | presentParameters.EnableAutoDepthStencil = configuration->mDepthSize ? TRUE : FALSE; |
| 228 | presentParameters.Flags = 0; |
| 229 | presentParameters.hDeviceWindow = window; |
| 230 | presentParameters.MultiSampleQuality = 0; // FIXME: Unimplemented |
| 231 | presentParameters.MultiSampleType = D3DMULTISAMPLE_NONE; // FIXME: Unimplemented |
| 232 | presentParameters.PresentationInterval = configuration->mMinSwapInterval; |
| 233 | presentParameters.SwapEffect = D3DSWAPEFFECT_COPY; |
| 234 | presentParameters.Windowed = TRUE; // FIXME |
| 235 | |
| 236 | IDirect3DSwapChain9 *swapChain = NULL; |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 237 | IDirect3DSurface9 *depthStencilSurface = NULL; |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 238 | |
| 239 | if (!mDevice) |
| 240 | { |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 241 | DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES; |
| 242 | |
daniel@transgaming.com | c28e76b | 2010-05-05 18:47:16 +0000 | [diff] [blame^] | 243 | HRESULT result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 244 | |
| 245 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 246 | { |
| 247 | return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); |
| 248 | } |
| 249 | |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 250 | if (FAILED(result)) |
| 251 | { |
daniel@transgaming.com | c28e76b | 2010-05-05 18:47:16 +0000 | [diff] [blame^] | 252 | result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice); |
daniel@transgaming.com | 02bc159 | 2010-03-30 03:36:13 +0000 | [diff] [blame] | 253 | |
| 254 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 255 | { |
| 256 | return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); |
| 257 | } |
| 258 | } |
| 259 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 260 | ASSERT(SUCCEEDED(result)); |
| 261 | |
| 262 | if (mDevice) |
| 263 | { |
| 264 | mDevice->GetSwapChain(0, &swapChain); |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 265 | mDevice->GetDepthStencilSurface(&depthStencilSurface); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 266 | } |
| 267 | } |
| 268 | else |
| 269 | { |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 270 | if (!mSurfaceSet.empty()) |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 271 | { |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 272 | // if the device already exists, and there are other surfaces/windows currently in use, we need to create |
| 273 | // a separate swap chain for the new draw surface. |
| 274 | HRESULT result = mDevice->CreateAdditionalSwapChain(&presentParameters, &swapChain); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 275 | |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 276 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 277 | { |
| 278 | ERR("Could not create additional swap chains. Out of memory."); |
| 279 | return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); |
| 280 | } |
| 281 | |
| 282 | ASSERT(SUCCEEDED(result)); |
| 283 | |
| 284 | // CreateAdditionalSwapChain does not automatically generate a depthstencil surface, unlike |
| 285 | // CreateDevice, so we must do so explicitly. |
| 286 | result = mDevice->CreateDepthStencilSurface(presentParameters.BackBufferWidth, presentParameters.BackBufferHeight, |
| 287 | presentParameters.AutoDepthStencilFormat, presentParameters.MultiSampleType, |
| 288 | presentParameters.MultiSampleQuality, FALSE, &depthStencilSurface, NULL); |
| 289 | |
| 290 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 291 | { |
| 292 | swapChain->Release(); |
| 293 | ERR("Could not create depthstencil surface for new swap chain. Out of memory."); |
| 294 | return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); |
| 295 | } |
| 296 | |
| 297 | ASSERT(SUCCEEDED(result)); |
| 298 | } |
| 299 | else |
| 300 | { |
| 301 | // if the device already exists, but there are no surfaces in use, then all the surfaces/windows |
| 302 | // have been destroyed, and we should repurpose the originally created depthstencil surface for |
| 303 | // use with the new surface we are creating. |
| 304 | HRESULT result = mDevice->Reset(&presentParameters); |
| 305 | |
| 306 | if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) |
| 307 | { |
| 308 | ERR("Could not resent presentation parameters for device. Out of memory."); |
| 309 | return error(EGL_BAD_ALLOC, (egl::Surface*)NULL); |
| 310 | } |
| 311 | |
| 312 | ASSERT(SUCCEEDED(result)); |
| 313 | |
| 314 | if (mDevice) |
| 315 | { |
| 316 | mDevice->GetSwapChain(0, &swapChain); |
| 317 | mDevice->GetDepthStencilSurface(&depthStencilSurface); |
| 318 | } |
| 319 | } |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 320 | } |
| 321 | |
| 322 | Surface *surface = NULL; |
| 323 | |
| 324 | if (swapChain) |
| 325 | { |
daniel@transgaming.com | 0009d62 | 2010-03-16 06:23:31 +0000 | [diff] [blame] | 326 | surface = new Surface(mDevice, swapChain, depthStencilSurface, configuration->mConfigID); |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 327 | mSurfaceSet.insert(surface); |
| 328 | |
| 329 | swapChain->Release(); |
| 330 | } |
daniel@transgaming.com | fab5a1a | 2010-03-11 19:22:30 +0000 | [diff] [blame] | 331 | |
daniel@transgaming.com | 4f39fd9 | 2010-03-08 20:26:45 +0000 | [diff] [blame] | 332 | return surface; |
| 333 | } |
| 334 | |
| 335 | EGLContext Display::createContext(EGLConfig configHandle) |
| 336 | { |
| 337 | const egl::Config *config = mConfigSet.get(configHandle); |
| 338 | |
| 339 | gl::Context *context = glCreateContext(config); |
| 340 | mContextSet.insert(context); |
| 341 | |
| 342 | return context; |
| 343 | } |
| 344 | |
| 345 | void Display::destroySurface(egl::Surface *surface) |
| 346 | { |
| 347 | delete surface; |
| 348 | mSurfaceSet.erase(surface); |
| 349 | } |
| 350 | |
| 351 | void Display::destroyContext(gl::Context *context) |
| 352 | { |
| 353 | glDestroyContext(context); |
| 354 | mContextSet.erase(context); |
| 355 | } |
| 356 | |
| 357 | bool Display::isInitialized() |
| 358 | { |
| 359 | return mD3d9 != NULL && mConfigSet.size() > 0; |
| 360 | } |
| 361 | |
| 362 | bool Display::isValidConfig(EGLConfig config) |
| 363 | { |
| 364 | return mConfigSet.get(config) != NULL; |
| 365 | } |
| 366 | |
| 367 | bool Display::isValidContext(gl::Context *context) |
| 368 | { |
| 369 | return mContextSet.find(context) != mContextSet.end(); |
| 370 | } |
| 371 | |
| 372 | bool Display::isValidSurface(egl::Surface *surface) |
| 373 | { |
| 374 | return mSurfaceSet.find(surface) != mSurfaceSet.end(); |
| 375 | } |
| 376 | |
| 377 | bool Display::hasExistingWindowSurface(HWND window) |
| 378 | { |
| 379 | for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) |
| 380 | { |
| 381 | if ((*surface)->getWindowHandle() == window) |
| 382 | { |
| 383 | return true; |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | return false; |
| 388 | } |
| 389 | |
| 390 | IDirect3DDevice9 *Display::getDevice() |
| 391 | { |
| 392 | return mDevice; |
| 393 | } |
| 394 | } |