Porting Opengles examples - no display?

4 posts
by benosteen » Mon Apr 23, 2012 8:03 pm

I"ve read through the hello_triangle source in the firmware repo and thought I would have a go at making the opengles book examples run using the same technique.

Currently, it builds and runs and the examples all merrily render and report back on frames per second and so on. However, I am struggling to get it to display to the screen. (True with stock debian and hardfp versions.)

Can anyone see what I"'ve missed?

https://github.com/benosteen/firmware/blob/master/hardfp/opt/vc/src/hello_pi/opengles-book-samples-read-only/Raspi/Common/esUtil.c <– WinCreate function carries most of the weight of initialising a display.

(All Raspberry Pi-specific alterations are wrapped in RPI_NO_X ifdefs)


The examples in the multitexturing (Chpt8) and Particle Systems (Chpt13) cause a strong strobing screen flicker (from console to black and back again) on the tty but seem to run fine as described above - no 3D output, but with console stdout.
Posts: 28
Joined: Mon Jan 02, 2012 6:10 am
by benosteen » Thu Apr 26, 2012 10:15 pm
After trying all sorts of things, I went back and did a clean image of the 13/04 deb image after chatting with friggle on IRC. He posted up his version of the ported code which worked for him, but not for me.

Resetting to a previous version seems to work, and the examples display in a reasonable manner. As it is writing over the framebuffer directly, you need to change the glClear params to have an alpha value of 1.0f to actually overwrite the existing console.

The port is here: https://github.com/benosteen/firmware/tree/master/hardfp/opt/vc/src/hello_pi/opengles-book-samples-read-only/Raspi should anyone want to use it. All the main magic is in Common/esUtil.c, wrapped in RPI_NO_X ifdefs.

Thanks again to friggle for showing me what I needed to aim for!
Posts: 28
Joined: Mon Jan 02, 2012 6:10 am
by asb » Fri Apr 27, 2012 8:00 am
Glad you got it working (I'm friggle on IRC).
Posts: 757
Joined: Fri Sep 16, 2011 7:16 pm
by benosteen » Fri Apr 27, 2012 5:17 pm
@asb Thanks again :)

Just to finish with, I've blogged about the changes here:

Posts: 28
Joined: Mon Jan 02, 2012 6:10 am