From d3748a48ea2718444e710a668664b0ad7b65a371 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Sat, 3 Feb 2018 10:20:05 -0800 Subject: Updated Engine GL initialization --- Projects/Asteroids/src/asteroids_DE.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Projects/Asteroids/src/asteroids_DE.cpp') diff --git a/Projects/Asteroids/src/asteroids_DE.cpp b/Projects/Asteroids/src/asteroids_DE.cpp index 7593f36..d620d29 100644 --- a/Projects/Asteroids/src/asteroids_DE.cpp +++ b/Projects/Asteroids/src/asteroids_DE.cpp @@ -51,8 +51,6 @@ namespace AsteroidsDE { // Create Direct3D device and swap chain void Asteroids::InitDevice(HWND hWnd, DeviceType DevType) { - EngineCreationAttribs EngineCreationAttribs; - EngineCreationAttribs.strShaderCachePath = "bin\\tmp\\ShaderCache"; SwapChainDesc SwapChainDesc; SwapChainDesc.SamplesCount = 1; SwapChainDesc.BufferCount = NUM_SWAP_CHAIN_BUFFERS; @@ -104,14 +102,18 @@ void Asteroids::InitDevice(HWND hWnd, DeviceType DevType) break; case DeviceType::OpenGL: + { #ifdef ENGINE_DLL - if(GetEngineFactoryOpenGL == nullptr) + if (GetEngineFactoryOpenGL == nullptr) { LoadGraphicsEngineOpenGL(GetEngineFactoryOpenGL); } #endif + EngineGLAttribs CreationAttribs; + CreationAttribs.pNativeWndHandle = hWnd; GetEngineFactoryOpenGL()->CreateDeviceAndSwapChainGL( - EngineCreationAttribs, &mDevice, &mDeviceCtxt, SwapChainDesc, hWnd, &mSwapChain ); + CreationAttribs, &mDevice, &mDeviceCtxt, SwapChainDesc, &mSwapChain); + } break; default: -- cgit v1.2.3