将SFML从cmake的依赖项改为git的依赖项

This commit is contained in:
pointer-to-bios 2024-08-20 10:51:14 +08:00
parent 77d2d45b20
commit 781e62f041
5 changed files with 8 additions and 7 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "deps/SFML"]
path = deps/SFML
url = https://github.com/SFML/SFML.git

View File

@ -3,11 +3,7 @@ project(SFTK LANGUAGES CXX)
set(CXX_STANDARD_REQUIRED 23) set(CXX_STANDARD_REQUIRED 23)
include(FetchContent) add_subdirectory(./deps/SFML)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
set(ROOT src/) set(ROOT src/)
set(CONTAINER src/containers) set(CONTAINER src/containers)

BIN
demo/SarasaUiSC-Regular.ttf Normal file

Binary file not shown.

View File

@ -5,8 +5,9 @@
int main() int main()
{ {
auto &window = sftk::Window::create(800, 600, L"demo1"); auto &window = sftk::Window::create(800, 600, L"demo1");
auto &label = sftk::Label::create(L"hello SFTK.", sftk::Font("SarasaUiSC-Regular.ttf", "", 18)); window.setBackgroudColor(sf::Color::White);
label.setColor(sf::Color::White); auto &label = sftk::Label::create(L"hello SFTK.", sftk::Font("../demo/SarasaUiSC-Regular.ttf", "", 18));
label.setColor(sf::Color::Black);
label.setPosition(vec(100.f, 100.f)); label.setPosition(vec(100.f, 100.f));
window.exec(); window.exec();
} }

1
deps/SFML vendored Submodule

@ -0,0 +1 @@
Subproject commit 69ea0cd863aed1d4092b970b676924a716ff718b