Commit cd620062 authored by reassembler's avatar reassembler
Browse files

Open GL Build System Toggle

parent 2074166a
cmake_minimum_required (VERSION 2.6.2)
project (cannonball)
set(DCMAKE default.cmake)
set(CMDIR ../cmake)
......@@ -97,22 +98,36 @@ set(src_hwaudio
"${main_cpp_base}/hwaudio/soundchip.cpp"
"${main_cpp_base}/hwaudio/ym2151.cpp"
)
set(src_sdl
"${main_cpp_base}/sdl/audio.hpp"
"${main_cpp_base}/sdl/timer.hpp"
"${main_cpp_base}/sdl/input.hpp"
"${main_cpp_base}/sdl/renderbase.hpp"
"${main_cpp_base}/sdl/rendergl.hpp"
"${main_cpp_base}/sdl/rendersw.hpp"
"${main_cpp_base}/sdl/audio.cpp"
"${main_cpp_base}/sdl/timer.cpp"
"${main_cpp_base}/sdl/input.cpp"
"${main_cpp_base}/sdl/renderbase.cpp"
"${main_cpp_base}/sdl/rendergl.cpp"
"${main_cpp_base}/sdl/rendersw.cpp"
)
if(OPENGL)
set(src_sdl
"${main_cpp_base}/sdl/audio.hpp"
"${main_cpp_base}/sdl/timer.hpp"
"${main_cpp_base}/sdl/input.hpp"
"${main_cpp_base}/sdl/renderbase.hpp"
"${main_cpp_base}/sdl/rendergl.hpp"
"${main_cpp_base}/sdl/audio.cpp"
"${main_cpp_base}/sdl/timer.cpp"
"${main_cpp_base}/sdl/input.cpp"
"${main_cpp_base}/sdl/renderbase.cpp"
"${main_cpp_base}/sdl/rendergl.cpp"
)
else()
set(src_sdl
"${main_cpp_base}/sdl/audio.hpp"
"${main_cpp_base}/sdl/timer.hpp"
"${main_cpp_base}/sdl/input.hpp"
"${main_cpp_base}/sdl/renderbase.hpp"
"${main_cpp_base}/sdl/rendersw.hpp"
"${main_cpp_base}/sdl/audio.cpp"
"${main_cpp_base}/sdl/timer.cpp"
"${main_cpp_base}/sdl/input.cpp"
"${main_cpp_base}/sdl/renderbase.cpp"
"${main_cpp_base}/sdl/rendersw.cpp"
)
endif()
set(src_directx
"${main_cpp_base}/directx/ffeedback.hpp"
......@@ -213,6 +228,10 @@ if(WIN32)
set(SRCS ${SRCS} ../res/cannonball.rc)
endif(WIN32)
if(OPENGL)
add_definitions(-DWITH_OPENGL)
endif()
add_executable(cannonball ${SRCS})
# Copy Configuration file to current build
......
......@@ -9,6 +9,9 @@ if (NOT DEFINED ENV{DXSDK})
message(FATAL_ERROR "Warning: DirectX SDK Variable DXSDK Not Defined!")
endif()
# Use OpenGL for rendering.
set(OPENGL 1)
include_directories(
"${sdl_root}/include"
)
......@@ -27,9 +30,6 @@ link_directories(
"$ENV{DXSDK}/lib"
"${sdl_root}/lib"
)
# Use OpenGL for rendering. Disable to use software rendering.
add_definitions(-DWITH_OPENGL)
# Location for Cannonball to create save files
# Used to auto-generate setup.hpp with various file paths
......
......@@ -11,6 +11,9 @@ endif()
find_package(SDL REQUIRED)
# Use OpenGL for rendering.
set(OPENGL 1)
include_directories(
"${SDL_INCLUDE_DIR}"
# You may need to remove the next line based on your DirectX setup
......@@ -27,11 +30,10 @@ link_libraries(cannonball
)
set(CMAKE_CXX_FLAGS "-Ofast -static-libgcc -static-libstdc++")
# Use OpenGL for rendering. Disable to use software rendering.
add_definitions(-DWITH_OPENGL)
# Location for Cannonball to create save files
# Used to auto-generate setup.hpp with various file paths
set(xml_directory ./)
set(sdl_flags "SDL_DOUBLEBUF | SDL_SWSURFACE")
\ No newline at end of file
# SDL Software Rendering Flags (ignored if OpenGL used)
set(sdl_flags "SDL_SWSURFACE | SDL_DOUBLEBUF")
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment