Skip to content

Decode PNG and JPEG textures with stb_image - #367

Merged
corepunch merged 1 commit into
mainfrom
stb-image
Oct 3, 2026
Merged

corepunch merged 1 commit into
mainfrom
stb-image

Conversation

@corepunch

Copy link
Copy Markdown
Owner

Summary

  • Decode PNG and JPEG textures with vendored stb_image 2.30 (source/renderer/texture/r_image_stb.c) instead of libpng and libjpeg.
  • Keep the previous upload behavior: PNG expands to RGBA, flips only for GL_TEXTURE_2D, and premultiplies when requested; JPEG uploads as RGB and is flipped. ASTC, DDS, and PVR are unchanged.
  • Drop libjpeg and libpng from the engine pkg-config line, WebGL USE_LIB* flags, Xcode link flags, CI, and install docs. A missing libjpeg.pc was failing the whole pkg-config invocation and removing the Lua include path, which broke make cluster on macOS. Fonts still use FreeType.

Test plan

  • make unite compiles every module and links liborca.so and orca with no libjpeg or libpng symbols in the renderer object.
  • Vendored stb_image decodes a 2×2 PNG (top row red, second row green/blue).
  • Run make cluster and confirm a screen that uses PNG or JPEG images still looks right, including premultiplied alpha and texture orientation.

Drop libjpeg and libpng from the engine build. A missing libjpeg.pc was
failing the whole pkg-config call and stripping the Lua include path.
@corepunch
corepunch merged commit cfa764f into main Oct 3, 2026
6 checks passed
@corepunch
corepunch deleted the stb-image branch October 3, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant