OpenGL without X on Raspberry Pi 4 (Part 1) - An external ...
文章推薦指數: 80 %
Introduction Many people wanting to use OpenGL on a Raspberry Pi will be happy to boot into the graphical desktop and use OpenGL inside an ...
Anexternalmemorydump
Whentheneuronsjustdon'tcutit
Menu
Skiptocontent
Home›Uncategorized›OpenGLwithoutXonRaspberryPi4(Part 1)
OpenGLwithoutXonRaspberryPi4(Part 1)
PostedonFebruary3,2020bydrgeoffathome
—
Leaveacomment
Introduction
ManypeoplewantingtouseOpenGLonaRaspberryPiwillbehappytobootintothegraphicaldesktopanduseOpenGLinsideanX11window.Ifyouarenewtographicsprogrammingthenthesearenottheblogsyouarelookingfor.
IfyouhavepreviouslyusedRPi0-3withoutX11thenyoumayhaveusedDispmanXtoobtainaNativeWindow.Usingavarietyofintertubesources,itnowseemsthatwiththeadventoftheRPi4,theuseoftheDispmanXlibraryhasmovedfromdiscouragedtothewrongway.Sowhatdoyouuse?Theanswerseemstobe,usetheLinuxDirectRenderingManager(DRM).
IshouldfessupandletyouknowthatIhaveneverusedlibDRMbeforesothisblogisanaccountofmystumblingsaroundinthedark.
KMSCube
ThecanonicalOpenGLwithoutXexamplecodeisgiveninaprogramcalledKMSCube.Sourcecodeisavailableathttps://github.com/robclark/kmscubebutyoucaninstallabinaryversionusing
sudoaptinstallkmscube
Yourfirstinstinctwillbetotrytorun
/usr/bin/kmscube
whichwillfailwith
drmModeGetResourcesfailed:Invalidargument
failedtoinitializelegacyDRM
Whatisgoingonhereisthatbydefaultkmscubetriestouse/dev/dri/card0asthedefault,whereasthehardwarewewanttouseiscard1.
Pi0-3youonlyhavethevc4driver,thereforerenderisvia/dev/dri/card0.Pi4hasbothvc4forrender,andv3dfor3D.Youcanprobethedevicesfortheircapabilities–onlyoneshouldacknowledgethatithasDRIVER_RENDERorDRIVER_MODESETcapabilities.https://www.raspberrypi.org/forums/viewtopic.php?t=247540#p1511538
Noworries,kmscubehasyourback,
/usr/bin/kmscube-D/dev/dri/card1
butboom!
延伸文章資訊
- 1Raspberry Pi OpenGL ES 2 without an X server (using EGL)
This example also uses OpenGL ES 2 to setup a very simple shader to render a triangle. ... For th...
- 2OpenGL without X on Raspberry Pi 4 (Part 1) - An external ...
Introduction Many people wanting to use OpenGL on a Raspberry Pi will be happy to boot into the g...
- 3Raspberry Pi 4 Model B Gains Official OpenGL ES 3.1 ...
The Khronos Group has officially certified the Raspberry Pi 4 Model B family of single-board comp...
- 4Running OpenGL Shaders on the Raspberry Pi - Antonin ...
So I've accepted the mission to run shaders from Shadertoy, on the Raspberry Pi! The Linux Graphi...
- 5OpenGL on Buster on both Pi 3 and Pi 4
My Raspberry Pi 4 just arrived and I got to try out the new ... I had to install libgles2-mesa-de...