{"id":15724480,"url":"https://github.com/jshrake/glow","last_synced_at":"2025-03-31T01:14:43.558Z","repository":{"id":150740874,"uuid":"47233259","full_name":"jshrake/glow","owner":"jshrake","description":"Generate a single C/C++ file for loading OpenGL functions using the official spec","archived":false,"fork":false,"pushed_at":"2016-06-29T23:47:24.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T06:26:22.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/jshrake/glow","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/jshrake.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":"2015-12-02T02:59:15.000Z","updated_at":"2016-02-15T16:27:14.000Z","dependencies_parsed_at":"2023-04-12T06:45:46.619Z","dependency_job_id":null,"html_url":"https://github.com/jshrake/glow","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fglow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fglow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fglow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshrake%2Fglow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshrake","download_url":"https://codeload.github.com/jshrake/glow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246399798,"owners_count":20770908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-03T22:16:48.271Z","updated_at":"2025-03-31T01:14:43.541Z","avatar_url":"https://github.com/jshrake.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glow\n`glow` generates a single C/C++ file for loading OpenGL functions using the official OpenGL specification. The output consists of only the enumerations and functions specified by the  api `(gl | gles1 | gles2)`, spec `(1.0 | ... | 4.5)`, and profile `(core | compatibility)`. \n\n# output\n[glow-headers](https://github.com/jshrake/glow-headers) contains files produced by enumerating all valid combinations of `api`, `spec`, and `profile` with no extensions.\n\n# usage\nRequires [go](https://golang.org/).\n``` bash\ngit clone https://github.com/jshrake/glow\ncd glow\ngo get\ngo build\nmake download # Downloads (curl) the latest khrplatform.h and gl.xml spec\ncat gl.xml | ./glow --api=gl --spec=4.1 --profile=core --debug=true \u003e gl_core_4_1.h\n```\n\nSee the `gen` target in the [Makefile](Makefile). This target is used to produce the files found in [glow-headers](https://github.com/jshrake/glow-headers).\n\n# examples\nBuild with `make examples`\n\n## SDL2\n```C\n/*\n * Minimal ANSI C example using glow with SDL2\n * gcc -o sdl2_example  -Wall -Werror -Weverything -pedantic -ansi -lSDL2 sdl2_example.c\n */\n\n#include \u003cSDL2/SDL.h\u003e\n#include \u003cstdio.h\u003e\n#define GLOW_IMPLEMENTATION\n#define GLOW_DEBUG\n#include \"gl_core_4_1.h\"\n\nstatic void pre_cb(char const *name, void *funcptr, ...) {\n  (void)funcptr;\n  printf(\"Pre callback: %s\\n\", name);\n}\n\nstatic void post_cb(char const *name, void *funcptr, ...) {\n  (void)funcptr;\n  printf(\"Post callback: %s\\n\", name);\n}\n\nint main(int argc, char *argv[]) {\n  SDL_Window *window;\n  bool quit;\n  (void)argc;\n  (void)argv;\n  SDL_Init(SDL_INIT_VIDEO);\n  SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);\n  SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);\n  SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);\n  window =\n      SDL_CreateWindow(\"${APPLICATION_NAME}\", SDL_WINDOWPOS_UNDEFINED,\n                       SDL_WINDOWPOS_UNDEFINED, 600, 800, SDL_WINDOW_OPENGL);\n  if (window == NULL) {\n    printf(\"Could not create window: %s\\n\", SDL_GetError());\n    return 1;\n  }\n  SDL_GL_CreateContext(window);\n  /*\n   * Uncomment the below code to eagerly load the OpenGL functions with\n   * the SDL function loader. Alternatively, just call glow_init()\n   */\n  /*\n  {\n    int failures = glow_init_with(\u0026SDL_GL_GetProcAddress);\n    if (failures) {\n      printf(\"glow failed to load %d functions\\n\", failures);\n      return failures;\n    }\n  }\n  */\n  /*Callbacks only used when using #define GLOW_DEBUG*/\n  glow_set_pre_callback(\u0026pre_cb);\n  glow_set_post_callback(\u0026post_cb);\n\n  quit = false;\n  while (!quit) {\n    SDL_Event event;\n    while (SDL_PollEvent(\u0026event)) {\n      if (event.type == SDL_QUIT) {\n        quit = true;\n      }\n    }\n    glClear(GL_COLOR_BUFFER_BIT);\n    SDL_GL_SwapWindow(window);\n  }\n  return 0;\n}\n```\n\n# public domain\n`glow` and the resulting output are licensed under the public domain.\n[Why public domain](https://github.com/nothings/stb/blob/master/docs/why_public_domain.md)\n\n# inspiration\n`glow` is inspired by:\n- [glad](https://github.com/Dav1dde/glad)\n- [glLoadGen](https://bitbucket.org/alfonse/glloadgen/wiki/Home)\n- [gl3w](https://github.com/skaslev/gl3w)\n- [stb](https://github.com/nothings/stb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fglow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshrake%2Fglow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshrake%2Fglow/lists"}