game programmer.
dear imgui / wonder boy: the dragon's trap / tearaway, dreams / pixeljunk shooter, 4am / soul bubbles

This profile is from a federated server and may be incomplete. View on remote instance

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Releasing today: 'ProggyForever': a new MIT-licensed scalable font designed to closely match ProggyClean which happily served as Dear ImGui default font for 10+ years: https://github.com/ocornut/proggyforever
The new font is now embedded by default in Dear ImGui (compressed down to ~14 KB).

ALT
ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

TL;DR:

  • There are few MIT-licensed fonts.
  • ProggyVector was 99% there but its license stack was not purely MIT (parts of it relied on an old non-standard license, potentially creating legal friction).
  • To solve this, we had a new font created.
  • ProggyFonts author approved 👍
ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@tomcat It's mostly an ASCII + West European accent fonts, exactly same as ProggyClean. It's not a fancy international-support font but rather something that is small enough to be embeddable as a default.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@tomcat There are many free licensed fonts. Mostly this one purpose is to match old dear imgui font + use MIT license.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Ran into an odd MSVC compiler bug today: a missing parenthesis in a specific place, in a large source file, leads compiler into allocating all my RAM, which eventually led my computer to crash. I can reproduce it reliably.
If I uncomment the extra opening brace it reports error normally.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

I can't bother investigating because it quickly puts the computer to a crawl, but I would guess it is getting into a weird parsing/tokenizing state where the remainder of the large source file is being processed as part of that expression, or something of that sorts. Also happens after updating toolchain.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Update: bug was in an old version of the tool-chain (v140/2015) and fixed in more recent ones. I frequently use old tool-chains to exercise them, but it was my mistake to update VS yet forget to consider the project was using an older tool-chain.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

To increase feature discovery I often try to make the software self-documenting. Here e.g. I added a help popup in the error log when running automated tests from the GUI. Each of them needs to be designed to not get in the way of advanced users.

video/mp4

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Dear ImGui now embeds a vector/scalable version of the classic font by default, manually subsetted/optimized so it fits in 18 KB (opt-out possible). Embedding ensures easily and readily usable in all contexts. Should default to new one on most setups. Here's a compare of both.

video/mp4

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Required quite some tweaks to get right & small. Still mono-space and configurable, just changes the initial default above a certain scale threshold. You can opt-in to the classic bitmap one. I believe new one is a better default, hopefully makes a non-configured Dear ImGui nicer.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Below 4K resoltions, without imgui_freetype and at same size than the classic bitmap font, most fonts didn't look great enough. New font IMHO looks worse at 13px (below selection threshold) but not shocking. From 14px it looks competitively good. Nowadays most apps would default to larger sizes.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Converging toward a principal Unreal Engine backend/binding for Dear ImGui? https://github.com/ocornut/imgui/issues/9122 (Help wanted!)

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Someone nudged me yesterday and I finished some old stashed thing: added color component markers to ColorEdit (+ opt-out flags/styling options + opt-in flags on regular non-color multi-components widgets).

@SoufianeKHIAT@mastodon.gamedev.place avatar SoufianeKHIAT , to random

Want to talk about ImAnim: Animation Engine for Dear ImGui ( @ocornut )? (:
https://news.ycombinator.com/item?id=46109080
https://github.com/soufianekhiat/ImAnim
1/8

video/mp4

ocornut ,
@ocornut@mastodon.gamedev.place avatar

@SoufianeKHIAT il manque le 8/8 :)

@ocornut@mastodon.gamedev.place avatar ocornut , to random

dear imgui 1.92.5 released! 🪩
https://github.com/ocornut/imgui/releases/tag/v1.92.5

  • many fixes/changes for Tables, InputText, Keyboard navigation, disable mode, single-axis auto sizing, backends etc.
  • webgpu backend update for latest Emscripten API changes & native Dawn/WGPU.

image/jpeg
image/png
image/jpeg

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

