framebuffer

How to deal with the layouts of presentable images?

三世轮回 提交于 2019-12-01 20:10:56
A presentable image starts out in VK_IMAGE_LAYOUT_UNDEFINED but will be VK_IMAGE_LAYOUT_PRESENT_SRC_KHR after they have been presented once. A lot of examples do a transition of all vkImages to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR immediately after creating the vkSwapchain . Which allows them to use an VK_IMAGE_LAYOUT_PRESENT_SRC_KHR for oldLayout . But doing the transition right after creation of the swapchain is not allowed. Use of a presentable image must occur only after the image is returned by vkAcquireNextImageKHR , and before it is presented by vkQueuePresentKHR . This includes

invalid argument error when setting yres_virtual in fb_var_screeninfo

别等时光非礼了梦想. 提交于 2019-12-01 19:48:35
I'm trying to make an application for linux that writes directly to the framebuffer /dev/fb0. In order to make it double buffered I try to make the virtual screen be double the size of the screen. This is the program I wrote: struct fb_var_screeninfo screeninfo_var; struct fb_fix_screeninfo screeninfo_fixed; unsigned int* screenbuffer; void gfx_init() { fb0 = open("/dev/fb0", O_RDWR); if(fb0 == 0) error("Could not open framebuffer located in /dev/fb0!"); if (ioctl(fb0, FBIOGET_FSCREENINFO, &screeninfo_fixed) == -1) error("Could not retrive fixed screen info!"); if (ioctl(fb0, FBIOGET

Python Webkit making web-site screenshots using virtual framebuffer

懵懂的女人 提交于 2019-12-01 09:04:29
问题 The problem is that I need capture web-site screenshots without running X server. So theoretically it's possible to create a virtual frame buffer and to use it to capture screenshot. Is there any similar solutions, any advice would be appreciated? Sultan 回答1: you can use a combination of Selenium WebDriver and pyvirtualdisplay (which uses xvfb) to run your browser in a virtual display and capture screenshots. so, the setup you need is: Selenium Python bindings pyvirtualdisplay Python package

Linux framebuffer graphics and VSync

风格不统一 提交于 2019-12-01 07:38:34
I'm making a game in C that works on the linux framebuffer. So far I have a red 100x100 square that moves in tandem with the mouse, just like a pointer. I have implemented double buffering and it works correctly (the square doesn't flicker). The problem is, there is quite a lot of tearing happening horizontally. What I mean by that is, when the square moves on the x axis, it's like it is divided horizontally, and one part of it advances slithgly more than the other. This "rip" slowly propagates from top to bottom on the square if i keep moving it. I believe it happens because the hardware

invalid argument error when setting yres_virtual in fb_var_screeninfo

*爱你&永不变心* 提交于 2019-12-01 05:11:07
问题 I'm trying to make an application for linux that writes directly to the framebuffer /dev/fb0. In order to make it double buffered I try to make the virtual screen be double the size of the screen. This is the program I wrote: struct fb_var_screeninfo screeninfo_var; struct fb_fix_screeninfo screeninfo_fixed; unsigned int* screenbuffer; void gfx_init() { fb0 = open("/dev/fb0", O_RDWR); if(fb0 == 0) error("Could not open framebuffer located in /dev/fb0!"); if (ioctl(fb0, FBIOGET_FSCREENINFO,

Linux framebuffer graphics and VSync

可紊 提交于 2019-12-01 04:33:58
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . I'm making a game in C that works on the linux framebuffer. So far I have a red 100x100 square that moves in tandem with the mouse, just like a pointer. I have implemented double buffering and it works correctly (the square doesn't flicker). The problem is, there is quite a lot of tearing happening horizontally. What I mean by that is, when the square moves on the x

Reading data using glReadPixel() with multisampling

浪子不回头ぞ 提交于 2019-11-30 17:22:06
问题 Presently I am trying to read the pixel data from the frame Buffer in order to capture the screen in IOS. GlreadPixels command works fine when using the following code to setup frame buffer :- //buffers // Create a depth buffer that has the same size as the color buffer. glGenRenderbuffersOES(1, &m_depthRenderbuffer); glBindRenderbufferOES(GL_RENDERBUFFER_OES, m_depthRenderbuffer); glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_DEPTH_COMPONENT24_OES, width, height); // Create the

OpenGL framebuffer: can clear it, but can't draw to it

跟風遠走 提交于 2019-11-30 10:03:36
On a Mac, I've got an OpenGL setup that is working just fine apart from framebuffers - texturing works, etc. So I know that texturing is enabled, I have a valid context, etc. All works flawlessly until I try to create a framebuffer. I created a framebuffer with glGenFramebuffers, glBindFramebuffer, and glFramebufferTexture2D, and glCheckFramebufferStatus is returning GL_FRAMEBUFFER_COMPLETE. If I then call glClear, followed by a call to glGetTexImage, the returned data shows that the glClear acted on the texture bound to the framebuffer just as it should. I can set glClearColor to anything I

Android: How can you get framebuffer (screenshot) on rooted device?

£可爱£侵袭症+ 提交于 2019-11-30 07:07:19
I tried : process = Runtime.getRuntime().exec("su -c cat /dev/graphics/fb0 > /sdcard/frame.raw"); process.waitFor(); but it doesn't work. My device is rooted. I see many answers that it requires rooted access, but no actual code to get the framebuffer. I also tried glReadPixels() but no luck. public void TakeScreen() { DisplayMetrics dm = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(dm); int width = dm.widthPixels; int height = dm.heightPixels; int screenshotSize = width * height; ByteBuffer bb = ByteBuffer.allocateDirect(screenshotSize * 4); bb.order(ByteOrder

How to write directly to linux framebuffer?

旧时模样 提交于 2019-11-30 07:01:00
问题 How to write directly to linux framebuffer? 回答1: look at FBIOPUT_VSCREENINFO, ioctl and mmap (I have the code but not at this pc, sorry) edit: this should get you started //open file descriptor and get info inf fdScreen = open( "devicename", O_RDWR ); fb_var_screeninfo varInfo; ioctl( fdScreen, FBIOGET_VSCREENINFO, &varInfo ); //set resolution/dpi/color depth/.. in varInfo, then write it back ioctl( fdScreen, FBIOPUT_VSCREENINFO, &varInfo ); //get writable screen memory; unsigned short here