Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: texture splitting/stacking, JPEG XL/DDS images, GLES3.0 #66

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9eb6a6b
feat: remove unused GetImageInfo functions
zao Dec 17, 2024
0859464
feat: remove unused BLP file format
zao Dec 17, 2024
7c1c46c
feat: add JPEG XL image format support
zao Dec 17, 2024
9c06ae0
feat: new image "Art" type with image operations
zao Dec 19, 2024
a7e615b
fix: install runtime+dependency DLLs for JPEG XL
zao Dec 19, 2024
f3cca99
feat: use anisotropic filtering for textures
zao Dec 21, 2024
c9bfca8
feat: parallelise individual JPEG XL image loads
zao Dec 21, 2024
0a3b5a9
feat: do SRGB resampling of textures, also npot
zao Dec 21, 2024
b5ac91b
feat: new async texture loading
zao Dec 29, 2024
142b187
fix: avoid deleting stack-local image
zao Dec 29, 2024
79176d5
fix: discard mipset after upload to save RAM
zao Dec 29, 2024
6373436
feat: drop dat storage of images for gli texture2d
zao Dec 29, 2024
4bbb84b
feat: update glad headers and context to ES3/D3D11
zao Jan 3, 2025
ed0a2f9
feat: update shaders to ESSL3.0 and texture arrays
zao Jan 3, 2025
6197c08
feat: drop old image_c data, use only GLI textures
zao Jan 3, 2025
a283091
feat: add functions to stack and load DDS textures
zao Jan 8, 2025
7ff8e02
feat: use sol2 and expose tex manipulation
zao Jan 8, 2025
38a9770
feat: expose texture array layer for Lua drawing
zao Jan 8, 2025
ee39a41
fix: avoid inspecting released shader slots
zao Jan 8, 2025
9ac5ffa
fix: add dependency on GSL for span
zao Jan 8, 2025
38f56a9
fix: make mipmaps for RGBA textures if allowed
zao Jan 9, 2025
168b1e5
fix: compute RGB(A) mipmaps with stb sRGB for now
zao Jan 9, 2025
886159d
feat: allow image draws with stacked mask texture
zao Jan 11, 2025
c5b1170
feat: use platform OpenGL if running on Wine
zao Jan 14, 2025
68fd9d2
fix: detect Wine host, use D3D11 on macOS
zao Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 76 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ set(SIMPLEGRAPHIC_SOURCES
"engine/common/memtrak3.h"
"engine/common/streams.cpp"
"engine/common/streams.h"
"engine/core/core_compress.cpp"
"engine/core/core_compress.h"
"engine/core/core_config.cpp"
"engine/core/core_config.h"
"engine/core/core_image.cpp"
"engine/core/core_image.h"
"engine/core/core_main.cpp"
"engine/core/core_main.h"
"engine/core/core_tex_manipulation.cpp"
"engine/core/core_tex_manipulation.h"
"engine/core/core_video.cpp"
"engine/core/core_video.h"
"engine/render/r_font.cpp"
Expand Down Expand Up @@ -107,11 +111,19 @@ find_package(unofficial-angle CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(gli CONFIG REQUIRED)
find_package(LuaJIT REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(re2 CONFIG REQUIRED)
find_package(sol2 CONFIG REQUIRED)
find_package(Threads REQUIRED)
find_package(zstd REQUIRED)
find_package(ZLIB REQUIRED)

pkg_check_modules(libjxl REQUIRED IMPORTED_TARGET libjxl)
pkg_check_modules(libjxl_threads REQUIRED IMPORTED_TARGET libjxl_threads)

add_library(imgui STATIC
dep/imgui/imconfig.h
dep/imgui/imgui.cpp
Expand Down Expand Up @@ -195,12 +207,18 @@ target_link_libraries(SimpleGraphic
unofficial::angle::libGLESv2
fmt::fmt
glfw
gli
glm::glm
imgui
LuaJIT::LuaJIT
Microsoft.GSL::GSL
PkgConfig::libjxl
PkgConfig::libjxl_threads
re2::re2
sol2
Threads::Threads
ZLIB::ZLIB
zstd::libzstd_shared
)

install(FILES $<TARGET_RUNTIME_DLLS:SimpleGraphic> DESTINATION ".")
Expand All @@ -214,10 +232,38 @@ if (WIN32)
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(ZLIB_DLL_DEBUG NAMES "zlibd1.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)


# JPEG XL
find_file(JPEG_XL_DLL_DEBUG NAMES "jxl.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(JPEG_XL_CMS_DLL_DEBUG NAMES "jxl_cms.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(JPEG_XL_THREADS_DLL_DEBUG NAMES "jxl_threads.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(Little_CMS_DLL_DEBUG NAMES "lcms2.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(Highway_DLL_DEBUG NAMES "hwy.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)

# Brotli
find_file(brotlicommon_DLL_DEBUG NAMES "brotlicommon.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(brotlidec_DLL_DEBUG NAMES "brotlidec.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)
find_file(brotlienc_DLL_DEBUG NAMES "brotlienc.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "debug/bin" REQUIRED NO_DEFAULT_PATH)

install(FILES
${LuaJIT_DLL_DEBUG}
${ZLIB_DLL_DEBUG}
${JPEG_XL_DLL_DEBUG}
${JPEG_XL_CMS_DLL_DEBUG}
${JPEG_XL_THREADS_DLL_DEBUG}
${Little_CMS_DLL_DEBUG}
${Highway_DLL_DEBUG}
${brotlicommon_DLL_DEBUG}
${brotlidec_DLL_DEBUG}
${brotlienc_DLL_DEBUG}
DESTINATION "."
CONFIGURATIONS Debug
)
Expand All @@ -226,12 +272,39 @@ if (WIN32)
find_file(LuaJIT_DLL_RELEASE NAMES "lua51.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(ZLIB_DLL_RELEASE NAMES "zlib1.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH
)
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)

# JPEG XL
find_file(JPEG_XL_DLL_RELEASE NAMES "jxl.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(JPEG_XL_CMS_DLL_RELEASE NAMES "jxl_cms.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(JPEG_XL_THREADS_DLL_RELEASE NAMES "jxl_threads.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(Little_CMS_DLL_RELEASE NAMES "lcms2.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(Highway_DLL_RELEASE NAMES "hwy.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)

# Brotli
find_file(brotlicommon_DLL_RELEASE NAMES "brotlicommon.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(brotlidec_DLL_RELEASE NAMES "brotlidec.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)
find_file(brotlienc_DLL_RELEASE NAMES "brotlienc.dll"
PATHS "${DEPS_DIR}" PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH)

install(FILES
${LuaJIT_DLL_RELEASE}
${ZLIB_DLL_RELEASE}
${JPEG_XL_DLL_RELEASE}
${JPEG_XL_CMS_DLL_RELEASE}
${JPEG_XL_THREADS_DLL_RELEASE}
${Little_CMS_DLL_RELEASE}
${Highway_DLL_RELEASE}
${brotlicommon_DLL_RELEASE}
${brotlidec_DLL_RELEASE}
${brotlienc_DLL_RELEASE}
DESTINATION "."
CONFIGURATIONS Release MinSizeRel RelWithDebInfo
)
Expand Down
Loading