(
Screenshots credits:

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@mcc Hi! I haven't had time to investigate nor try it. Since my only active projects are hosted on GitHub it doesn't seem like a priority to me.

@xgranade@wandering.shop avatar xgranade , to random

Every once and a while, someone tries to convince me that C and C++ are not bad languages. Sometimes this is a well-meaning friend, sometimes this is a random drive-by, sometimes it's an out and out troll. Regardless, though, please let me assure you of a few things:

• I know what I'm talking about.
• It's taken me the better part of thirty years to arrive at this opinion.
• This is not an uninformed opinion.
• You probably won't be the one who changes my mind on this.

ocornut ,
@ocornut@mastodon.gamedev.place avatar

@azonenberg You are already doing things right on this matter there isn’t anything to improve imho. How would pulling lib from another source help you in any way to verify that your code still works with latest?

@ocornut@mastodon.gamedev.place avatar ocornut , to random

I've been naturally tending toward using more ternary operators and writing more branchless code over time. I find it generally elegant and compact. But it's true that it's a little less easy to debug step into or to set breakpoints for.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@rygorous sorry I have meaning to clarify. I intuited that ternary only rarely naturally led to branchless, but using them tends to gets me code that reads similar to branchless style, as removing spelled out branches tends to lead me to eg sequences of |=.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@rygorous catching myself more regularly using constructs such as var |= (test ? constant : 0); and frankly I don’t do it expecting machine code level branchlessness, but merely source code level.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

(I am not socially shy but I have little confidence in my ability of organize my thoughts while speaking, even more so in technical fields, so I generally tend to avoid it!)

That said after that recording I realized there were lots of things I kinda want to talk about, but it may work better if I am not left rambling aimlessly around my own answers.
The "10 years of dear imgui" posts took me long to organize but have interesting stuff:
https://github.com/ocornut/imgui/issues/7892

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Łukasz from Wookash Podcast has posted a lengthy conversation I recorded with him a few weeks ago:
https://youtu.be/2KPUMvyUMzM
It's really awkward for me to watch it so I'll assume it's just confused rambling :)

@ocornut@mastodon.gamedev.place avatar ocornut , to random

C/C++: Looking for suggestions for a way to sensibly detect if an assert macro was defined to emit no code (e.g #define IM_ASSERT(_EXPR) (void)0) in order to report it in my config/build info blob. In a portable way. It doesn't need to be perfect, only generally reliable...

  • Could take address of successive functions to measure & compare their size, e.g. empty1(), withasserts(), empty2() hoping for alignment to not interfere?
    Other ideas?
ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Basically I want a decent, even unperfect heuristic to differentiate users doing:

SOME_ASSERT(EXPR) (void)
vs
SOME_ASSERT(EXPR) ActualAssertHandler(EXPR)

Where it is safe to call SOME_ASSERT(true) but I don't control the contents.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Ah. Just occurred to me that I could simply call MACRO(n++, true) and compare value for n...

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@nytpu Someone suggested that but AFAIK the stringify will return a "IM_ASSERT(true)" string here.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@nytpu Thanks this indeed works. One problem is that it often emit an absolute FILE and this is not something we want to expose in About Box for people to copy and paste, so need some string compare heuristic.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Ended up pushing this:
(It's merely two heuristics so I might tell if a user making a bug report has asserts disabled. Not exposing full stringified version because it often contains absolute FILE path, nor full length to reduce noise.)
https://github.com/ocornut/imgui/commit/149587b85b511feda41fad8393dc87906355b006

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Bit far-fetched, but I created a topic to gather links/videos of software using the Dear ImGui Test Engine for automation: https://github.com/ocornut/imgui_test_engine/issues/85

If you happen to use this somewhere would be nice to drop a word of a capture! (pictured in video: Wonderland Engine https://wonderlandengine.com)

video/mp4

@ocornut@mastodon.gamedev.place avatar ocornut , to random
ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

(
shots:

@nlnet@nlnet.nl avatar nlnet , to random

Are you working on Free & Open Source technologies that benefit other people too? Consider to apply for funding in our open calls.

  • You can ask for between 5k - 50k euro
  • Anyone can apply: individuals, SMEs, institutions, collectives, etc.
  • There is little administrative overhead: no reporting-the project is the proof of work. And the application form is simple & straightforward.
    The next deadline for the rolling open call is October 1
    https://nlnet.nl/news/2025/20250801-call.html
ocornut ,
@ocornut@mastodon.gamedev.place avatar

@Donat @nlnet Thank you for letting me know about this! I made a submission.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Dear ImGui 1.92.3 released!
https://github.com/ocornut/imgui/releases/tag/v1.92.3

  • InputTextMultiline() word-wrapping.
  • Misc scaling/DPI helpers fixes on backends for Linux X11/Wayland/OSX.
  • 20+ other fixes or small additions (fonts, navigation, inputtext, debug tools, etc.

image/jpeg
image/png
image/png

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

(
screenshots credits:

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Pushed a much requested ImGuiInputTextFlags_WordWrap flag to public API for multi-line word-wrapping editor.
There's zero caching and it's rather slow for my taste (on my 2019 desktop, for a 100 KB text buffer: +~0.3 ms optimized, +~1.0 ms debug). Cost is roughly proportional to buffer size.

video/mp4

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

So editing a 10 KB-20 KB is likely to be perfectly fine (editing a 1000 KB buffer in a full Debug build not so much).
With e.g. UTF-8 involved and various API/legacy it's not trivial to do much better at the moment, but I thought it was best to publish in current state and I'll improve when I can.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

Was tricky to get right: when the editing cursor is precisely at a wrapping point, it may be represented at two different locations (end of line 1 vs start of line 2) depending on context, and its visible location has an effect on subsequent moves.

@INCD021@mastodon.gamedev.place avatar INCD021 , to random

So after fighting and not getting it to work, I've switched to and it worked right away. I think I'm just not used to and VS Code setup yet, and I've been pampered way too much over the past decade with nice looking IDEs. They are good, but also hide a lot of what is going on under the hood. So it's nice having to be so explicit. Also why I'm turning to C++ again. Not too much magic!

ocornut ,
@ocornut@mastodon.gamedev.place avatar

@INCD021 Can you clarify what your problem was? There’s a guide https://github.com/ocornut/imgui/wiki/Getting-Started

ocornut ,
@ocornut@mastodon.gamedev.place avatar

@INCD021 glad you got it working! There’s merely a suggestion in the page saying “ For other programming languages or framework see our Bindings/Backends https://github.com/ocornut/imgui/wiki/Bindings page.” I will reword this to make more noticeable. This is useful feedback, thanks!

ocornut ,
@ocornut@mastodon.gamedev.place avatar

@INCD021 there are almost 50 non official backends I cannot mention them them in this page that’s what the other page is for, but I will reword the page so it is more noticeable that you access this list.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

dear imgui 1.92.2b hotfix release
https://github.com/ocornut/imgui/releases/tag/v1.92.2b
(1.92.2 has a bug with using IsItemHovered() on disabled items or items with no identifier while clicking on them + misc improvements to Allegro5 backend)

@ocornut@mastodon.gamedev.place avatar ocornut , to random

dear imgui 1.92.2 release
https://github.com/ocornut/imgui/releases/tag/v1.92.2

  • improving tab bar resizing logic (combining shrinking and scrolling).
  • misc keyboard nav fixes, table fixes, font fixes & many others.
  • backend fixes (vulkan+linux w/ some drivers, SDL_GPU use SDL_GPUTexture* as texture id).

image/png
image/jpeg
image/jpeg

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

(
screenshot credits:

@azonenberg@ioc.exchange avatar azonenberg , to random

Hey @ocornut I'm talking to somebody about sponsoring work on https://github.com/ocornut/imgui/issues/8609 so we can get full multi-viewport working on Wayland.

Is this something you'd be interested in working on for the right price? If so, what's a good way to discuss specifics?

ocornut , (edited )
@ocornut@mastodon.gamedev.place avatar

@azonenberg I wouldn’t be able to do it myself as I’m not comfortable with Linux etc. But I could give advices as to how get a PR accepted. Regression Tests are needed (test engine has a mock viewport backend which can run headless, ideally we’d like it to simulate quirks of various systems). Preferable if the person can also have occasional access to a Windows to test their changes.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Spent 2 hours today skimming through ~8 hours worth of video of TheCherno painfully going through a 3-4 years update of a forked version w/ old copied code relying on internals, non-updated extensions, etc.

Took many notes and added comments to facilitate things for others in a similar situation.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@azonenberg Probably will get rewritten/redesigned to be better before it does. It's currently confusing.

@ocornut@mastodon.gamedev.place avatar ocornut , to random

Is there a portable low-level trick way for callbacks in my C++ codebase to support capturing lambdas, without relying on std::function/<functional>, or with less overhead?

Merely wrapping a function pointer in std::function<> makes the call jumps through unacceptable hoops (gave up stepping after 400+ instructions, that's without capturing anything).

I don't mind capturing users paying the cost, but I don't want raw function pointers users to be paying so much. Is there a way?

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar

@mikejsavage @pervognsen It was and I think I even asked the same thing (couldn't find it). Cross-server searches/replies on matsodon are weird, maybe if you use their server you can find the reply.

ocornut OP ,
@ocornut@mastodon.gamedev.place avatar