Skip to content

Commit

Permalink
Init Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leoHerv committed Jun 21, 2024
1 parent 4af7a18 commit 24b613e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ out
.idea
.vs
.vscode
/cmake-build-debug
/cmake-build-release
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(CMakeSFMLProject LANGUAGES CXX)
project(SFML_Project_test LANGUAGES CXX)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
Expand All @@ -21,3 +21,5 @@ if(WIN32)
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$<IF:$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>,x64,x86>/openal32.dll $<TARGET_FILE_DIR:main>
VERBATIM)
endif()

message(STATUS "SFML_SOURCE_DIR: ${SFML_SOURCE_DIR}")
6 changes: 4 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

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

while (window.isOpen())
{
for (auto event = sf::Event{}; window.pollEvent(event);)
for (sf::Event event = sf::Event{}; window.pollEvent(event);)
{
if (event.type == sf::Event::Closed)
{
Expand Down

0 comments on commit 24b613e

Please sign in to comment.