SFML community forums
Help => Graphics => Topic started by: James Lehman on October 20, 2013, 10:13:08 pm
-
Hello everyone.
I have a quick question:
I have already written an app that uses SDL 1.2 and with that I can get to a graphics area in Windows, Max OSX, and Linux with X
*PLUS* it lets me run the app in a native Linux console (no X) and get the whole screen via the Linux Framebuffer.
Is this also possible with SFML?
Thanks!
James. :)
-
No. SFML is a modern API which uses OpenGL (and X for the windowing system), it's not meant to work on such configurations.
-
Thank you Laurent for your answer.
Do you think there might be some value in adding this capability?
I don't think it would be too difficult. The Linux Framebuffer API is very well defined and it seems to work the same as any other bitmapped screen area. You just get a width and height in pixels, a bits per pixel and an address to the first pixel.
This is particularly nice for tiny embedded devices like the Raspberry Pi and other ARM based boards with limited resources.
Plus it's in the video RAM so it's super fast (with no window manager overhead).
James. :)
-
I think you underestimate this task. It may not even be possible; as far as I know (from my quick Google search) OpenGL cannot be used on top of the Linux Framebuffer. Not to mention that half of the API would be impossible to implement (basically all the stuff in sfml-window).
When I said that SFML is not designed for such systems, I really meant it. It's not just a matter of writing some code to support it.
Note that the Raspberry Pi will be supported soon with the EGL / GL ES implementation.
-
OK. Thank you again for your answer.
Hopefully my question is of some value to others who are looking for similar information.
I guess I understand what you are saying. You would have to throw away almost all of the functionality of the SFML window class and only get the benefit of a bitmapped screen area.
The main reason I was looking at SFML is because I just noticed that SDL has come out with SDL2. I'm not even sure that SDL2 still supports a direct connection to the Linux Framebuffer. But while I was looking for stuff about it, I found a comparison of it to SFML. So I started looking at that.
One thing I really like about SFML is the fact that it is truly written in C++ and is a nice collection of classes, rather than C.
James. :)
-
Actually, GL does work on the framebuffer. I know this because someone has already ported SFML to the pi.
https://github.com/mickelson/sfml-pi
Reaaaaaly late, I know.