Skip to content

How to compile from source

Marcos Orallo edited this page May 8, 2023 · 6 revisions

Basic setup

  1. Download Visual Studio 2022(previous versions may work too, but these instructions will focus on that version)
  2. Install Visual Studio 2022with the following components:
    • Visual C++ for Windows applications
    • Visual C++ for Game development
    • MSVC Runtime v143 (Platform Toolset from Visual Studio 2022)
    • Windows 10 SDK (10.0.19041.0 preferably)
  3. Clone the xwa_ddraw_d3d11 project from Github
  4. Open the impl11.sln solution with Visual Studio 2022.
    • If prompted, do not Upgrade the solution to a newer version of Windows nor platform toolkit. Try to install the required versions instead.
  5. Build solution. It should build correctly, despite some warnings. The ddraw.dll will be output to the impl11/Release/ folder.

Optional quality of life improvements

Copy ddraw.dll automatically to XWA folder

  1. Copy property template files
    • PropertySheetDebug.props.default -> PropertySheetDebug.props
    • PropertySheetRelease.props.default -> PropertySheetRelease.props
  2. Open the Property Manager in the View menu.
  3. Edit the PropertySheetDebug and PropertySheetRelease to add a Post-build event that copies the output .dll into your XWA directory. for example:
    • copy /Y $(TargetPath) "c:\Program Files (x86)\GOG Galaxy\Games\Star Wars - X-Wing Alliance"

image

Configure Debugger

To launch XWA directly with F5 and be able to run code step by step.

  1. Configure ddraw as start-up project (Right click over the project -> Set As Startup project)
  2. Debug -> ddraw Debug Properties

image

Clone this wiki locally