Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 90
» Latest member: junglie85
» Forum threads: 230
» Forum posts: 970

Full Statistics

Online Users
There are currently 4 online users.
» 0 Member(s) | 4 Guest(s)

Latest Threads
Building with a toolchain
Forum: General Chat
Last Post: junglie85
09-11-2022, 07:45 AM
» Replies: 3
» Views: 4,365
Window doesn't open on Pi
Forum: Help my code won't work??
Last Post: junglie85
09-05-2022, 01:28 PM
» Replies: 5
» Views: 412
Im working on a Game..
Forum: Scratchpad Games
Last Post: Brian Beuken
09-04-2022, 09:12 PM
» Replies: 7
» Views: 5,412
Getting started on Raspbe...
Forum: Help my code won't work??
Last Post: junglie85
09-04-2022, 06:38 AM
» Replies: 8
» Views: 567
Bullseye on Rpi2/3
Forum: Help my code won't work??
Last Post: Brian Beuken
04-25-2022, 03:24 PM
» Replies: 8
» Views: 2,492
Disable OpenGL, for faile...
Forum: Help my code won't work??
Last Post: Brian Beuken
11-10-2021, 06:43 PM
» Replies: 7
» Views: 10,621
OpenGLES3.x extensions
Forum: OpenGLES3.1 Shaders
Last Post: Brian Beuken
11-10-2021, 08:34 AM
» Replies: 0
» Views: 1,045
Rock Pi 4
Forum: Other SBC's
Last Post: Brian Beuken
05-23-2021, 11:48 AM
» Replies: 8
» Views: 16,093
New tinkerboard on the wa...
Forum: Other SBC's
Last Post: Brian Beuken
05-12-2021, 03:09 PM
» Replies: 10
» Views: 8,971
Forum: Other SBC's
Last Post: Brian Beuken
03-04-2021, 12:51 PM
» Replies: 12
» Views: 11,527

  Window doesn't open on Pi
Posted by: junglie85 - 09-04-2022, 06:50 AM - Forum: Help my code won't work?? - Replies (5)

It's not so much that my code won't work as it is that it doen't work how I think i should.

Having built and run the first triangle example, VisualGDB asked me to install XMing so that it could display the X11 session on my Windows box. I'm building on the Pi currently, not cross-compiling.

I was expecting the graphics to show up on the actual Pi's X11 session; that's what it looks like happens from the screenshot in the book.

VisualGDB only has a "Local Windows Debugger" option available in the dropdown (VS2022, Win11). However, I've only recently moved back to Windows from macOS and I usually use VSCode and/or the Jetbrains IDE's, so it's possibly just not knowinbg where to click!

How do I launch the program (in debug mode and normal running mode) on the Pi from my development host?

Print this item

  Getting started on Raspberry Pi 4 with Debian Bullseye
Posted by: junglie85 - 09-02-2022, 04:29 PM - Forum: Help my code won't work?? - Replies (8)

I've recently purchased the book and am trying to get the initial triangle code running. I've some experience with normal OpenGL but I'm by no means a graphics programmer. I have no experience with SBC and thought this would be really fun. But I'm struggling to figure out what needs to change to work on the current hardware, despite the helpful posts dotted around the forum.

Specifically, I currently get squiggly red errors that EGL and GLES cannot be found when included. Here's my list of libraries and includes from VisualGDB:

Include directories:

  • /usr/include
  • /usr/include/interface/vcos/pthreads
  • /usr/include/interface
  • /usr/include/interface/vmcs_host/linux

Library directories:
  • /usr/lib

