GeeXLab 0.33.0 released for Windows, Linux and Raspberry Pi

GeeXLab: 3D programming and prototyping for Windows and Linux



1 – Release Notes

GeeXLab 0.33.0 is available for Windows 64-bit, Linux 64-bit and Raspberry Pi (the Raspberry Pi version has been compiled on a fresh version of RaspiOS May 2020). This new version of GeeXLab brings shared memory support and updates some functions and libraries.


1.1 – Shared Memory

Shared memory is a feature I currently need in a new graphics benchmark I’m working on. Shared memory is a memory buffer that can be shared between different processes or applications running in the same system. It’s included in the IPC (Inter Process Communication) mechanisms. Shared memory is available on Windows and Linux and can be programmed using new functions of the gh_utils lib:
– shmem_create()
– shmem_kill()
– shmem_is_available()
– shmem_map()
– shmem_unmap()

Here is a code snippet from the code sample pack that creates a shared memory and writes some bytes into:

shmem_name = "8744534687"
shmem_size = 128
shmem_signature = "123456789"
shmem_ptr = 0
shmem_ok = gh_utils.shmem_create(shmem_name, shmem_size)
if (shmem_ok) then
  shmem_ptr = gh_utils.shmem_map(shmem_name, shmem_size)
  local offset = 0
  local x = 0
  gh_utils.buffer_write_byte(shmem_ptr, offset, x)
  offset = 1
  local num_bytes_written = gh_utils.buffer_write_string(shmem_ptr, offset, shmem_signature, -1)
  print("num_bytes_written: " .. num_bytes_written)

As long as the demo is running, the shared memory can be read/written by another application (another GeeXLab or any application that knows the shared memory name and structure).

A demo is available in the OpenGL 2.1 demopack in the d54-shared-memory/ folder.


1.2 – RGB LED Matrix: Raspberry Pi 4 Support Added

I updated the support of RGB Led Matrix panels with the latest version of the RGB LED Matrix library that allows a Raspberry Pi to drive a RGB LED matrix panel. The latest version of the RGB LED Matrix lib supports Raspberry Pi 4.

The RGB LED matrix library is accessible in a Lua or Python script via the following functions of the gh_rpi module:
– gh_rpi.rgbmatrix_init()
– gh_rpi.rgbmatrix_set_pixel_u8()
– …

Some demos on RGB LED matrix panels are available in {GeeXLab RPi folder}/demopack02/rpi_rgb_matrix/.
These demos require root rights. You can launch a demo in command line with:

sudo ./GeeXLab /demofile=\"./demopack02/rpi_rgb_matrix/demo02_rpi_gl21.xml\"

More information about programming RGB LED panels can be found here:


1.3 – Random Number Generator in Lua

To generate a random number in Lua, the function math.random() is perfect. But it’s based on the C rand() function that is not the same on Windows / VC libs and on Linux / GLIBC.

rand() generates and number in the range [0 ; MAX_RAND] where MAX_RAND is different on Windows Visual Studio and Linux/GLIBC:
– Windows: MAX_RAND = 0x7FFF or 32767
– Linux: MAX_RAND = 0x7FFFFFFF or 2147483647

The direct consequence is that rand() generates a better sequence of random numbers on Linux. I did some searches and tests and I found more or less how rand is implemented on both platforms. I added two new random generators in the gh_utils lib that generate random numbers like on Windows or like on Linux. So you will have the same behavior on both platforms:

  • gh_utils.random16(a, b) – random16() tries to mimic original C rand() function available on Windows / Visual Studio
  • gh_utils.random32(a, b) – random32() tries to mimic original C rand() function available in the GLIBC on Linux / gcc


2 – Changelog

This changelog is intended for all versions of GeeXLab.

Full changelog from beginning of time is available HERE.

Version 0.33.0 - 2020.06.11
+ (2020.06.11) [Raspberry Pi] updated the RGB LED Matrix lib with RPi4 support.
+ (2020.06.09) added srandom(), random16() and random32() to gh_utils lib.
+ (2020.05.29) added get_gpu_rt_tensor_cores() to gh_gml lib.
+ (2020.05.29) [Windows] updated FFmpeg plugin with latest FFmpeg SDK 4.2.3.
+ (2020.05.29) added win32_audio_volume_control() to gh_utils.
! (2020.02.26) updated built-in SQLite support with latest version SQLite 3.32.1.
+ (2020.05.22) added combo_box_draw_v2() to gh_imgui lib.
+ (2020.05.18) added functions to deal with shared memory (IPC: Inter Process Communication)
  shmem_create(), shmem_kill(), shmem_is_available(), shmem_map() and shmem_unmap() to gh_utils.

Leave a Comment

Your email address will not be published. Required fields are marked *