3 ms·
Not necessarily. Most desktop OS compositors provide a void** buffer that can be blitted to. Sure, this buffer will probably end up going through the composito
by delta_p_delta_x 3mo ago
Not necessarily.
Most desktop OS compositors provide a void** buffer that can be blitted to. Sure, this buffer will probably end up going through the compositor which does GPU hardware acceleration anyway, but it is definitely possible to shrink the application-side stack without relying on D2D/GLUT/GLEW/GLFW/SDL/WGPU in this case.
On Windows: CreateDIBSection and BitBlt
On macOS: CALayer and CATransaction commit
Not sure about Linux, too many stacks involved.
- LoganDark 3mo agoCross-platform support can be more difficult in that case, but yes it is possible.
- mananaysiempre 3mo ago> Not sure about Linux, too many stacks involved. Wayland: wl_shm and that’s it for the “stack”.
- Lerc 3mo agoI have done this on a number of platforms over the years. Going back to before createDIBSection existed (In fact I had something break when Windows provided an easy path and took away the method I had been using). Linux has always been a weird kettle of fish, the thing that worked best for me was imlib2 which was originally part of enlightenment. It did what it was supposed to do, hid pixel format conversion without killing performance. I'm not sure what would serve a similar function today, If anyone knows of a library that takes a rectangle of memory, a pixel format and places it onscreen regardless of the display environment I'd like to hear about it. The faster and more efficient, the better. More features than needed, worse.
- lelanthran 3mo ago> If anyone knows of a library that takes a rectangle of memory, a pixel format and places it onscreen regardless of the display environment I'd like to hear about it. I've used SDL for this in the past.
- stevekemp 3mo agohttps://zserge.com/posts/fenster/ https://zserge.com/posts/fenster/ is what I used when I wanted "basic graphics" in a cross-platform way. But of course that's X11 and much simpler.
- pjmlp 3mo agoAh, got me hooked readying the rest of the post with the "BGI and BASIC’s painting commands" reference. :) Great overview of the whole approach you took there.
- pjmlp 3mo agoBefore those days, the solution would be to make use of WinG, the DirectX precursor, still introduced in Windows 3.0 https://www.gamedeveloper.com/programming/a-whirlwind-tour-of-wing https://www.gamedeveloper.com/programming/a-whirlwind-tour-o... https://betawiki.net/wiki/WinG https://betawiki.net/wiki/WinG
- nkrisc 3mo agoHandling platform-specific details like isn't really the fun part of writing a CPU renderer, IMO.