{"id":28479780,"url":"https://github.com/dizcza/copengl","last_synced_at":"2026-03-01T12:02:47.185Z","repository":{"id":45470015,"uuid":"86742928","full_name":"dizcza/cOpenGL","owner":"dizcza","description":"C OpenGL port for STM32 Discovery board","archived":false,"fork":false,"pushed_at":"2022-10-30T20:51:54.000Z","size":1170,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-10T23:42:33.416Z","etag":null,"topics":["3d-graphics","c","opengl","stm32","stm32f4-discovery"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dizcza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-30T19:54:26.000Z","updated_at":"2025-07-27T22:34:37.000Z","dependencies_parsed_at":"2023-01-20T16:31:14.580Z","dependency_job_id":null,"html_url":"https://github.com/dizcza/cOpenGL","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dizcza/cOpenGL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2FcOpenGL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2FcOpenGL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2FcOpenGL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2FcOpenGL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dizcza","download_url":"https://codeload.github.com/dizcza/cOpenGL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizcza%2FcOpenGL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29969243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T11:43:06.159Z","status":"ssl_error","status_checked_at":"2026-03-01T11:43:03.887Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-graphics","c","opengl","stm32","stm32f4-discovery"],"created_at":"2025-06-07T18:10:20.824Z","updated_at":"2026-03-01T12:02:47.134Z","avatar_url":"https://github.com/dizcza.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cOpenGL\n\nC implementation of OpenGL basics for ARM CPU devices with an example for STM32F429 Discovery board.\n\nThe library relies on [linmath.h](https://github.com/dizcza/linmath.h) that provides a simple implementation of matrix manipulations in 3D graphics. In order to install linmath, run \n\n```\ngit clone https://github.com/dizcza/cOpenGL.git --recursive\n```\n\n## Binaries\n\nSee [Releases](https://github.com/dizcza/cOpenGL/releases).\n\nAlso uploaded on [Google Drive](https://drive.google.com/drive/folders/0B5LYlYDnS3oHMWpkVGVkTzVuZUU?resourcekey=0-wuHBtv6pyzeQvAtLxgnNeg\u0026usp=sharing).\n\n## Features\n\n### Implemented\n\n* The [depth buffer](https://en.wikipedia.org/wiki/Z-buffering) is used to solve the visibility problem (hidden 3D objects are not drawn).\n* Can draw _any_ object as long as its [polygon mesh](https://en.wikipedia.org/wiki/Polygon_mesh) is provided (vertices positions and colors are required).\n* Fast framebuffer clear (both color and depth) using DMA, which is called on each redraw of a 3D scene.\n* [Barycentric coordinates](https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-rendering-a-triangle/barycentric-coordinates) for smooth color interpolation between vertices.\n\n### Not implemented\n\n* Ray tracing.\n* Lighting and shadows.\n* Textures.\n* Antialiasing.\n\n\nThe basis function is\n\n```c\nvoid FrameBuffer_ProjectTrian4(FrameBuffer* frame, trian4 trian, vec3uint32 vcolors, mat4x4 mvp);\n```\n\nthat projects an arbitrary 3D triangle onto the screen.\n\n\n**Note**. This project is educational: the aim is to show how to implement OpenGL basics from scratch. Be aware of the performance issues (see benchamrk below) before using the library.\n\n\n## YouTube Demo\n\n[![Demo YouTube](screenshot.jpg)](https://youtu.be/djybFXNTcbc)\n\n\n## Benchmark\n\nBenhmark is measured by FPS (frames per second) on the scene with 3 cubes for different optimization flags with asserts turned off.\n\n| Checkpoint  | -O0   | -Os   | -O1  | -O2  | -O3  |\n|-------------|-------|-------|------|------|------|\n| Apr 18, 2017 | 1.25 | 5.38  | 6.10 | 7.81 | 8.48 |\n\n\n## Known hardware issues\n\n* Touchscreen is not working in interruption mode (`BSP_TS_IT*`).\n* Touchscreen refuses to initialize after a few hardware resets, if compiled with optimization flag `-On` for any `n\u003e0`. For some reason,  `stmpe811_ReadID()` returns `0` instead of `0x0811`.\n\n\n# Similar projects\n\n* [ST7735](https://github.com/cbm80amiga/ST7735_3d_filled_vector) is another port of OpenGL on STM32, using Q1.15 fixed precision float format.\n* [FGL](https://bitbucket.org/acassis/apps_fgl) port on STM32 Discovery board ([video](https://www.youtube.com/watch?v=XOdfvi7cgLc)).\n* [arduinogl](https://github.com/fabio914/arduinogl) OpenGL port on Arduino that neglects depth and can draw lines only.\n* Doom ports:\n  - [stm32doom](https://github.com/floppes/stm32doom): not OpenGL, and not even 3D (it's 2.5D), but highly optimized;\n  - [esp32-doom](https://github.com/app-z/esp32-doom) and [video](https://www.youtube.com/watch?v=TFE2ri2Zgu4) (don't know the details).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizcza%2Fcopengl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdizcza%2Fcopengl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizcza%2Fcopengl/lists"}