graphics/tinygl: add TinyGL software OpenGL library - #3801
Merged
Merged
Conversation
acassis
force-pushed
the
tinygl_nuttx
branch
2 times, most recently
from
September 25, 2026 11:49
d989570 to
0ad9885
Compare
acassis
requested review from
JorgeGzm,
cederom,
jerpelea,
linguini1,
raiden00pl and
xiaoxiang781216
September 25, 2026 17:52
Add TinyGL (https://github.com/C-Chads/tinygl), a small software-only implementation of a subset of OpenGL 1.1 written in portable C99, by Fabrice Bellard, Gek and C-Chads, under a zlib-style license. Like graphics/lvgl, the sources are not kept in the repository: the build downloads a pinned git revision from GitHub (CONFIG_TINYGL_VERSION) and applies the NuttX patches that live next to the Makefile: 0001 zfeatures: allow overriding the feature switches at build time 0002 Fix -Wstrict-prototypes warnings 0003 zbuffer: do not over-read the source in ZB_copyFrameBuffer() 0004 zbuffer.h: make the default allocator wrappers static inline The TinyGL compile time features (pixel depth, GL_SELECT, GL_POLYGON, blending, texture size, ...) are exposed as CONFIG_TINYGL_* Kconfig options. They change public structures, so Make.defs / CMakeLists.txt export them to every application that includes <GL/gl.h> or <zbuffer.h>. Both the make and the CMake builds are supported. An unpack stamp file makes sure an object directory created inside the source tree is never mistaken for downloaded sources. Assisted-by: Claude Opus 5.5 (1M context) Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
Render Brian Paul's classic OpenGL "gears" demo with TinyGL on a NuttX framebuffer device. TinyGL draws each frame into its own ZBuffer, which is then copied to the mmap()ed framebuffer (plus FBIO_UPDATE when CONFIG_FB_UPDATE is enabled), so partially drawn frames are never shown. The frame rate is printed every five seconds. Usage: tinygl [frames] [fbdev] Tested on sim:tinygl (640x480, 32 bpp): about 1400 FPS with CONFIG_DEBUG_FULLOPT on an x86_64 host, with both make and CMake. Assisted-By: Claude Opus 5.5 (1M context) Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
acassis
force-pushed
the
tinygl_nuttx
branch
from
September 26, 2026 17:17
0ad9885 to
e8a619a
Compare
Contributor
Author
|
@xiaoxiang781216 PTAL Please ignore the CI Check typo "lightening" it is on original tinygl code, not someone from this PR |
xiaoxiang781216
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add TinyGL (https://github.com/C-Chads/tinygl), a small software-only implementation of a subset of OpenGL 1.1 written in portable C99, by Fabrice Bellard, Gek and C-Chads, under a zlib-style license.
Like graphics/lvgl, the sources are not kept in the repository: the build downloads a pinned git revision from GitHub
(CONFIG_TINYGL_VERSION) and applies the NuttX patches that live next to the Makefile:
0001 zfeatures: allow overriding the feature switches at build time
0002 Fix -Wstrict-prototypes warnings
0003 zbuffer: do not over-read the source in ZB_copyFrameBuffer()
0004 zbuffer.h: make the default allocator wrappers static inline
The TinyGL compile time features (pixel depth, GL_SELECT, GL_POLYGON, blending, texture size, ...) are exposed as CONFIG_TINYGL_* Kconfig options. They change public structures, so Make.defs / CMakeLists.txt export them to every application that includes <GL/gl.h> or <zbuffer.h>.
Both the make and the CMake builds are supported. An unpack stamp file makes sure an object directory created inside the source tree is never mistaken for downloaded sources.
Impact
Users will be able to use OpenGL on NuttX
Testing
TinyGL Gears