Skip to content

Commit

Permalink
Use SFML 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisThrasher committed Sep 7, 2023
1 parent 86e3520 commit b00495c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ project(CMakeSFMLProject LANGUAGES CXX)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
GIT_TAG master)
FetchContent_MakeAvailable(SFML)

add_executable(CMakeSFMLProject src/main.cpp)
target_link_libraries(CMakeSFMLProject PRIVATE sfml-graphics)
target_compile_features(CMakeSFMLProject PRIVATE cxx_std_17)
target_link_libraries(CMakeSFMLProject PRIVATE SFML::Graphics)
if (WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET CMakeSFMLProject POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:CMakeSFMLProject> $<TARGET_FILE_DIR:CMakeSFMLProject> COMMAND_EXPAND_LISTS)
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

int main()
{
auto window = sf::RenderWindow{ { 1920u, 1080u }, "CMake SFML Project" };
auto window = sf::RenderWindow{ sf::VideoMode{ { 1920u, 1080u } }, "CMake SFML Project" };
window.setFramerateLimit(144);

while (window.isOpen())
Expand All @@ -18,4 +18,4 @@ int main()
window.clear();
window.display();
}
}
}

0 comments on commit b00495c

Please sign in to comment.