4 ms·
MiniFB: Small cross platform library to create framebuffer to draw pixels in
- gameswithgo 6y agothis is a great crate for doing quick prototypes, testing image processing and graphics ideas, or just to go back to 1990
- avmich 6y agoIs there something similar for JVM?
- t0astbread 6y agoIsn't Graphics2D quite capable?
- avmich 6y agoSomething cross-platform would be nice, and without some quirks (e.g. can draw a line fine, but to draw a pixel an extra object layer is needed).
- Stephanemw 6y agoOh wow, blast from the past! Yes there was! I built something for the JVM, way back in the days as I wanted exactly this for my Zaurus (X11 'wasted' 800kb!) My first pass was pure-Java as that was a thing back then, that and at 320x240 it was plenty fast enough; accessing the framebuffer as a random-access file and streaming from the input devices worked well enough. This also made it easy to support VNC. The BDF font renderer was fun to write and eventually got re-used in JNode and I think there was query about Maemo too. The project went through a few name changes (fbAWT, Odonata, FBToolkit)[0] and later also formed part of a collaboration with Guillaume Legris refactoring the rendering plugins and adding microbackend support. Guillaume added native libraries to speed things up for larger screens and generally took over maintenance; my life had got a bit busy. FBToolkit was also accepted as one of the projects used to try out the emerging OpenJDK open collaboration process [1]. Happy to answer questions if I remember that far back :-) [0] fbAWT, Odonata, FBToolkit (zips actually work?!): http://web.archive.org/web/20060821072155/http://odonata.tangency.co.uk/ http://web.archive.org/web/20060821072155/http://odonata.tan... [1] Framebuffer Toolkit: http://openjdk.java.net/projects/fbtoolkit/ http://openjdk.java.net/projects/fbtoolkit/
- albertzeyer 6y agoLooks very similar to SDL (http://www.libsdl.org/ http://www.libsdl.org/). What's the difference?
- moonchild 6y agoSDL supports hardware acceleration (opengl: glx, wgl; vulkan; etc.). It also has its own drawing library, and generic platform abstraction library.
- the_pwner224 6y agoSDL has more features: joystick/gamepad input, image loading from PNG/etc, scaling/rotating/overlapping images onto the framebuffer, multiple windows, touch events, audio, and a lot more[0]. And is GPU accelerated for 2d, or 3d with opengl. It's more of a generic application framework which works well for games, whereas this seems to be more of put a window on a screen, fill pixels, and get mouse/KB/resize events. http://wiki.libsdl.org/Introduction http://wiki.libsdl.org/Introduction SDL also has stuff that lets it work nicely with HiDPI screens.
- albertzeyer 6y agoI think SDL also mostly started like that (just a window where you fill pixels, and very basic kb/mouse events). You can also very easily use it just like that (which is why this looked so similar to me like MiniFB). Then over time, more and more people used it, and had special request. E.g. to be able to setup an OpenGL context. Use gamepad input (as this was used mostly for games). Multiple windows. Etc.
- jbirer 6y agonice. I am writing a hobby OS for RISC-V and I might implement this in it.
- marcodiego 6y agoI still miss the simplicity of Borland's BGI and somewhat happy with direction SDL_bgi is taking: http://libxbgi.sourceforge.net/ http://libxbgi.sourceforge.net/ . Latest version has support to Broland's .CHR fonts and seeing those glyphs rendered on modern hardware after 30 years is very cool. Disclaimer: I'm a contributor.
- jms55 6y agoFor Rust, there's the very similar https://github.com/parasyte/pixels https://github.com/parasyte/pixels. Unlike MiniFB, it doesn't handle windowing for you (you use winit/sdl2/glfw). It's built over wgpu-rs, so it runs on Vulkan/Metal/DirectX12/WEBGPU. You can compile to wasm, and then run your game in the browser, which is neat. And you can add custom shaders on top. I used it for my game, and was very happy with it https://github.com/JMS55/sandbox https://github.com/JMS55/sandbox
- ChickeNES 6y agoThere's already a version of minifb for Rust though: https://github.com/emoon/rust_minifb https://github.com/emoon/rust_minifb
- jms55 6y agoYes, that's also an option. I tried that initially for my game, but I ended up liking pixels better, in part due to the WASM and shader support.
- qchris 6y agoI've used this library on a few occasions on personal projects, and once the necessary system deps are installed (just a few apt-get commands that are well-documented), it's worked pretty flawlessly. Fairly low boilerplate, good examples--I haven't had any regrets on deciding to use it.
- fulafel 6y agoDo you mean it will run on browsers when/if they enable webgpu, or does wgpu-rs have other browser compatible backends?
- icebraining 6y agoThere's early support for an OpenGL backend, which can then run on WebGL.
- jms55 6y ago
- swiley 6y agoOne of the only nice things about X11 is that getting a drawing context and drawing lines and (unwrapped) text on it is super easy.
- tonetheman 6y agoFeels a lot like raylib or sdl to me. Both of those projects are more about games and have other functionality.
- ShizzleNauts 6y agoSo frustrating to see a graphics related tool not have any example screenshots in the README.