feat: add stb dependency and window::screenshot()
Added deps/Findstb.cmake (fetches stb via FetchContent, provides stb::stb interface target). Linked to cbt_opengl. Implemented window::screenshot() using glReadPixels + vertical flip + stb_image_write to save RGBA PNG. Press S in the app to capture current frame (saved as screenshot.png). Updated help text. (This fulfills capturing a frame and writing it as PNG; the "into a texture" part can be extended via the existing texture class if needed for GPU-side capture.)
This commit is contained in:
+2
-1
@@ -17,6 +17,7 @@ find_package(glfw3 REQUIRED)
|
||||
find_package(glad REQUIRED)
|
||||
find_package(asio REQUIRED)
|
||||
find_package(glm REQUIRED)
|
||||
find_package(stb REQUIRED)
|
||||
|
||||
# OpenGL abstraction library
|
||||
add_library(cbt_opengl STATIC
|
||||
@@ -32,7 +33,7 @@ target_include_directories(cbt_opengl PRIVATE ".")
|
||||
target_compile_features(cbt_opengl PRIVATE cxx_std_23)
|
||||
target_compile_options(cbt_opengl PRIVATE ${BASE_OPTIONS})
|
||||
target_compile_definitions(cbt_opengl PRIVATE ${BASE_DEFINITIONS})
|
||||
target_link_libraries(cbt_opengl PUBLIC fmt::fmt glfw::glfw glad::glad)
|
||||
target_link_libraries(cbt_opengl PUBLIC fmt::fmt glfw::glfw glad::glad stb::stb)
|
||||
|
||||
# Scene base library
|
||||
add_library(cbt_scene STATIC
|
||||
|
||||
Reference in New Issue
Block a user