Skip to content

Instantly share code, notes, and snippets.

@pedro-w
Last active December 19, 2020 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedro-w/83372cf27c0a09ab289d3ab3590806fb to your computer and use it in GitHub Desktop.
Save pedro-w/83372cf27c0a09ab289d3ab3590806fb to your computer and use it in GitHub Desktop.
Instructions for setting up Allegro / Visual Studio

Prerequisites

  • Visual Studio 2019
  • C/C++ workload for VS (includes SDK and CMake)
  • Allegro 5.2.6 source code from GitHub

Configure

  • Unzip allegro somewhere
  • Start a "x64 Native Command Tools" prompt
  • Navigate to allegro root dir
  • Configure for debugging cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug

Build

  • cmake --build build (or skip this and just open ALLEGRO.sln in VS)

Experimenting

I would exploit the CMake machinery and just temporarily add another program to the examples. Then at least it will automatically keep all the dependencies in sync. Add example(peter_work) to examples\CMakeLists.txt, just above example(ex_config DATA sample.cfg), line 94. Then create peter_work.c in examples. (or copy across one of the other simple examples) When you rebuild the soluction it will auto-reconfigure and give you another Project in VS.

Debugging.

First, make that the project the default Startup project. Right click and edit the properties, Debugging section so that

  1. it will start in the examples directory - change Working Directory to $(ProjectDir)\..\examples
  2. it will have the 'development' Allegro libraries on the PATH - change Environment to PATH=$(ProjectDir)..\lib\$(Configuration);$(Path)

Now you should be able to start & debug the program and any part of Allegro.

@pedro-w
Copy link
Author

pedro-w commented Dec 19, 2020

Screenshot 2020-12-19 112031
Screenshot 2020-12-19 112340
Screenshot 2020-12-19 112616
Screenshot 2020-12-19 120517
Screenshot 2020-12-19 120359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment