Coder Social home page Coder Social logo

pi-eglonx's Introduction

Raspberry Pi EGL on X

Demo of Raspbery Pi OpenGL ES rendering to X window posted to raspberrypi.org forums by @teh_orph at http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=6488

Converted to c from c++, added Makefile. Tested on Raspbian.

to run type

cd pi-eglonx
make
./eglonx

Post by @teh_orph

Hello guys,

Quick proof-of-concept: hardware accelerated 3D in an X window. You do not need any fancy X server to make this work. The code provided below only works in a 16-bit 5/6/5 screen though.

Brief summary:
- I took this code: http://wiki.maemo.org/SimpleGL_example
- replaced the eglCreateWindowSurface with eglCreatePixmapSurface
- replaced the swap buffers with a glReadPixels and an XPutImage

Since everything's done in X, all window hiding stuff works fine. You can run multiple EGL programs too. (In the video I run the same program twice - no sharing is being done between them if you're wondering!)

http://www.youtube.com/watch?v=l0i55EndDZQ

CAVEATS:
- eglCreatePixmapSurface seems to be ill-documented for the Broadcom 3D EGL API. Figuring out what to put as the pixmap argument appears to be guesswork!
- X is currently invisible in 24/32-bit mode, and I can't get the pixmap to run in 16-bit mode. So I *in software* glReadPixels the image in 32-bit mode, and then convert to 5/6/5 by hand...this is of course slow. Once it's figured out how to make either a 16-bit pixmap or get 32-bit X working, no conversion will be required.

NB: glReadPixels is powered by the hardware's DMA functionality once the GPU is flushed. The X server it is running on in the video has DMA-enabled blitting, so - assuming the 32->16 conversion is omitted - the whole process would be powered by DMA.

pi-eglonx's People

Contributors

shirro avatar

Stargazers

Xerxes Rånby avatar

Watchers

James Cloos avatar Xerxes Rånby avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.