{"id":25504572,"url":"https://github.com/nilostolte/opengl-glsl","last_synced_at":"2026-02-24T02:08:49.481Z","repository":{"id":198266375,"uuid":"619303676","full_name":"nilostolte/OpenGL-GLSL","owner":"nilostolte","description":" Examples (OpenGL and GLSL shaders) and complete OpenGL installation with w64devkit development kit, glad and glfw3 binaries and Ninja building tool for Windows 64 C/C++","archived":false,"fork":false,"pushed_at":"2025-01-27T18:58:13.000Z","size":14073,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T10:47:03.092Z","etag":null,"topics":["c","cpp","glfw","glfw3","glsl","glsl-shaders","graphics","ninja-build","opengl","shadertoy","shadertoy-compatibility","w64devkit","win64","windows","windows-10"],"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/nilostolte.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-26T20:57:04.000Z","updated_at":"2025-01-27T18:58:17.000Z","dependencies_parsed_at":"2024-08-09T18:48:38.727Z","dependency_job_id":"21430602-b9bd-4812-b85b-0665e89eb00d","html_url":"https://github.com/nilostolte/OpenGL-GLSL","commit_stats":null,"previous_names":["nilostolte/opengl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nilostolte/OpenGL-GLSL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilostolte%2FOpenGL-GLSL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilostolte%2FOpenGL-GLSL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilostolte%2FOpenGL-GLSL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilostolte%2FOpenGL-GLSL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilostolte","download_url":"https://codeload.github.com/nilostolte/OpenGL-GLSL/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilostolte%2FOpenGL-GLSL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29768817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T01:40:24.820Z","status":"online","status_checked_at":"2026-02-24T02:00:07.497Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c","cpp","glfw","glfw3","glsl","glsl-shaders","graphics","ninja-build","opengl","shadertoy","shadertoy-compatibility","w64devkit","win64","windows","windows-10"],"created_at":"2025-02-19T05:41:13.796Z","updated_at":"2026-02-24T02:08:49.468Z","avatar_url":"https://github.com/nilostolte.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenGL and GLSL shaders\n\nExamples (OpenGL and GLSL shaders) and  complete OpenGL installation with w64devkit development kit, glad, glfw3 binaries, and Ninja building tool.\n\nThe objective of this repository is to simplify the development of OpenGL applications in C and C++. The advantage\nof using w64devkit is that it's a development kit that is portable, that is, that can be used just copying\nthe files to any device in a Windows PC (an SD card, for example - not advisable). It does not require installation and bypasses\nthe registry.\n\nThe development kit is used in normal command windows. To avoid typing and to simplify the overall development\nprocess the programs are built using [Ninja](https://ninja-build.org/) building tool. Ninja is a very simple\nbuiding tool that substitutes makefiles with several advantages, particularly of being very efficient and portable (open source - can be compiled to any platform).\n\nIn this implementation GLFW and Glad are used, and all [exemples](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/examples) are to be built with C compiler using this configuration. The examples are located inside [glfw-3.3.8](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8) directory, because they use GLFW library. The first two examples were downloaded from the web and modified for the installed configuration. The third example is a C++ example rewritten in C, with objective to simplify GLSL shader programming. For that a vertex shader with two triangles forming a rectangle (quad) is implemented to be used to display fragment shaders inside. \n\nIn [shaders](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/examples/shaders) directory, the examples use a modified version of the third example. For example, the rectangle (quad) is expanded to the size of the viewport in order to show the fragment shaders in full window. The objective here is to implement in C, fragment shaders previously developed using web shader editors.\n\nThe fragment shaders developed on [Shadertoy](https://www.shadertoy.com/) online shader editor can be used here with only few modifications.\n\n## How to Start\n\nDownload this repository, for example, in the zip format and copy its content into an Explorer window located\nat the place chose to store the development kit as well as the other tools to be used. Keep this Explorer window\nopened for further use below. This repository contain some empty directories that are placeholders for the software \nto be dowloaded as follows.\n\nAlternatively, place the development kit somewhere else. For that, after copying this repository somewhere in the hard drive, just delete [w64devkit](https://github.com/nilostolte/OpenGL/tree/main/w64devkit) directory, and set the environment path to the complete path of \"w64devkit/bin.\" \n\n## Installing w64devkit\n\nThis is the development kit allowing to develop C/C++ projects in Windows 64, without needing to install any Windows\ntools. The advantage of this kit is its simplicity, allowing to perfectly understand the main dependencies involved\nwithout the need of setting paths to libraries or include files.\n\nOne can download it \n[here](https://github.com/skeeto/w64devkit/releases). Choose a release (here it's v1.18.0) and click on the link:\n\n```\n    w64devkit-1.18.0.zip\n```\nDelete the directory `w64devkit`, download the version desired and copy `w64devkit` directory at its previous positon,\n**or** in some other place of choice.\n\nFor the sake of simplification, one should set the path in order to allow the kit to be visible in a command shell\nand accessible via Ninja building tool.\n\nFor that, one needs to go to `Control Panel \u003e System \u003e About \u003e Advanced System Settings`, select `Environment Variables` \non `System Properties` window. In `User variables for Administrator` click on `Path` and `Edit...`. In the new window \n`Edit environment variable` click `New`. In the Explorer window where `w64devkit` was copied click twice on `w64devkit`, \nand click twice on `bin`. Now copy the path shown on the top of the Explorer window and paste it in the window \n`Edit environment variable`, by clicking on `New` again and pasting. Press `OK` in this window, in `Environment Variables` window, as well as in `System Properties`.\n\nThe development kit is now installed and accessible in command shell windows, such as in a Windows Powershell\n\n## Installing Ninja\n\nFind the latest release of Ninja [here](https://github.com/ninja-build/ninja/releases) and click on:\n\n```\n    ninja-win.zip\n```\n\nCopy `ninja.exe` from the zip file to the `tools` directory\n\nNow set a new path to the `tools` directory. \nGo to `Control Panel \u003e System \u003e About \u003e Advanced System Settings`, select `Environment Variables` \non `System Properties` window. In `User variables for Administrator` click on `Path` and `Edit...`. In the new window \n`Edit environment variable` click `New`. In the Explorer window where `ninja.exe` was copied copy the path shown on the \ntop of the Explorer window and paste it in the window `Edit environment variable`, by clicking on `New` again and pasting. \nPress `OK` in this window, in `Environment Variables` window, as well as in `System Properties`.\n\nNow Ninja is visible to any command shell window\n\n## Installing glfw-3.3.8\n\nThis library is already installed in this repository for convenience. The whole package can be downloaded\n[here](https://www.glfw.org/download.html) and clicking on `64-bit Windows binaries`. If a new version of\nglfw is required than the whole package should be reinstalled.\n\nFor simplicity, the installation of glfw-3.3.8 as provided in this repository is explained as follows.\n\n### Installing Glad\n\nGlad is an OpenGL library loader and it's used here as well as in other open source programs.\n\nGlad is already provided in this repository. All we need is to compile it. For that, go to `glad` subdirectory and\nin a command shell opened in this location, just type:\n\n```\n    ninja\n```\n\nThis will read the file `build.ninja` which gives the details on how to compile Glad. It will generate\nthe file `glad.o` that will be needed to be linked to any OpenGL program using the approach shown here.\n\n### Compiling the Examples\n\nReturning to the `glfw-3.3.8` directory, one should now be able to compile the examples. For that, open\na command shell in this location, and just type:\n\n```\n    ninja\n```\n\nExample 2 is a modified version of the source code shown [here](https://www.glfw.org/docs/latest/quick_guide.html). It\nuses the library `linmath.h`, which is all contained in that include file (functions are `#define` macros). This include \nfile is located [here](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/include).\n\nExample 3 is a C++ example rewritten in C, with objective to simplify GLSL shader programming. For that a vertex shader with two triangles forming a rectangle (quad) is implemented to be used to display fragment shaders inside.\n\nIn [shaders](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/examples/shaders) directory, the examples use a modified version of the third example. For example, the rectangle (quad) is expanded to the size of the viewport in order to show the fragment shaders in full window. The objective here is to implement in C, fragment shaders previously developed using web shader editors.\n\n#### TrueType Glyphs Display Examples\n\nTo compile these examples one uses a separate Ninja build called `ttf.ninja`. To build the examples one needs to type\n\n```\n    ninja -f ttf.ninja\n```\nNotice that all Ninja build files and executable that are generated with these builds will be located in `glfw-3.3.8` directory.\n\n### Executing the Examples\n\nOne can now execute the examples by calling in the command shell the correspondent executable (`.exe`) program name. For example, supposing the executable name `program.exe`, one should type:\n\n```\n    ./program\n```\nNo executable is called `program`. Just substitude `program` by the executable names in this directory as many as there are available. \n\nAnd this tests the installation.\n\nIn addition to these examples, Ninja will build additional examples found in [shaders](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/examples/shaders) directory. These examples have more specific names as can be seen from the executable filenames. These are called in a similar way as explained above.\n\nThese additional examples are for GLSL shader development, as a way to help implementing in C language, GLSL fragment shaders previously developed in online GLSL shader editors such as [Shadertoy](https://www.shadertoy.com/).\n\nTrueType Glyphs Display examples are more specific examples to diplay TrueType glyphs using shaders.\n\n## Changing the Installation or Installing a New Version of glfw\n\nAs explained above the whole glfw package can be downloaded [here](https://www.glfw.org/download.html) and clicking on \n`64-bit Windows binaries`. One can copy the new version in a new directory at the level of the directories `w64devkit`\nand `tools`. \n\nThe directory `glfw-3.3.8` should be conserved at least for conserving a clean copy until the new installation is\nworking fine. Once the new glfw directory is copied, one should then copy all necessary files from `glfw-3.3.8` to\nthis new directory. These are the example source files, `build.ninja` and the entire `glad` directory. For example2\none should also copy [linmath.h](https://github.com/nilostolte/OpenGL/tree/main/glfw-3.3.8/include).\n\nIn principle the `build.ninja` doen't need to be modified, since there are no instances of `glfw-3.3.8` in it.\n\nIf one needs to change the locations of the different parts of this installation, then the `build.ninja` and\nthe different paths might be required to be changed, accordingly.\n\nAs can be seen, `build.ninja` files are quite simple to understand and modified.\n\n## Changing Glad\n\nGlad will also be required to change in certain cases. This can be done by [generating the file](https://gen.glad.sh/)\nbased on the official specs. It's set to C/C++ language by default. The `gl` version used here was 4.2 and we should \nmake sure to also choose `core` compatibility. The Option `Generate a loader` also has to be checked. By clicking on \n`Generate` one is presented with a zip file containing the directoties to be copied to `glad` directory.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilostolte%2Fopengl-glsl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilostolte%2Fopengl-glsl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilostolte%2Fopengl-glsl/lists"}