How to direct a simple graphics application to a different framebuffer?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to direct a simple graphics application to a different framebuffer?

954 Views
sudiptasubudhi
Contributor III

Hi,

I am using a simple graphics application VertexColors.c in gpu_sdk_v1.00 from freescale. It has main(), init(),render(),resize() as the function blocks. and the flow of calls is like

1.main() => init() (i.e. main() is calling init())

2.init() => resize()

3.after init(), main() => render()

and then  eglSwapBuffers(egldisplay, eglsurface) is called.

And now to direct it to /dev/fb1 i assume i have to include:

        int fd_fb,result;

        //Applying color key

        struct mxcfb_color_key color_key;

        color_key.color_key = 0x0;

        color_key.enable = 1;

        if ((fd_fb = open("/dev/fb1", O_RDWR, 0)) < 0)

        {

        return 0;

        }

        if ( ioctl(fd_fb, MXCFB_SET_CLR_KEY, &color_key) < 0) {

        printf("Error in applying Color Key\n");

        }

        struct mxcfb_loc_alpha loc_alpha;

        ioctl(fd_fb, FBIOBLANK, FB_BLANK_NORMAL);

        loc_alpha.enable = 1;

        loc_alpha.alpha_in_pixel = 1;

        result = ioctl(fd_fb, MXCFB_SET_LOC_ALPHA, &loc_alpha);

        if (result < 0)

        {

                printf("fb ioctl MXCFB_SET_LOC_ALPHA fail\n");

                //goto err1;

        }

        ioctl(fd_fb, MXCFB_WAIT_FOR_VSYNC, 0);

        ioctl(fd_fb, FBIOBLANK, FB_BLANK_UNBLANK);

        close(fd_fb);

Please correct me if i am wrong or if i am missing any details. But, i wonder where to include this piece of code in the given application.

Thanks in advance.

Sudlin

0 Kudos
1 Reply

406 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport
0 Kudos