Sign in to follow this  
sudipta

How to direct a simple graphics application to a framebuffer of our choice

Recommended Posts

Hi,

 

I am a beginner and i was going through the legacy tutorials provided in http://nehe.gamedev.net/ .

I want to direct one of the simple application lets say Lesson 3 of Adding Color i.e. 

 

http://nehe.gamedev.net/tutorial/lessons_01__05/22004/   to a framebuffer of my choice i.e. /dev/fb1.

 

1. Where in the code i have to modify so as to achieve this?

2. While running the application, how can i verify that it is using /dev/fb1 for display?

 

Any help in this regard is highly appreciable.

 

Thanks in Advance,

 

Sudipta

 

Share this post


Link to post
Share on other sites

if you are ok with software rendering, it should be fairly straightforward to configure MESA to software-render OpenGL content into /dev/fbX. Please note that this is system configuration, not something you can code in your application.

 

If you want hardware-acceleration (i.e. to use the actual GPU), then you need one of a variety of experimental drivers which support "OpenGL without X". I don't believe any of these approaches are stable or supported at this time, but you can search around for the 'Wayland' project, or MESA's fbdev/DRI drivers.

 

A more relevant response, perhaps, is to ask [b]why[/b] you want to do this? Apart from a few scenarios involving headless server setups, I'm struggling to come up with a need to render OpenGL directly into the linux framebuffer...

Share this post


Link to post
Share on other sites

Hi Swiftcoder,

 

Thanks for your reply. I am trying with graphics overlay on video streaming in which my video will appear on /dev/fb0(background) and the graphics will be overlayed on top of it i.e. /dev/fb1(foreground).But,i  am stuck how to direct the graphics(application about which i asked above) to /dev/fb1.

 

Sudipta

Share this post


Link to post
Share on other sites

I got it right.

There is a file named fsl_egl.c in which i could set the framebuffer to /dev/fb1 instead of default(as /dev/fb0).

 

In common/src/fsl_egl.c

 

#elif (defined EGL_API_FB)
eglNativeDisplayType = fbGetDisplayByIndex(0); //Pass the argument as required to show the framebuffer.. 
 
Change it to "1" to have it right on fb1.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this