Код: Выделить всё
image: gcc
before_script:
- apt-get update --yes
- apt-get install cmake --yes # Cmake
- apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev --yes # OpenGL
- apt-get install freetype* --yes # freetype
- apt-get install libogg-dev --yes # OGG
- apt-get install libvorbis-dev --yes # vorbis
- apt-get install libflac-dev --yes # flac
- apt-get install libsfml-dev --yes # SFML
- apt-get install libudev-dev --yes # UDev
- apt-get install libopenal1 libopenal-dev --yes # OpenAL
- apt-get install libx11-dev libxrandr-dev libxcursor-dev --yes # X11
stages:
- build
# - test
# - deliver
BuildCode:
stage: build
script:
- cmake -B build -S .
- cmake --build build
artifacts:
paths:
- "build/bin/"
when: on_success
expire_in: 30 days
Код: Выделить всё
sf::Text text;
text.setFont(font);
text.setString(string);
text.setCharacterSize(kTextSize);
text.setFillColor(color);
text.setPosition(0, 0);
auto rect = text.getGlobalBounds();
auto pos = rect.getPosition();
Код: Выделить всё
# ...
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
# ...
target_link_libraries(${PROJECT_NAME} PRIVATE sfml-graphics)
# ...
if (WIN32)
set(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_GNUtoMS TRUE)
add_custom_command(
TARGET ${PROJECT_NAME}
COMMENT "Copy OpenAL DLL"
PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${SFML_SOURCE_DIR}/extlibs/bin/$/openal32.dll $
VERBATIM)
endif ()
install(TARGETS ${PROJECT_NAME})
# ...
Код: Выделить всё
/builds/roman.s.zinin/tp-project/src/interface/visualization.cpp: In member function 'std::pair Visualization::GetTextSize(std::string)':
/builds/roman.s.zinin/tp-project/src/interface/visualization.cpp:70:19: error: 'class sf::Rect' has no member named 'getPosition'
70 | auto pos = rect.getPosition();
Подробнее здесь: https://stackoverflow.com/questions/784 ... class-sfre
Мобильная версия