* build.sh: support building SDL3 with cmake
* ci: install cmake
* ci: make msvc use bash to build again
* ci: use get-command to get link.exe
* build.sh: revert back to CMAKE_INSTALL_PREFIX
* ci: hardcode CMAKE_INSTALL_LIBDIR
* ci: set cc_ld to not step on cmake
* build.sh: less messing with cwd
* build.sh: fix prefix once and for all
* ci: skip installing cmake on macos to avoid warnings
* build.sh: pass MACOSX_DEPLOYMENT_TARGET to cmake
* build.sh: remove extra .. in configure command
* build.sh: remove unused variable
* build.sh: allow SIMD runtime detection
* build.sh: propagate LTO to SDL3
* update to SDL 3.2.0
* remove SDL wrap
* fix darwin and windows CI
* update build box, correct msys sdl3 dependency
* port leftovers from renderer backend to SDL3
* remove SDL main dep
the main implementation is now included in a header
* main.c: use SDL_main.h
This needs to be included to work.
* ci: use vcpkg and pkgconf to support SDL3 on MSVC
* ci: use 7z to create zip
* renwindow: create texture and surface suitable for the display
* system: remove trailing whitespace
* renderer: fix trailing whitespace
* system: fix checking the wrong argument
* system: port rmdir and stat to SDL3 API
* system: remove unneeded API level check
* system: fix wrong parameter index
* system: make set_window_hit_test and set_window_bordered accept a window
* docs/system: update docs
* system: restore some comments
* docs/system: add missing documentation for system.text_input
* system: use SDL_setenv_unsafe
* system: add back comment for setenv
* system,renderer: remove unnecessary SDL_ClearError calls
---------
Co-authored-by: takase1121 <20792268+takase1121@users.noreply.github.com>
(cherry picked from commit 2716f14b6903f055f6bdf010a7e4a3d040cf059d)
* language_cpp: add back digit separators
* language_cpp: rewrite number matching in regex
* language_c: port digit separators over from language_cpp
(cherry picked from commit 8ea0393800bb59a214e8a6efd5b9fb69282803a9)
* common: allow / and \ as PATHSEP on Windows when fuzzy matching files
* common: fix PLATFORM == Windows
(cherry picked from commit 5d6ae412e76e69181a3b46c79b8408fbd55183c9)
Previously it would use the last char position, which resulted in incorrect values when the next char had a different size than the current one.
(cherry picked from commit f066c88e186a02b9912d7f102b541f514ae1aa35)
These are only needed for building the actual project and not for managing resources or setting various flags.
Gets rid of the double `source-only` check and moves it closer to the consumer
(cherry picked from commit 64420f4366a290b3c3f48f0131a8f77312def595)
ren_font_group_get_width() is getting called a lot while not 100% of the
glyphs loaded from this function will be actually rendered. We can defer
the bitmap rendering to ren_draw_text.
(cherry picked from commit 1659f63dfc6fec7893673e7e95bbcd844ec0bda4)
* renderer: rewrite glyph cache
This commit splits the current GlyphSet-based system into 2 caches,
CharMap and GlyphMap, which maps codepoints -> glyph IDs and glyph IDs -> glyphs respectively.
Each GlyphMap contains a number of GlyphAtlas mapped by their width,
and each GlyphAtlas has a list of surfaces with the same width.
Surfaces within the GlyphAtlas acts like a bump allocator, but is flexible
enough to allow older GlyphAtlas surfaces to be recycled.
GlyphMetric now contains atlas_idx and surface_idx, which points to the correct surface.
Since GlyphAtlas supports rudimentary packing & allocation, we no longer render whole
GlyphSets and this speeds up rendering in most cases.
Tab width is no longer set with the hacky "modify the GlyphMetric" hack.
* renderer: set natlas to 0 after freeing
* renderer: fix printf warning
* renderer: fix memory leak
* renderer: better whitespace rendering
* renderer: fix ubsan warning when casting ints
* renderer: fix tab handling
There's a bug with inconsistent tab widths caused by fontgroups.
* renderer: fix glyphs being loaded over and over
* renderer: add glyphmap size
* renderer: store per-surface offset_y and use it to find best-fitting surface
* renderer: fix MSVC compiler error
* renderer: remove return value from ren_font_glyph
* renderer: refactor xadvance calculation
* renderer: fix double free SDL_RWops if FT_Set_Pixel_Size fail
* renderer: always try .notdef before U+25A1
* renderer: disable ren_font_dump yet again
Accidentally commited this change.
* renderer: remove unused imports
* renderer: fix double free with FT_Open_Face
* renderer: return SDL_Surface in font_find_glyph_surface
* renderer: bring back metric flags for future extension
* renderer: refactor xadvance calculation into macro
* renderer: fix comment
* renderer: store GlyphMetric directly in the surface
* renderer: remove duplicated comment
* renderer: rename font_find_glyph_surface to font_allocate_glyph_surface
* renderer: refactor glyphmetric retrieval into an inline function
* renderer: do not render glyphs with bitmap set to null
This is a weird edge case, but at least it shouldn't crash
* renderer: refactor face metric code into its own function
* renderer: actually check if glyph fits in surface
* renderer: rudimentary support for non-scalable faces
At least it won't render nothing on the screen
* renderer: check for font_surface instead of metric directly
This is safe and shorter
* renderer: fix indentation
* renderer: rename GLYPH_PER_ATLAS to GLYPHS_PER_ATLAS
* renderer: rename all GLYPH_PER_ATLAS correctly
* renderer: make utf8_to_codepoint slightly more durable
* renderer: fix compiler unsigned cast warning
* macos: support drag-and-drop and default file associations
* resources/macos: use LSItemContentTypes to narrow down files
* macos: support opening folders
* rootview: workaround macos weird dnd event timing
* core/rootview: rename variable and refactor if statement
* resources: update copyright in info.plist
* meson.build: dynamically generate current year
"present" may be misleading.
* resources/macos: remove unecessary newlines
* ci: use latest macos images
* ci/build: clarify the purpose of md5sha1sum
* meson.build: remove hidapi usage
* ci: downgrade macos version for universal build
* scripts: codesign the universal binary with sha1 and sha256
* ci: revert back to macos-14 for universal
* ci/build: remove old comment
* CI: update various action versions
The most significant change is action/upload-artifact@v4,
which does not support uploading artifacts of the same name.
This makes our lives significantly worse, but I don't know
if GitHub will remove v3 in future or not.
* CI: fix macOS universal artifact download
* CI: update release action versions
* CI: use containers only for building
* CI: fix multiline commands
* CI: try to fix multiline strings again
* CI: fix multiline strings again ugh
* CI: Fix ccache in containers
* CI: Fix quotes again
* CI: fix ccache
* CI: fix deprecated set-output command
* ci: update build box to v2.1.2
* ci: revert to softprops/action-gh-release
* ci: add name to release
* ci: remove name again
* ci: fix wrong outputs reference
* ci: add name
* ci: add missing name for each step
* ci: format yaml files
* ci/release: add names to unamed entries
* ci/release: fix MSYS2 not downloading deps
* ci/release: change to ncipollo/release-action
There is some weird issue with softprops/action-gh-release and I can't update an existing release.
* ci/release: allow updating releases
* ci/release: upload all artifacts, then download them at once
* ci/release: use a better name for job
* ci/release: add release as dependency
* ci/release: set tag for update release
* ci/auto-labeler: remove workaround for old autolabeler issue
* ci/release: remove the need of another bash -c
* ci/release: remove weird bash -c
* ci: generate better release notes
* scripts: rename generate-release-note.sh
* ci/release: check out all the history
* ci/release: accept version from input
* Make command palette item scrolling more natural
Also add a config option for the maximum number of visible entries in the command palette.
* Make `autocomplete` item scrolling more natural
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* feat(process): allow commands and envs on proces_start
* refactor(process): copy process arguments once whenever possible
Refactors the code to use an arglist type which is just lpCmdline on Windows
and a list in Linux.
The function automatically escapes the command when it is needed, avoiding
a second copy.
This also allows UTF-8 commands btw.
* fix(process): fix invalid dereference
* refactor(process): mark xstrdup as potentially unused
* feat(process): add parent process environment when launching process
* fix(process): fix operator precedence with array operators
* fix(process): fix segfault when freeing random memory
* fix(process): fix wrong check for setenv()
* fix(process): fix accidentally initializing an array by assignment
* fix(process): clear return value if success
* docs(core.common): add and improve documentation
* refactor(core.common): remove unused variable to get_height()
* docs(core.common): remove messy newlines
* docs(core.common): fix wording
* docs(core.common): use integer instead of number
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* docs(core.common): update docs
the docs now follow the style in docs/ directory.
some of the changes suggested are also implemented.
* docs(core.common): fix typo
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* docs(core.common): restyle annoatations
Extra whitespaces are removed and @overload is used whenever possible.
* docs(core.common): fix various documentation errors
* docs(core.common): simplify unicode description
* docs(core.common): fix return value
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* docs(core.common): clarify common.bench for not being a benchmark
* docs(common): add disclaimer for numbers in common.serialize
---------
Co-authored-by: Guldoman <giulio.lettieri@gmail.com>
* feat(src/renderer): stream fonts with SDL_RWops on all platforms
This fixes#1529 where the font itself carries the font file, which gets copied around.
This commit streams the file, so the file is not entirely in memory.
* style(src/renderer): use standard C types
* refactor(src/renderer): implement FT_Stream.close
* fix(src/renderer): fix SDL_RWops double free