Compare commits

..

2 Commits

Author SHA1 Message Date
Eigen Lenk
f144876bc1
Merge e5cf195d8a into 766325c395 2025-02-20 11:47:36 +02:00
Eigen Lenk
e5cf195d8a [Renderers/Allegro4] Add Allegro 4.x renderer and demo 2025-02-20 11:47:25 +02:00
4 changed files with 4 additions and 54 deletions

View File

@ -9,7 +9,6 @@ option(CLAY_INCLUDE_CPP_EXAMPLE "Build C++ example" OFF)
option(CLAY_INCLUDE_RAYLIB_EXAMPLES "Build raylib examples" OFF) option(CLAY_INCLUDE_RAYLIB_EXAMPLES "Build raylib examples" OFF)
option(CLAY_INCLUDE_SDL2_EXAMPLES "Build SDL 2 examples" OFF) option(CLAY_INCLUDE_SDL2_EXAMPLES "Build SDL 2 examples" OFF)
option(CLAY_INCLUDE_SDL3_EXAMPLES "Build SDL 3 examples" OFF) option(CLAY_INCLUDE_SDL3_EXAMPLES "Build SDL 3 examples" OFF)
option(CLAY_INCLUDE_ALLEGRO4_EXAMPLE "Build Allegro 4.x example" OFF)
message(STATUS "CLAY_INCLUDE_DEMOS: ${CLAY_INCLUDE_DEMOS}") message(STATUS "CLAY_INCLUDE_DEMOS: ${CLAY_INCLUDE_DEMOS}")
@ -34,9 +33,6 @@ endif ()
if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL2_EXAMPLES) if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL2_EXAMPLES)
add_subdirectory("examples/SDL2-video-demo") add_subdirectory("examples/SDL2-video-demo")
endif () endif ()
if(CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_ALLEGRO4_EXAMPLE)
add_subdirectory("examples/allegro4-demo")
endif ()
if(NOT MSVC AND (CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL3_EXAMPLES)) if(NOT MSVC AND (CLAY_INCLUDE_ALL_EXAMPLES OR CLAY_INCLUDE_SDL3_EXAMPLES))
add_subdirectory("examples/SDL3-simple-demo") add_subdirectory("examples/SDL3-simple-demo")
endif() endif()

View File

@ -1,40 +0,0 @@
cmake_minimum_required(VERSION 3.27)
project(allegro4_demo C)
set(CMAKE_C_STANDARD 99)
include(FetchContent)
set(FETCHCONTENT_QUIET FALSE)
# Fetch pre-built MinGW binaries
FetchContent_Declare(
allegro4
URL https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/A443Deluxe.7z
)
FetchContent_MakeAvailable(allegro4)
link_directories(${allegro4_SOURCE_DIR}/lib/)
add_executable(allegro4_demo main.c ../../renderers/alleg4/alleg4.c)
target_compile_options(allegro4_demo PUBLIC)
target_include_directories(allegro4_demo PUBLIC . ${CMAKE_SOURCE_DIR} ${allegro4_SOURCE_DIR}/include/)
# All global variables Allegro makes available are lost when linking statically,
# at least not when extern-ing all over the place.
target_link_libraries(allegro4_demo PUBLIC alleg44.dll.a)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
add_custom_command(TARGET allegro4_demo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${allegro4_SOURCE_DIR}/bin/dlls/alleg44.dll"
$<TARGET_FILE_DIR:allegro4_demo>
)
add_custom_command(
TARGET allegro4_demo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/res
${CMAKE_CURRENT_BINARY_DIR}/res)

View File

@ -0,0 +1,3 @@
# Allegro 4 demo
To build this demo on your system of choice, include all source files in this directory, as well as in "renderers/alleg4" and link with a 4.x version of Allegro. It's probably easiest to go with a pre-built binary.

View File

@ -483,13 +483,4 @@ int main(int argc, char *argv[]) {
return 0; return 0;
} }
END_OF_MAIN()
#ifdef _WIN32
#include <WinDef.h>
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
return main(__argc, __argv);
}
#endif