Skip to content

update stb libraries - #1010

Draft
TomJGooding wants to merge 2 commits into
Immediate-Mode-UI:masterfrom
TomJGooding:update-stb-libraries
Draft

TomJGooding wants to merge 2 commits into
Immediate-Mode-UI:masterfrom
TomJGooding:update-stb-libraries

Conversation

@TomJGooding

@TomJGooding TomJGooding commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

I noticed a flurry of updates in the stb libraries recently - this updates those years old files in Nuklear.

I confirmed that our previous patch to stb_truetype.h in #905 has now been fixed upstream.

Resolves #953

stb_rect_pack.h and stb_truetype.h were last updated back in 2021.
Update with the latest versions following a flurry of updates recently.
@RobLoach

Copy link
Copy Markdown
Contributor

Thanks, should this target 5.x branch?

@RobLoach

Copy link
Copy Markdown
Contributor

Also, could there be a way for us to consolidate all the stb dependencies into one folder so it's easy to update down the line?

@TomJGooding

TomJGooding commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

We could move these to some thirdparty/vendor/dependencies folder - just let me know your preference for the name!

Does this need to target the 5.x branch? These files aren't compatible with c89 already, hence the script to remove the comments?

I haven't updated stb_image.h only because I wasn't sure where it belongs #953 (comment). But again, these files aren't compatible with c89 already.

EDIT: Sorry just to clarify: the reason for not simply updating these files when the issue was initially raised was about c89 compatibility, where we discussed needing some script for fetching the latest versions and removing C++ comments (and applying our patches). But since the relevant demos/examples are complied with -std=c99 already, and Nuklear soon will be moving away from c89 anyway, is there any reason not to update now?

The copies of `stb_image.h` in `example/` and `demo/` are very old and
different versions: v2.08 and v2.28 respectively.

Update both to the latest version (v2.32) following a flurry of updates
recently in the stb libraries.

Resolves Immediate-Mode-UI#953
@TomJGooding

Copy link
Copy Markdown
Contributor Author

I realise that moving the stb libraries to some /thirdpaty folder would require a bit of rewiring (see #953 (comment)), but I'm more than happy to tackle this now rather than revisit later if it helps!

For now I've updated both copies of stb_image.h in example/ and demo/. Alternatively as suggested in #953 (comment), we could remove one and just point the other demo/examples to that version.

@TomJGooding

Copy link
Copy Markdown
Contributor Author

There's also nuklear_text_editor.c which is a modified version of stb_textedit as pointed out in #953 (comment). That's also a very old version (v1.8 back in 2016), but obviously is less straightforward to update.

This branch has not been deployed

No deployments
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.

stb_image inconsistencies

2 participants