Library names:
  • GLESv2
  • EGL
  • X11
  • bcm_host (although I don't think I need this)
  • pthread

I've installed the following packages:
  • libgles2-mesa-dev
  • libxrandr-dev
  • mesa-utils

I've got a Raspberry Pi 4 on Debian 11 / Bullseye (latest Raspberry OS).

Here's some helpful glxinfo output:

glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL version string: 2.1 Mesa 20.3.5
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.3.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
    GL_EXT_separate_shader_objects, GL_EXT_shader_implicit_conversions,

I saw the comment about disabling OpenGL in raspi-config but there is no option to do so under advance or, as far as I could see, any other menu.

I don't know where to go from here to get things working. If anyone can let me know what packages need to be installed, what libraries and includes, etc, I can figure the rest. I'm probably even happy to try GLES3 if need be.


If I change the libraries to:
  • GLESv2_static
  • EGL_static
  • vchiq_arm
  • vcos khrn_static
  • bcm_host
  • pthread
I get the following error:

Run "gcc -Wl,--start-group "/tmp/VisualGDB_ToolchainTestProgram.o" -o "/tmp/VisualGDB_ToolchainTestProgram" -Wl,-gc-sections -L/usr/lib -lGLESv2_static -lEGL_static -lvchiq_arm -lvcos -lkhrn_static -lbcm_host -lpthread -Wl,--end-group " in directory "/tmp/VisualGDB/d/SBC_Game_Dev/PiGame1/PiGame1/PiGame1" on local computer
/usr/bin/ld: cannot find -lGLESv2_static
/usr/bin/ld: cannot find -lEGL_static
/usr/bin/ld: cannot find -lkhrn_static
collect2: error: ld returned 1 exit status
Command exited with code 1

Print this item

  Bullseye on Rpi2/3
Posted by: Brian Beuken - 04-09-2022, 08:11 PM - Forum: Help my code won't work?? - Replies (8)

Hi all
Well we've reached a point sadly where the rpi3 code is not going to work any more using Bullseye. all the old Broadcom vc4 drivers have been depricated and are no longer part of the bullseye install, so the code will no longer build or run as it stands.

Generally this isn't a massive issue, as once we have the graphic systems set up we can ignore the OS, but in the case of the Rp1-3 the broadcom DispmanX system was used to make the graphics framebuffers. Without them the code isn't going work

But in theory installing the mesa libs which now have VC4 support you can get things up and running, the set up is similar to how we do the Pi4 code, and we now use X11 to send our graphics to the screen.

But there's a small problem at the moment with the EGL drivers not initialising, I am looking into it, when I work it out, I'll post a new hello triangle project set up for you here to allow you to progress if you are using a Pi1-3

Im working on the issue and will try to get the fix to you soon, I've also asked the Pi forums if theres a way to install the depricated system.. I suspect not but who knows.

Print this item

  OpenGLES3.x extensions
Posted by: Brian Beuken - 11-10-2021, 08:34 AM - Forum: OpenGLES3.1 Shaders - No Replies

Something I was not aware of, but am passing on here relating to extensions in OpenGLES3.x

Though it seems odd, the gl3ext.h file is redundant, it has no content, in fact all extensions for OpenGLES3.x are actually listed in gl2ext.h

I know right? This was news to me, but happy to have been informed about it.

Anyway, I post this because I was just trying out the new Geometry Shader extensions on the latest mesa drivers for Raspberry (Bullseye OS, mesa 20.3.5) and was having some issues getting it to recognise GL_GEOMETRY_SHADER  as a valid shader type to compile and link. 

Geometry Shaders are a 3.2 feature of course, so I included the gl32.h header and it worked fine and is an exciting addition, expecially to make particles more interesting and for a quick normal display debug option. But it niggled me that was probably going to cause an issue using that header, and posted a question on the Raspberry forums which I'm happy to say was responded to promptly.

Use the gl2ext.h header and for the type of shader use, GL_GEOMETRY_SHADER_OES and now we're in business. The only other thing to do is make sure in the gshader itself you inform the shader to use a couple of important extension values to allow it to compile, it needs to be version 310 es and you have to inform it about 2 extensions that are required to make it work

#version 310 es
#extension GL_EXT_geometry_shader : require
#extension GL_EXT_shader_io_blocks : require

thats it.. when you make a PO, just add the geometry shader you compile to the vertex and fragment shader before you link. It will sit in the middle of them, they seem to work very well, though I've not pushed them to any extreme, I can indeed generate new vertex outputs. I will tinker with them a little more and report any problems.

There's a great tutorial on geometry shaders here

Print this item

  Im working on a Game..
Posted by: Brian Beuken - 01-07-2021, 09:11 AM - Forum: Scratchpad Games - Replies (7)

As I've been doing a lot of research to create new OpenGLES3.x systems and at the same time prepping my students to do a Pi4 project this year, I have decided to roll the research and student project into making a full scale freeware game..

I'd like to update my webpage to show this but as I've just completed a transition to a new PC i dont' currently have the tools in place to do that, but will sort it soon..

Details of the project are on my Patreon page at www.patreon.com/BrianBeuken 

If you would like to support this, please sign up, even a few dollars can make a difference.

I won't post too much on here until its done but when it is complete I'll use make the key componants available and useable for readers to build their own content.

Print this item

  Nice graphics for demos
Posted by: Brian Beuken - 12-12-2020, 07:18 PM - Forum: General Chat - Replies (11)

[Image: 2020-12-12-190558_1920x1080_scrot.png]
[Image: 2020-12-12-192739_1920x1080_scrot.png]
I've been looking for some nice models on line to do a tutorial on model rendering and shading, and found these lovely things Big Grin
This is just diffuse and ambient, going to add normal mapping, emissions and specularity. Might even tinker with a bit of PBR since I got the contet
I had to buy these, I don't normalluy but my own attemps are not great.

I also got some smashing lower res models also with mapping textures that will look very good when I take the demo a bit further.

[Image: 2020-12-12-200020_1920x1080_scrot.png]

[Image: 2020-12-12-185232_1920x1080_scrot.png]
[Image: 2020-12-12-174058_1920x1080_scrot.png]

Print this item

  bad habits come back to bite you
Posted by: Brian Beuken - 12-06-2020, 02:52 PM - Forum: Help my code won't work?? - Replies (2)

I have a very bad habit... when defining classes in C++ I often just put the label and type... This is usually ok, since I seldom write release builds.

The reason there's a difference is that in debug builds the compiler usually nulls all variables and clears memory to 0..release builds don't, memory is as it is when it fires up.


I discovered the compiler on the Arm64 Jetson doesn't.......

And it took me 6 hours to work out why, in a demo I was workig on that worked perfectly on 8 other machines, only the Jetson redused to display the 1st of 4 test models........

I had not 0'd a rotation Vec3, and in the update of the model I was rotating assuming 0.....

Bad habits only get broken when you make bad mistakes.... 6 hours though...ooooff.. I should know better.

I have now put default values in all class varibles in the class define.

Print this item

Posted by: Brian Beuken - 12-02-2020, 12:43 PM - Forum: Other SBC's - Replies (12)

bugger... oh well I got it from a proper supplier, so sending a return request.

[Image: image.png]

Print this item

  INSERT COIN Pleasure Dome Watch Party 11/29
Posted by: jomoengineer - 11-29-2020, 11:13 PM - Forum: General Chat - No Replies

I realize this is a bit last minute, but there will be an INSERT COIN Pleasure Dome Watch Party via the Alamo Drafthouse On-Demand Virtual Theater experience. INSERT  COIN Pleasure Dome Watch Part

INSERT COIN is a documentary about the Chicago's Midway Games from the Arcade days where games such as Robotron,2084, Mortal Kombat, and NBA Jam.  The doc was create by filmmaker Joshua Tsui and the Watch party is hosted by Polyon.

More Info:

Print this item

Posted by: Brian Beuken - 11-27-2020, 11:35 PM - Forum: Assets, Tools, Libraries and other useful things - No Replies

I still like to use free and functional libs even if a little old so long as they still serve their funtion I'm happy. So while looking into doing a network project, I reviewed what some of my students did a while back producing Battlehips. Its a great game and cross platform. One of the most complete examples of cross platform work I've ever had from 1st years.

And they used RakNet for networking. A nice lib I have used many times in the past, which was originally free or low cost for indie developers when I was coding in anger. Its since been bought out by Oculus as they wanted to develop networking libs, which in turn meant it was bought out by Facebook.

And Facebook did something nice, they made it freely available to all via a git hub so we can all use it.

As its not been touched for a long time there are a couple of quite minor issues with it, mainly because modern compilers don't like a particular line in ReplayManager3.cpp which needs to be edited so that line 141 where it says  == false is changed to == nullptr

There's a few steps to this, in a console on your SBC enter

sudo apt-get install cmake -y
git clone https://github.com/facebookarchive/RakNet.git /home/pi/RakNet
cmake .

now open up a text editor on your system and do theedit to ReplayManager3,  oh and this is important, if you are using a 64bit OS you do also need to comment out line 24 of FileList.cpp, or it won't build on Arch64

once you've made and saved the edits go back to your console and do this
make install

And its built, you'll get a few warnings but it wil be ok, if your system throws out an error though, we might be stuck, let me know. Next move the lib into a more useful space on your system using these console commands

sudo mv Lib/LibStatic/libRakNetLibStatic.a /usr/local/lib
sudo mv include/raknet /usr/local/include/

Done.. you can keep the source and build files if you want but they don't get used, you've sent the important files to your system, and can be incorporated into your project

You can remove with this command.

rm -rf /home/pi/RakNet

Print this item