Skip to content

simple build with win32 directx 11, imgui 1.8 and cmake builds.

Notifications You must be signed in to change notification settings

Lightnet/cmakewin32directx11

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cmakewin32directx11

License: MIT

Created by: Lightnet

Packages:

  • imgui 1.82
  • Directx SDK June 2010 (optional)
  • cmake 3.20
  • Visual Studio 2019 (compiler tool builder needed)
    • c/c++
    • cmake
    • directx sdk

Window Bit: 32

Information:

Note this is run on win32 bit. To build directx 11 to used imgui to display user interface. There are two chose that is Directx version. One is the Directx SDK June 2010 and the other is Visual Studio 2019 with directx sdk.

build:

  • install cmake
  • install visual studio 2019
    • c/c++
    • directx sdk
    • cmake
set(ENABLE_DXSDK OFF) # Directx SDK june 2010
set(ENABLE_WINDXSDK ON) # Windows Kits 10
set(WINDOWKIT_VERSION 10) # folder
set(WINDOWKIT_VERSION_UPDATE 10.0.19041.0) #sub folders
set(WINDOW_BIT x86) # arm, arm64, x64, x86
# x86 = win 32 bit
# x64 = win 64 bit

Those are basic settings in CMakeLists.txt

The example is from https://github.com/ocornut/imgui/tree/master/examples/example_win32_directx11

:: Create a build directory
mkdir build 
cd build
:: cmake config CMakeLists.txt
cmake .. -A Win32
:: build binary app
cmake --build . 

Notes:

  • cmake config is must in win 32 bit else it will error in the builds.
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE")

add_executable(${PROJECT_NAME} 
  WIN32 # window 32 bit
  win32_directx11.cpp
)

target_link_libraries(${PROJECT_NAME} 
  d3d11
  #d3dx11
  #dxguid
)

Links:

Credits:

About

simple build with win32 directx 11, imgui 1.8 and cmake builds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published