diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index ee86e13b..bdeb9439 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -601,28 +601,6 @@ } } }, - "//bazel/extensions:sfml.bzl%sfml": { - "general": { - "bzlTransitiveDigest": "FITqsdWRKamrIu1ljwExVGNOgk8E2lq+HXbHQMHMXE0=", - "usagesDigest": "/4Cy3XejljP+PQqF0qQREPG7U/f5pF20HNsflUS26d8=", - "recordedInputs": [ - "REPO_MAPPING:,bazel_tools bazel_tools" - ], - "generatedRepoSpecs": { - "sfml": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "urls": [ - "https://github.com/SFML/SFML/archive/refs/tags/3.0.1.zip" - ], - "integrity": "sha256-jHkTaMSvvLaJDWZ0FY+Pbp7ztOlvvUzugvbWH1p+iaU=", - "strip_prefix": "SFML-3.0.1", - "build_file": "@@//bazel/3p:sfml.BUILD" - } - } - } - } - }, "@@apple_rules_lint+//lint:extensions.bzl%linter": { "general": { "bzlTransitiveDigest": "GRMyLraxrIqwpYRdzOfjZMmByG37F1TiOwo1vnf4KJ4=", diff --git a/bazel/3p/sfml.BUILD b/bazel/3p/sfml.BUILD deleted file mode 100644 index a7f029d7..00000000 --- a/bazel/3p/sfml.BUILD +++ /dev/null @@ -1,89 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") -load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") - -package( - default_visibility = ["//visibility:public"], -) - -filegroup( - name = "all_srcs", - srcs = glob(["**"]), -) - -cmake( - name = "sfml_cmake", - defines = select({ - "@bazel_tools//src/conditions:darwin": [ - "CMAKE_OSX_DEPLOYMENT_TARGET=10.15", - ], - "//conditions:default": [], - }), - generate_args = select({ - "@bazel_tools//src/conditions:darwin": [ - "-DBUILD_SHARED_LIBS=false", - "-DSFML_USE_SYSTEM_DEPS=false", - "-DSFML_BUILD_AUDIO=true", - "-DSFML_BUILD_GRAPHICS=true", - # "-DSFML_BUILD_NETWORK=true", - "-DSFML_BUILD_WINDOW=true", - "-DCMAKE_BUILD_TYPE=Release", - ], - "//conditions:default": [ - "-DBUILD_SHARED_LIBS=false", - "-DSFML_USE_SYSTEM_DEPS=true", - "-DSFML_BUILD_AUDIO=true", - "-DSFML_BUILD_GRAPHICS=true", - # "-DSFML_BUILD_NETWORK=true", - "-DSFML_BUILD_WINDOW=true", - "-DCMAKE_BUILD_TYPE=Release", - "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", - ], - }), - lib_source = ":all_srcs", - out_include_dir = "include", - out_static_libs = [ - "libsfml-system-s.a", - "libsfml-window-s.a", - "libsfml-graphics-s.a", - "libsfml-audio-s.a", - # "libsfml-network-s.a", - ], - tags = ["requires-network"], -) - -# Main SFML target with platform-specific linking -cc_library( - name = "sfml", - linkopts = select({ - "@platforms//os:macos": [ - "-ObjC", - "-framework", - "IOKit", - "-framework", - "CoreGraphics", - "-framework", - "AppKit", - "-framework", - "CoreFoundation", - "-framework", - "OpenGL", - "-framework", - "Carbon", - ], - "@platforms//os:linux": [ - "-lX11", - "-lXrandr", - "-lXcursor", - "-lXi", - "-lXinerama", - "-lGL", - "-lpthread", - "-ludev", - "-ldl", - "-lm", - ], - "//conditions:default": [], - }), - deps = [":sfml_cmake"], - alwayslink = True, # Ensures linking flags are always applied -) diff --git a/bazel/cc.MODULE.bazel b/bazel/cc.MODULE.bazel index 0bcc7e25..6305eaa0 100644 --- a/bazel/cc.MODULE.bazel +++ b/bazel/cc.MODULE.bazel @@ -17,6 +17,3 @@ use_repo(sdl3_ext, "sdl3") raylib_ext = use_extension("//bazel/extensions:raylib.bzl", "raylib") use_repo(raylib_ext, "raylib") - -sfml_ext = use_extension("//bazel/extensions:sfml.bzl", "sfml") -use_repo(sfml_ext, "sfml") diff --git a/bazel/extensions/sfml.bzl b/bazel/extensions/sfml.bzl deleted file mode 100644 index bf7d6da3..00000000 --- a/bazel/extensions/sfml.bzl +++ /dev/null @@ -1,14 +0,0 @@ -"bzlmod extensions" - -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") - -def _http_impl(ctx): # buildifier: disable=unused-variable - http_archive( - name = "sfml", - urls = ["https://github.com/SFML/SFML/archive/refs/tags/3.0.1.zip"], - integrity = "sha256-jHkTaMSvvLaJDWZ0FY+Pbp7ztOlvvUzugvbWH1p+iaU=", - strip_prefix = "SFML-3.0.1", - build_file = "@//bazel/3p:sfml.BUILD", - ) - -sfml = module_extension(implementation = _http_impl) diff --git a/domains/graphics/README.md b/domains/graphics/README.md index 205995e7..df11e099 100644 --- a/domains/graphics/README.md +++ b/domains/graphics/README.md @@ -13,7 +13,6 @@ Computer graphics, image processing, and rendering. - [**Tubing**](apps/tubing): Graphics demonstration. - [**Tracy Demo**](apps/tracy_demo): Demo for the Tracy ray tracer. - [**Sobel CLI**](apps/sobel_cli): Command-line tool for Sobel edge detection. -- [**SFML Example**](apps/sfml_example): Basic SFML usage example. - [**Raylib Example**](apps/raylib_example): Basic Raylib usage example. ## Libraries diff --git a/domains/graphics/apps/sfml_example/BUILD.bazel b/domains/graphics/apps/sfml_example/BUILD.bazel deleted file mode 100644 index 2231ba65..00000000 --- a/domains/graphics/apps/sfml_example/BUILD.bazel +++ /dev/null @@ -1,10 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_binary") - -cc_binary( - name = "sfml_example", - srcs = ["hello_sfml.cc"], - visibility = ["//visibility:public"], - deps = [ - "@sfml", - ], -) diff --git a/domains/graphics/apps/sfml_example/hello_sfml.cc b/domains/graphics/apps/sfml_example/hello_sfml.cc deleted file mode 100644 index 021f40d8..00000000 --- a/domains/graphics/apps/sfml_example/hello_sfml.cc +++ /dev/null @@ -1,59 +0,0 @@ -#include - -std::vector compute_scales(int32_t now_ms, int ms_per_cycle, uint8_t subdivisions) { - std::vector scales{}; - // how to scale this like a tube instead of linearly? - // maybe a 1/x type shape? or log? - for (int i = 0; i < subdivisions; i++) { - scales.emplace_back(((now_ms + i * (ms_per_cycle / subdivisions)) % ms_per_cycle) / - static_cast(ms_per_cycle)); - } - - return scales; -} - -sf::CircleShape centered_circle(float r, float scale, int w, int h) { - float radius = r / std::log(scale); - uint8_t gray = 255 * scale; - - sf::CircleShape circle(radius, 100); - circle.setFillColor(sf::Color::Transparent); - circle.setOutlineThickness(1.f); - circle.setOutlineColor(sf::Color(gray, gray, 255)); - circle.setPosition(sf::Vector2f(w / 2 - radius, h / 2 - radius)); - return circle; -} - -int main() { - // create the window - sf::ContextSettings settings; - settings.antiAliasingLevel = 8; - sf::RenderWindow window(sf::VideoMode({800, 600}), "TuberProV7", sf::Style::Default, - sf::State::Windowed, settings); - - sf::Clock clock{}; - - // run the program as long as the window is open - while (window.isOpen()) { - // check all the window's events that were triggered since the last iteration of the loop - while (const std::optional event = window.pollEvent()) { - // "close requested" event: we close the window - if (event->is()) window.close(); - } - - int32_t now_ms = clock.getElapsedTime().asMilliseconds(); - - // clear the window - window.clear(sf::Color::Black); - - // draw everything - auto scales = compute_scales(now_ms, 5000, 15); - for (auto scale : scales) { - sf::CircleShape circle = centered_circle(300.0, scale, 800, 600); - window.draw(circle); - } - - // end the current frame - window.display(); - } -} diff --git a/scripts/setup/setup-linux b/scripts/setup/setup-linux index 9dc4e1ad..3dc9cf68 100755 --- a/scripts/setup/setup-linux +++ b/scripts/setup/setup-linux @@ -20,12 +20,6 @@ libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libxinerama-dev \ libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev libx11-dev \ -# SFML deps -echo "[setup-linux] >> installing SFML deps" -apt-get install -y libfreetype6-dev libx11-dev libxrandr-dev libgl1-mesa-dev \ -libudev-dev libopenal-dev libflac-dev libogg-dev libvorbis-dev libxcursor-dev \ -libxi-dev libxinerama-dev - echo "[setup-linux] >> installing clang format" ln -s "$(which clang-format-18)" /usr/local/bin/clang-format