blob: 39949b2f21efdb1100c65d7c4bc3b2eac8bf120e [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
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.combbf56f72010-04-20 18:52:13 +000011#include "libEGL/Display.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000012
daniel@transgaming.com16973022010-03-11 19:22:19 +000013#include <algorithm>
14#include <vector>
15
alokp@chromium.orgea0e1af2010-03-22 19:33:14 +000016#include "common/debug.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000017
daniel@transgaming.combbf56f72010-04-20 18:52:13 +000018#include "libEGL/main.h"
19
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000020namespace egl
21{
22Display::Display(HDC deviceContext) : mDc(deviceContext)
23{
24 mD3d9 = NULL;
25 mDevice = NULL;
26
27 mAdapter = D3DADAPTER_DEFAULT;
28 mDeviceType = D3DDEVTYPE_HAL;
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +000029
30 mMinSwapInterval = 1;
31 mMaxSwapInterval = 1;
32 setSwapInterval(1);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000033}
34
35Display::~Display()
36{
37 terminate();
38}
39
40bool Display::initialize()
41{
42 if (isInitialized())
43 {
44 return true;
45 }
46
47 mD3d9 = Direct3DCreate9(D3D_SDK_VERSION);
48
49 if (mD3d9)
50 {
51 if (mDc != NULL)
52 {
daniel@transgaming.com02bc1592010-03-30 03:36:13 +000053 // UNIMPLEMENTED(); // FIXME: Determine which adapter index the device context corresponds to
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000054 }
55
56 D3DCAPS9 caps;
57 HRESULT result = mD3d9->GetDeviceCaps(mAdapter, mDeviceType, &caps);
58
59 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
60 {
61 return error(EGL_BAD_ALLOC, false);
62 }
63
daniel@transgaming.com02bc1592010-03-30 03:36:13 +000064 if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0))
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000065 {
66 mD3d9->Release();
67 mD3d9 = NULL;
68 }
69 else
70 {
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +000071 mMinSwapInterval = 4;
72 mMaxSwapInterval = 0;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000073
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +000074 if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) {mMinSwapInterval = std::min(mMinSwapInterval, 0); mMaxSwapInterval = std::max(mMaxSwapInterval, 0);}
75 if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) {mMinSwapInterval = std::min(mMinSwapInterval, 1); mMaxSwapInterval = std::max(mMaxSwapInterval, 1);}
76 if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_TWO) {mMinSwapInterval = std::min(mMinSwapInterval, 2); mMaxSwapInterval = std::max(mMaxSwapInterval, 2);}
77 if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_THREE) {mMinSwapInterval = std::min(mMinSwapInterval, 3); mMaxSwapInterval = std::max(mMaxSwapInterval, 3);}
78 if (caps.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR) {mMinSwapInterval = std::min(mMinSwapInterval, 4); mMaxSwapInterval = std::max(mMaxSwapInterval, 4);}
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000079
daniel@transgaming.comadf02842010-05-07 13:03:33 +000080 const D3DFORMAT renderTargetFormats[] =
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000081 {
82 D3DFMT_A1R5G5B5,
daniel@transgaming.comadf02842010-05-07 13:03:33 +000083 // D3DFMT_A2R10G10B10, // The color_ramp conformance test uses ReadPixels with UNSIGNED_BYTE causing it to think that rendering skipped a colour value.
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000084 D3DFMT_A8R8G8B8,
85 D3DFMT_R5G6B5,
86 D3DFMT_X1R5G5B5,
87 D3DFMT_X8R8G8B8
88 };
89
90 const D3DFORMAT depthStencilFormats[] =
91 {
daniel@transgaming.com02bc1592010-03-30 03:36:13 +000092 // D3DFMT_D16_LOCKABLE,
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000093 D3DFMT_D32,
daniel@transgaming.comd1f6fde2010-05-07 19:01:43 +000094 // D3DFMT_D15S1,
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000095 D3DFMT_D24S8,
96 D3DFMT_D24X8,
daniel@transgaming.comd1f6fde2010-05-07 19:01:43 +000097 // D3DFMT_D24X4S4,
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000098 D3DFMT_D16,
daniel@transgaming.com02bc1592010-03-30 03:36:13 +000099 // D3DFMT_D32F_LOCKABLE,
100 // D3DFMT_D24FS8
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000101 };
102
103 D3DDISPLAYMODE currentDisplayMode;
104 mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
105
daniel@transgaming.com178adff2010-05-18 18:52:04 +0000106 ConfigSet configSet;
107
daniel@transgaming.comadf02842010-05-07 13:03:33 +0000108 for (int formatIndex = 0; formatIndex < sizeof(renderTargetFormats) / sizeof(D3DFORMAT); formatIndex++)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000109 {
daniel@transgaming.comadf02842010-05-07 13:03:33 +0000110 D3DFORMAT renderTargetFormat = renderTargetFormats[formatIndex];
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000111
112 HRESULT result = mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, renderTargetFormat);
113
114 if (SUCCEEDED(result))
115 {
116 for (int depthStencilIndex = 0; depthStencilIndex < sizeof(depthStencilFormats) / sizeof(D3DFORMAT); depthStencilIndex++)
117 {
118 D3DFORMAT depthStencilFormat = depthStencilFormats[depthStencilIndex];
119 HRESULT result = mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_SURFACE, depthStencilFormat);
120
121 if (SUCCEEDED(result))
122 {
daniel@transgaming.comadf02842010-05-07 13:03:33 +0000123 HRESULT result = mD3d9->CheckDepthStencilMatch(mAdapter, mDeviceType, currentDisplayMode.Format, renderTargetFormat, depthStencilFormat);
daniel@transgaming.comfab5a1a2010-03-11 19:22:30 +0000124
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000125 if (SUCCEEDED(result))
126 {
127 // FIXME: Enumerate multi-sampling
128
daniel@transgaming.com178adff2010-05-18 18:52:04 +0000129 configSet.add(currentDisplayMode, mMinSwapInterval, mMaxSwapInterval, renderTargetFormat, depthStencilFormat, 0);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000130 }
131 }
132 }
133 }
134 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000135
daniel@transgaming.com178adff2010-05-18 18:52:04 +0000136 // Give the sorted configs a unique ID and store them internally
137 EGLint index = 1;
138 for (ConfigSet::Iterator config = configSet.mSet.begin(); config != configSet.mSet.end(); config++)
139 {
140 Config configuration = *config;
141 configuration.mConfigID = index;
142 index++;
143
144 mConfigSet.mSet.insert(configuration);
145 }
146 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000147 }
148
149 if (!isInitialized())
150 {
151 terminate();
152
153 return false;
154 }
155
156 return true;
157}
158
159void Display::terminate()
160{
161 for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
162 {
163 delete *surface;
164 }
165
166 for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++)
167 {
168 glDestroyContext(*context);
169 }
170
171 if (mDevice)
172 {
173 mDevice->Release();
174 mDevice = NULL;
175 }
176
177 if (mD3d9)
178 {
179 mD3d9->Release();
180 mD3d9 = NULL;
181 }
182}
183
daniel@transgaming.comae072af2010-05-05 18:47:28 +0000184void Display::startScene()
185{
186 if (!mSceneStarted)
187 {
188 long result = mDevice->BeginScene();
189 ASSERT(SUCCEEDED(result));
190 mSceneStarted = true;
191 }
192}
193
194void Display::endScene()
195{
196 if (mSceneStarted)
197 {
198 long result = mDevice->EndScene();
199 ASSERT(SUCCEEDED(result));
200 mSceneStarted = false;
201 }
202}
203
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000204bool Display::getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig)
205{
206 return mConfigSet.getConfigs(configs, attribList, configSize, numConfig);
207}
208
209bool Display::getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value)
210{
211 const egl::Config *configuration = mConfigSet.get(config);
212
213 switch (attribute)
214 {
215 case EGL_BUFFER_SIZE: *value = configuration->mBufferSize; break;
216 case EGL_ALPHA_SIZE: *value = configuration->mAlphaSize; break;
217 case EGL_BLUE_SIZE: *value = configuration->mBlueSize; break;
218 case EGL_GREEN_SIZE: *value = configuration->mGreenSize; break;
219 case EGL_RED_SIZE: *value = configuration->mRedSize; break;
220 case EGL_DEPTH_SIZE: *value = configuration->mDepthSize; break;
221 case EGL_STENCIL_SIZE: *value = configuration->mStencilSize; break;
222 case EGL_CONFIG_CAVEAT: *value = configuration->mConfigCaveat; break;
223 case EGL_CONFIG_ID: *value = configuration->mConfigID; break;
224 case EGL_LEVEL: *value = configuration->mLevel; break;
225 case EGL_NATIVE_RENDERABLE: *value = configuration->mNativeRenderable; break;
226 case EGL_NATIVE_VISUAL_TYPE: *value = configuration->mNativeVisualType; break;
227 case EGL_SAMPLES: *value = configuration->mSamples; break;
228 case EGL_SAMPLE_BUFFERS: *value = configuration->mSampleBuffers; break;
229 case EGL_SURFACE_TYPE: *value = configuration->mSurfaceType; break;
230 case EGL_TRANSPARENT_TYPE: *value = configuration->mTransparentType; break;
231 case EGL_TRANSPARENT_BLUE_VALUE: *value = configuration->mTransparentBlueValue; break;
232 case EGL_TRANSPARENT_GREEN_VALUE: *value = configuration->mTransparentGreenValue; break;
233 case EGL_TRANSPARENT_RED_VALUE: *value = configuration->mTransparentRedValue; break;
234 case EGL_BIND_TO_TEXTURE_RGB: *value = configuration->mBindToTextureRGB; break;
235 case EGL_BIND_TO_TEXTURE_RGBA: *value = configuration->mBindToTextureRGBA; break;
236 case EGL_MIN_SWAP_INTERVAL: *value = configuration->mMinSwapInterval; break;
237 case EGL_MAX_SWAP_INTERVAL: *value = configuration->mMaxSwapInterval; break;
238 case EGL_LUMINANCE_SIZE: *value = configuration->mLuminanceSize; break;
239 case EGL_ALPHA_MASK_SIZE: *value = configuration->mAlphaMaskSize; break;
240 case EGL_COLOR_BUFFER_TYPE: *value = configuration->mColorBufferType; break;
241 case EGL_RENDERABLE_TYPE: *value = configuration->mRenderableType; break;
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000242 case EGL_MATCH_NATIVE_PIXMAP: *value = false; UNIMPLEMENTED(); break;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000243 case EGL_CONFORMANT: *value = configuration->mConformant; break;
244 default:
245 return false;
246 }
247
248 return true;
249}
250
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000251Surface *Display::createWindowSurface(HWND window, EGLConfig config)
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000252{
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000253 const Config *configuration = mConfigSet.get(config);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000254
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000255 D3DPRESENT_PARAMETERS presentParameters = {0};
256
257 presentParameters.AutoDepthStencilFormat = configuration->mDepthStencilFormat;
258 presentParameters.BackBufferCount = 1;
259 presentParameters.BackBufferFormat = configuration->mRenderTargetFormat;
260 presentParameters.BackBufferWidth = 0;
261 presentParameters.BackBufferHeight = 0;
262 presentParameters.EnableAutoDepthStencil = configuration->mDepthSize ? TRUE : FALSE;
263 presentParameters.Flags = 0;
264 presentParameters.hDeviceWindow = window;
265 presentParameters.MultiSampleQuality = 0; // FIXME: Unimplemented
266 presentParameters.MultiSampleType = D3DMULTISAMPLE_NONE; // FIXME: Unimplemented
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +0000267 presentParameters.PresentationInterval = convertInterval(mMinSwapInterval);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000268 presentParameters.SwapEffect = D3DSWAPEFFECT_COPY;
269 presentParameters.Windowed = TRUE; // FIXME
270
271 IDirect3DSwapChain9 *swapChain = NULL;
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000272 IDirect3DSurface9 *depthStencilSurface = NULL;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000273
274 if (!mDevice)
275 {
daniel@transgaming.com02bc1592010-03-30 03:36:13 +0000276 DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES;
277
daniel@transgaming.comc28e76b2010-05-05 18:47:16 +0000278 HRESULT result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000279
280 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
281 {
282 return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
283 }
284
daniel@transgaming.com02bc1592010-03-30 03:36:13 +0000285 if (FAILED(result))
286 {
daniel@transgaming.comc28e76b2010-05-05 18:47:16 +0000287 result = mD3d9->CreateDevice(mAdapter, mDeviceType, window, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice);
daniel@transgaming.com02bc1592010-03-30 03:36:13 +0000288
289 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
290 {
291 return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
292 }
293 }
294
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000295 ASSERT(SUCCEEDED(result));
296
297 if (mDevice)
298 {
daniel@transgaming.comc9def0b2010-05-05 18:48:06 +0000299 mSceneStarted = false;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000300 mDevice->GetSwapChain(0, &swapChain);
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000301 mDevice->GetDepthStencilSurface(&depthStencilSurface);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000302 }
303 }
304 else
305 {
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000306 if (!mSurfaceSet.empty())
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000307 {
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000308 // if the device already exists, and there are other surfaces/windows currently in use, we need to create
309 // a separate swap chain for the new draw surface.
310 HRESULT result = mDevice->CreateAdditionalSwapChain(&presentParameters, &swapChain);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000311
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000312 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
313 {
314 ERR("Could not create additional swap chains. Out of memory.");
315 return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
316 }
317
318 ASSERT(SUCCEEDED(result));
319
320 // CreateAdditionalSwapChain does not automatically generate a depthstencil surface, unlike
321 // CreateDevice, so we must do so explicitly.
322 result = mDevice->CreateDepthStencilSurface(presentParameters.BackBufferWidth, presentParameters.BackBufferHeight,
323 presentParameters.AutoDepthStencilFormat, presentParameters.MultiSampleType,
324 presentParameters.MultiSampleQuality, FALSE, &depthStencilSurface, NULL);
325
326 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
327 {
328 swapChain->Release();
329 ERR("Could not create depthstencil surface for new swap chain. Out of memory.");
330 return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
331 }
332
333 ASSERT(SUCCEEDED(result));
334 }
335 else
336 {
337 // if the device already exists, but there are no surfaces in use, then all the surfaces/windows
338 // have been destroyed, and we should repurpose the originally created depthstencil surface for
339 // use with the new surface we are creating.
340 HRESULT result = mDevice->Reset(&presentParameters);
341
342 if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
343 {
daniel@transgaming.comc9def0b2010-05-05 18:48:06 +0000344 ERR("Could not reset presentation parameters for device. Out of memory.");
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000345 return error(EGL_BAD_ALLOC, (egl::Surface*)NULL);
346 }
347
348 ASSERT(SUCCEEDED(result));
349
350 if (mDevice)
351 {
daniel@transgaming.comc9def0b2010-05-05 18:48:06 +0000352 mSceneStarted = false;
daniel@transgaming.com0009d622010-03-16 06:23:31 +0000353 mDevice->GetSwapChain(0, &swapChain);
354 mDevice->GetDepthStencilSurface(&depthStencilSurface);
355 }
356 }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000357 }
358
359 Surface *surface = NULL;
360
361 if (swapChain)
362 {
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000363 surface = new Surface(this, swapChain, depthStencilSurface, configuration);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000364 mSurfaceSet.insert(surface);
365
366 swapChain->Release();
367 }
daniel@transgaming.comfab5a1a2010-03-11 19:22:30 +0000368
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000369 return surface;
370}
371
372EGLContext Display::createContext(EGLConfig configHandle)
373{
374 const egl::Config *config = mConfigSet.get(configHandle);
375
376 gl::Context *context = glCreateContext(config);
377 mContextSet.insert(context);
378
379 return context;
380}
381
382void Display::destroySurface(egl::Surface *surface)
383{
384 delete surface;
385 mSurfaceSet.erase(surface);
386}
387
388void Display::destroyContext(gl::Context *context)
389{
390 glDestroyContext(context);
391 mContextSet.erase(context);
392}
393
394bool Display::isInitialized()
395{
396 return mD3d9 != NULL && mConfigSet.size() > 0;
397}
398
399bool Display::isValidConfig(EGLConfig config)
400{
401 return mConfigSet.get(config) != NULL;
402}
403
404bool Display::isValidContext(gl::Context *context)
405{
406 return mContextSet.find(context) != mContextSet.end();
407}
408
409bool Display::isValidSurface(egl::Surface *surface)
410{
411 return mSurfaceSet.find(surface) != mSurfaceSet.end();
412}
413
414bool Display::hasExistingWindowSurface(HWND window)
415{
416 for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
417 {
418 if ((*surface)->getWindowHandle() == window)
419 {
420 return true;
421 }
422 }
423
424 return false;
425}
426
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000427void Display::setSwapInterval(GLint interval)
428{
429 mSwapInterval = interval;
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +0000430 mSwapInterval = std::max(mSwapInterval, mMinSwapInterval);
431 mSwapInterval = std::min(mSwapInterval, mMaxSwapInterval);
432
433 mPresentInterval = convertInterval(mSwapInterval);
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000434}
435
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +0000436DWORD Display::getPresentInterval()
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000437{
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +0000438 return mPresentInterval;
439}
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000440
daniel@transgaming.com616ffcf2010-05-07 19:01:49 +0000441DWORD Display::convertInterval(GLint interval)
442{
daniel@transgaming.comb6bd7272010-05-05 18:48:22 +0000443 switch(interval)
444 {
445 case 0: return D3DPRESENT_INTERVAL_IMMEDIATE;
446 case 1: return D3DPRESENT_INTERVAL_ONE;
447 case 2: return D3DPRESENT_INTERVAL_TWO;
448 case 3: return D3DPRESENT_INTERVAL_THREE;
449 case 4: return D3DPRESENT_INTERVAL_FOUR;
450 default: UNREACHABLE();
451 }
452
453 return D3DPRESENT_INTERVAL_DEFAULT;
454}
455
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000456IDirect3DDevice9 *Display::getDevice()
457{
458 return mDevice;
459}
460}