Skip to content

Commit

Permalink
Fix Win32_Dx11
Browse files Browse the repository at this point in the history
  • Loading branch information
soufianekhiat committed May 29, 2024
1 parent ae0632b commit d6f27fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions ImPlatform/ImPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ namespace ImPlatform
if ( PlatformData.pD3D->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &PlatformData.oD3Dpp, &PlatformData.pD3DDevice ) < 0 )
return false;

return true;

#elif (IM_CURRENT_GFX == IM_GFX_DIRECTX10)

// Setup swap chain
Expand Down Expand Up @@ -412,6 +410,7 @@ namespace ImPlatform
{
PlatformData.pD3DDevice->Release();
PlatformData.pD3DDevice = nullptr;
}
#elif (IM_CURRENT_GFX == IM_GFX_DIRECTX12)
ImCleanupRenderTarget();
if ( PlatformData.pSwapChain )
Expand Down Expand Up @@ -479,7 +478,7 @@ namespace ImPlatform
ImGui_ImplDX9_CreateDeviceObjects();
}
#endif
#elif IM_CURRENT_PLATFORM == IM_PLATFORM_WIN32 && (IM_CURRENT_GFX == IM_GFX_OPENGL2 || IM_CURRENT_GFX == IM_GFX_OPENGL3)
#elif ((IM_CURRENT_PLATFORM == IM_PLATFORM_WIN32) && (IM_CURRENT_GFX == IM_GFX_OPENGL2 || IM_CURRENT_GFX == IM_GFX_OPENGL3))

bool ImCreateDeviceWGL( HWND hWnd, PlatformDataImpl::WGL_WindowData* data )
{
Expand Down
5 changes: 3 additions & 2 deletions ImPlatformDemo/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
// Or a permutation, Not all permutation are valid for instance __DEAR_MAC__ + __DEAR_GFX_DX11__
#define __DEAR_GLFW__
//#define __DEAR_WIN__
#define __DEAR_GFX_OGL2__
//#define __DEAR_GFX_DX11__
#define __DEAR_GFX_OGL3__
//#define IM_CURRENT_TARGET IM_TARGET_GLFW_OPENGL3
#include <ImPlatform.h>

#include <stdio.h>

#define SIMPLE_API 0
#define SIMPLE_API 1

int main()
{
Expand Down

0 comments on commit d6f27fe

Please sign in to comment.