• Stars
    star
    581
  • Rank 76,901 (Top 2 %)
  • Language
    HTML
  • License
    Other
  • Created over 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

OpenGL Reference Documentation

docs.gl

docs.gl is a public domain web scaffolding for the OpenGL documentation. The actual documentation website provided by Khronos is in frames and poorly formatted, difficult to navigate and search. docs.gl aims to improve the form factor and quality of the OpenGL documentation.

Contributions Welcome

docs.gl should be thought of as a public wiki backed by GitHub. If you think you can improve the documentation, please consider submitting a pull request. I've uploaded all of the GL version specifications here for convenience.

How To Build It

docs.gl is a python script that reads each man page, processes it, and outputs static HTML. There is no database or server side scripting. All of the templating and processing is done at build time by the python script. It is executed like this:

python compile.py

If you're building for a final release, then you can use the --full parameter which does HTML minification and Unicode processing as well. It looks like this:

python compile.py --full

If you want to build a copy that can be used offline, then you can use the --local-assets parameter which downloads the fonts and Javascript libraries. It then builds the HTML and CSS using the local copies. It looks like this:

python compile.py --local-assets

If you are running Windows, there are a build.bat and a build_full.bat for convenience. When the script is done building, the completed site will be in a folder named htdocs.

File Structure

8 directories called el3 sl4 es1 es2 es3 gl2 gl3 and gl4 contain the manual pages for each OpenGL and GLSL command. They are only the inner HTML with header/footer elements such as head and html stripped out. These pages are read and processed by compile.py to produce the final site.

The html directory contains further resources for compiling the site. Files sitting directly in the html directory are template files which are used to further process the manual pages. Inside the template files are tokens that compile.py searches for and dynamically replaces during the compilation process. For example, the token {$current_api} will be replaced with 3.3 or 4.2 depending on the latest version that the command being compiled is available for. All content in the site that changes based on what manual page is being compiled is handled in this way.

Files in the copy folder are used without changes.

Files in the examples folder contain source code examples used in the manual pages. In these files a special token is used to provide a link to a command page. For example {%glBindTexture} will provide a link to https://docs.gl/gl4/glBindTexture if the example appears in a GL4 page. If the example appears in a gl3 page, the link will be updated accordingly.

In the main directory there are some additional helper python scripts. opengl.py and glsl.py contains helper tables, (eg which commands appear in which versions) tables specifying which examples should appear on which pages, and tables specifying the categories that appear in the table of contents of each page. insert_additional.py, make_copyright.py, and strip.py are special one-time-use programs that were used to process the manual pages after they were initially downloaded from Khronos. They could be reused for additional processing. read_spec.py reads the XML OpenGL spec file found in specs/gl.xml and outputs opengl_spec.py, which contains the raw data on which commands belong to which versions. opengl_spec.py should only have to be re-generated when Khronos updates the spec.

To Do

  • Extensions. Display a list of which versions an extension is available for. Display which extension introduces a command.
  • Display on each page "Core in version/core since version" like the OpenGL Wiki does
  • Integrate information from the common mistakes file into the page for each command they pertain to
  • Update each page with any information that may be in the spec but missing in the manual
  • Display on each page which commands are likely to cause a pipeline stall (eg glGet)
  • Display in the ToC on the left which GLSL commands can only be used in certain languages (eg VS, CS, FS, etc)
  • CamelCase Search - eg BFDLI finds glBindFragDataLocationIndexed
  • GLSL 1/3
  • WebGL
  • GLSL syntax cheat sheets. E.G. attribute/varying vs in/out

Thanks to the great people in Freenode ##opengl who provided me good feedback while I was writing this.

More Repositories

1

JaiPrimer

A description of Jonathan Blow's programming language, Jai
1,811
star
2

MathForGameDevelopers

Sample code for my YouTube series.
C++
646
star
3

DoubleAction

A first-person multiplayer action game
C++
166
star
4

Viewback

A tool for remotely monitoring video game playtests.
C
50
star
5

SMAK

The Super Model Army Knife - 3D art tool - http://getsmak.net/
C++
27
star
6

Blender

Blender is a free open source 3D content creation suite.
C
21
star
7

vtb

Vino's Tool Box
C++
16
star
8

Digitanks

Lunar Workshop
C++
12
star
9

ftgl-gl3

A port of FTGL to OpenGL 3.0
C++
10
star
10

BlueOcean

Underwater physics, fluid simulation and caustics demonstration
C
8
star
11

CodenameInfinite

C++
8
star
12

OpenGL-3-4-Samples

Sample code for the OpenGL 3.0+ core profiles.
C
7
star
13

GamblersDice

A dice roller that respects the Gambler's Fallacy.
JavaScript
5
star
14

stb_image-and-stb_image_write

stb_image and stb_image_write
C++
4
star
15

Strunkifier

A web utility for finding commonly misused words in the English language.
PHP
4
star
16

LunarWorkshop

Lunar Workshop
C++
4
star
17

Scalar

Interactive mathematics education website
JavaScript
3
star
18

ViewbackMonitor

The monitor for Viewback.
C++
3
star
19

V

Partially implemented compiler and VM for a toy language that nobody should use.
C++
3
star
20

sRGB-Int

sRGB <-> Linear for floating point and integer types
C++
2
star
21

DAWebsite

Double Action: Website
PHP
1
star
22

SMAK-Website

The website for SMAK
PHP
1
star
23

dominoes

Proof that dominoes is an entirely stochastic game and all of the strategies that my Cuban family members swear on are losing strategies.
Python
1
star
24

sudoku-generator

Sudoku puzzle generator
Python
1
star
25

blog

I have a blog.
Python
1
star
26

tspp

TS Plus Plus, a metamod plugin for TS
C++
1
star