Skip to content

SDL: New OSD and Shader Support#7109

Merged
OBattler merged 3 commits into
86Box:masterfrom
ChrisDeadman:sdl_osd_new
May 2, 2026
Merged

SDL: New OSD and Shader Support#7109
OBattler merged 3 commits into
86Box:masterfrom
ChrisDeadman:sdl_osd_new

Conversation

@ChrisDeadman

@ChrisDeadman ChrisDeadman commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

I want to use 86Box on a Raspberry Pi without any X or Wayland, just boot into minimal init and 86box with SDL.
Since I was used to CRT shader on QT build, I was not happy to find out shaders are not supported in SDL backend, so this PR adds that shader support .

I've also implemented a new OSD based on imgui since I find the existing one to be a bit lacking.

Shader support is off by default, since it is not compatible with MacOS.
SDL Shaders can be enabled with -DUSE_SDL_SHADER=ON.
The old OSD is still the default, the new one can be enabled with -DUSE_IMGUI=ON.

image image image

Checklist

  • Closes N/A
  • I have tested my changes locally and validated that the functionality works as intended
  • I have discussed this with core contributors already (link to discussion)
  • This pull request doesn't require changes to the ROM set
  • This pull request doesn't require changes to the asset set

Comment thread src/unix/unix_sdl_shader.c Fixed
@OBattler

OBattler commented May 2, 2026

Copy link
Copy Markdown
Member

I think it would be a good idea to remove the old OSD as well.

@ChrisDeadman

Copy link
Copy Markdown
Contributor Author

I think it would be a good idea to remove the old OSD as well.

A few hours ago I would have agreed with you, but since the new OSD needs OpenGL it doesn't work on MacOS 🫤
At least I think so, don't really have experience with MacOS and do not own one.

@OBattler

OBattler commented May 2, 2026

Copy link
Copy Markdown
Member

Good point.

By the way, the shader code appears to break compile on MacOS:

FAILED: [code=1] src/unix/CMakeFiles/ui.dir/unix_sdl_shader.c.o 
/usr/bin/cc -DCMAKE -DDEBUG -DDISCORD -DUSE_DYNAREC -DUSE_SDL_UI -D_FILE_OFFSET_BITS=64 -I/usr/local/include/freetype2 -I/Users/runner/work/86Box/86Box/build/src/include -I/Users/runner/work/86Box/86Box/src/include -I/Users/runner/work/86Box/86Box/src/cpu -I/Users/runner/work/86Box/86Box/src/codegen -I/usr/local/Cellar/sdl2/2.32.10/include -I/usr/local/Cellar/sdl2/2.32.10/include/SDL2 -m64 -march=x86-64 -msse2 -mfpmath=sse -mstackrealign -fomit-frame-pointer -Wall -fno-strict-aliasing -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition  -ggdb -Og -std=gnu11 -mmacosx-version-min=10.13 -MD -MT src/unix/CMakeFiles/ui.dir/unix_sdl_shader.c.o -MF src/unix/CMakeFiles/ui.dir/unix_sdl_shader.c.o.d -o src/unix/CMakeFiles/ui.dir/unix_sdl_shader.c.o -c /Users/runner/work/86Box/86Box/src/unix/unix_sdl_shader.c
/Users/runner/work/86Box/86Box/src/unix/unix_sdl_shader.c:6:10: fatal error: 'GLES2/gl2.h' file not found
    6 | #include <GLES2/gl2.h>
      |          ^~~~~~~~~~~~~
1 error generated.

@ChrisDeadman

Copy link
Copy Markdown
Contributor Author

By the way, the shader code appears to break compile on MacOS

Yeah that's exactly the thing, can't get the shaders to compile because GLESv2 is missing.
I've adapted the Linux script to include libgles2-mesa-dev, and enabled USE_SDL_SHADER there.
But no idea how to pull in GLESv2 on MacOS or if it is even supported.

@OBattler

OBattler commented May 2, 2026

Copy link
Copy Markdown
Member

Then I agree, the old OSD should be kept in as well.

@OBattler OBattler merged commit 70a814f into 86Box:master May 2, 2026
45 checks passed
@ChrisDeadman ChrisDeadman deleted the sdl_osd_new branch June 4, 2026 16:30
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.

3 participants