Comments (2)
hi @gitbf
I am not the author of the double buffer mechanism, that credit goes to here: https://github.com/eyelash/tutorials/blob/master/drm-gbm.c
But I understand your problem, I had the same issue when I was working on a similar project. I have two solutions:
- Option A, render everything into an OpenGL framebuffer (or renderbuffer). You can still use double buffering for the final output, but your GUI will be rendered into separate framebuffer/renderbuffer. You will essentially have a single off-screen buffer. Even at full HD resolution, the extra framebuffer should only occupy 6.2MB of GPU memory. You can then have two choices to copy the framebuffer to the screen (to the backbuffer):
- Via glBlitFramebuffer, but that's only available if you replace
EGL_OPENGL_ES2_BIT
withEGL_OPENGL_ES3_BIT
(glBlitFramebuffer
is only available in OpenGL ES 3), but I have not tested it personally. - Via a shader program. Simply load the framebuffer attachment (the RGB texture) into a shader program, and render it onto a full-screen quad polygon. I can walk you through it.
- Via glBlitFramebuffer, but that's only available if you replace
- Option B, don't use double buffering at all. You can force single buffering by adding
EGL_RENDER_BUFFER, EGL_SINGLE_BUFFER,
to the configAttribs on line 142 in triangle_rpi4.c and not usinggbmSwapBuffers
at all. But I can not guarantee it will work. I was only able to get this (single buffer mode) working on Raspberry Pi 3.
I recommend the framebuffer option.
edit: Should have been: "replace EGL_OPENGL_ES2_BIT
with EGL_OPENGL_ES3_BIT
", not the other way around.
from rpi-opengl-without-x.
Thanks, I'll give it a try.
from rpi-opengl-without-x.
Related Issues (12)
- * failed to add service - already in use? HOT 3
- RPI4: failed to add service - already in use? HOT 4
- Running triangle_rpi4.c does not require HDMI connection HOT 1
- Compiling Error on RPI 3 HOT 2
- "Unable to get connector" when using a Pi Compute Module 4 HOT 2
- Problem with Raspberry PI 2 and Raspbian 11 (bullseye) HOT 2
- raspbian eGL issue HOT 4
- PI4 support? HOT 20
- DRM failed to get resources HOT 5
- PI4 dual display with common context HOT 9
- Pi4 with LCD output has no vsync HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpi-opengl-without-x.