Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void gfx_ctx_clearfb(void){
- eglMakeCurrent( NULL, g_dpy_surf, g_dpy_surf, g_dpy_ctx);
- char *pixels;
- char *mapped_mem;
- struct fb_fix_screeninfo finfo;
- int mapped_memlen;
- int mapped_offset;
- ioctl(fb, FBIOGET_FSCREENINFO, &finfo);
- mapped_offset = (((long)finfo.smem_start) -
- (((long)finfo.smem_start)&~(getpagesize()-1)));
- mapped_memlen = finfo.smem_len+mapped_offset;
- mapped_mem = mmap(NULL, mapped_memlen,
- PROT_READ|PROT_WRITE, MAP_SHARED, fb, 0);
- pixels = mapped_mem+mapped_offset;
- char *rowp = (char *)pixels;
- //TODO: fix to actual bytes per pixel (assumes 4Bpp = 32bpp)
- memset(pixels,0,native_window.height * native_window.width * 4);
- close (fb);
- //glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- //eglSwapBuffers(g_egl_dpy, g_egl_surf);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement