Code Monkey home page Code Monkey logo

docs.gl's Introduction

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.

Offline Viewing

First compile the files using the --local-assets flag, while in the root project directory run python start_offline_webserver.py which starts a local webserver on port 8000 which can be accessed in your browser by going to the url http://localhost:8000.

If you find that any functionality is missing, please open a pull request.

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.

docs.gl's People

Contributors

1ace avatar andystanton avatar baldurk avatar bsvino avatar cuppajoeman avatar elect86 avatar jacquesh avatar jdecombe avatar jumoel avatar keaukraine avatar leokolln avatar leumasme avatar lilianmallardeau avatar linkmauve avatar litasa avatar miroklarin avatar naavis avatar nicolayr avatar nmr8acme avatar pkonecki avatar pmatyja avatar racz16 avatar ratchetfreak avatar reima avatar robaire avatar sircasms avatar sohail05 avatar spacecat-chan avatar tavomaciel avatar tcoppex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs.gl's Issues

docs.vk for Vulkan?

I was wondering. As Vulkan specs are now released, is there any hope to have the same documentation layout used for docs.gl but for vulkan, like docs.vk?

docs.gl is my number one OpenGL reference for many reasons and I would love to have the same for Vulkan.

Keep the good work.

Minor typo in glFramebufferTexture

There's a small typo in the documentation for glFramebufferTexture in the paragraph that begins with

If texture is non-zero, the specified level of the texture object...

where it says "framebfufer" instead of "framebuffer".

command_categories not expanding on page load

Issue occurs for myself on the following browsers with Windows 10 x64;
Google Chrome 48.0.2564.97 m
Internet Explorer 11.63.10586.0

Steps to reproduce;
Navigate to any doc and the command_categories on the left-side will remain closed, although the expansion arrow will indicate that the category should be open.

Clicking the category title twice will reshow the contents - indicating that the state is correctly set as 'expanded' but the contents are displayed as 'hidden'.

Chrome;
chrome
Internet Explorer 11;
ie11

Firefox (Expected result);
firefox

Safari, Chrome and Firefox for OS X also get the expected result (Issue seems to occur only on Windows).

.html extension for HTML files

Currently I'm trying to create Qt help files for OpenGL using your documentation (and it's fantastic)! But qhelpgenerator, the tool that creates help archives for Qt Creator seems to omit HTML files without extension.
I use Python to convert all links to .html and rename all files appropriately but it does not seem like a good solution.
(for anyone interested it's there: https://github.com/pashazz/docsgl-qt)

provide intersections of apis

Not sure on feasibility, but I can ask for the moon right?

It would be nice in the toggle at the top to define intersections of apis like ES 2 and GL 4

smoothstep documentation error?

hello! the document at http://docs.gl/el3/smoothstep says Results are undefined if edge0 ≥ edge1. i have been working with shaders in max/msp/jitter in GLSL #version 330 and find that if `edge0 > edge1', the result is not undefined, rather the behavior is simply inverted. i am not sure whether this is an error in your documentation or just an eccentricity/enhancement of cycling 74's implementation, but i figured i would report in nonetheless!

Offline version cannot really be used offline

The offline version downloaded from About cannot be used normally without internet.

The Problem:

  • Without internet, the left sidebar links, search and MathJax rendering, etc are completely not functional.

Temporary Solutions:

  • I just batch replace all the external links to jquery.min.js, jquery-ui.min.js from every file to links to local disk versions of these files, and it seems works out fine. (MathJax is not working of course)
  • And batch replace the all the home logo links on top left to href="../index.html".

Maybe we can do these at the build process?

glTexImage allowed format arguments

Hey, seems like on the glTex[Sub]Image* pages, for the format parameter, it lists:

GL_RED, GL_RG, GL_RGB, GL_BGR, GL_RGBA, and GL_BGRA

but does not include the _INTEGER variants, which seem to be required for using integer internalFormats (such as GL_R16UI).

Maybe other pages are affected too, not sure. Those are just the ones I noticed (when trying to figure out why using GL_R16UI and GL_RED didn't work).

docs.gl documentation as extension for vscode?

hey, great initiative with docs.gl. I have downloaded bundle for offline use. It appears to be a set of files, one per each gl function. I see that it's in fact html code inside...

Is there's an easy way to include docs.gl into VSCode for verbose feedback of OpenGL functions?
I am looking for particular implementation: when working with WebGL canvas API context in js and ts files and I think it would be really helpful. I guess it would require some kind of lookup of the function name in the folder with docs and then outputting it in vscode intellisense/hint window. Has someone tried that? It would be great use case for docs.gl.

Auto focus search box

Would pretty useful if main search box was automatically focused on $(document).ready.

"Unexpected text node" on `glBufferData` page

Tested in Chrome 46.0.2486.0-dev (Mac OS X 10.10.5).

On the OpenGL ES2, OpenGL 2, and OpenGL 3 versions of the glBufferData docs page, the following snippet appears under the "notes" section:

"Unexpected text node: 'be a multiple of'"

(Some other text actually briefly appears on the page after refreshing. No errors appear in the Chrome inspector console log.)

Dark theme shows white background for an instant

When transitioning from one page to another I can see white background for an instant.
It's a bit hard on the eyes to see this abrupt white flash.
It looks like the flash is more apparent in Firefox. In Chrome is not noticeable most of the times but happens as well sometimes.
I'm not sure if this is an easy thing to fix or it's a browser issue.

Use relative font sizes

My browser's font size is configured to be slightly larger than usual. docs.gl does not respect that setting because it uses absolute px values for font sizing. Consider changing font-size values to rem so that it more closely aligns with the reader's desires.

textureGather's description is wrong

The website says this:

vec4(Sample_i0_j1(P, base).comp,
     Sample_i1_j1(P, base).comp,
     Sample_i1_j0(P, base).comp,
     Sample_i0_j1(P, base).comp);

But the GLSL specification says this:

vec4(Sample_i0_j1(P, base).comp,
     Sample_i1_j1(P, base).comp,
     Sample_i1_j0(P, base).comp,
     Sample_i0_j0(P, base).comp);

Note the last one, with the 0,0 i,j value.

This mistake is also in the textureGatherOffset and textureGatherOffsets functions.

Domain name problem.

Hello,

the domain name docs.gl no longer seems to resolve DNS requests.

Exhibit A:

nitrix@s1:~$ dig docs.gl ANY

; <<>> DiG 9.11.3-1ubuntu1.14-Ubuntu <<>> docs.gl ANY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12024
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: d7d1cf3dda11220d75e3de2460510f90cc1472701131a13c (good)
;; QUESTION SECTION:
;docs.gl.                       IN      ANY

;; Query time: 424 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Tue Mar 16 20:05:36 UTC 2021
;; MSG SIZE  rcvd: 64

Exhibit B:

nitrix@s1:~$ dig @1.1.1.1 docs.gl ANY

; <<>> DiG 9.11.3-1ubuntu1.14-Ubuntu <<>> @1.1.1.1 docs.gl ANY
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOTIMP, id: 32031
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;docs.gl.                       IN      ANY

;; Query time: 13 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Tue Mar 16 20:10:52 UTC 2021
;; MSG SIZE  rcvd: 36

Exhibit C:
https://docs.gl/

YiydzCa

List enum values

I work with C# and P/Invoke directly into OpenGL (i.e. not using something like OpenTK). I regularly have to look up the values of enums such as GL_MAX_VERTEX_ATTRIBS. It would be quite helpful if there was a page where the values of the enums were listed.

Thank you very much for your work.

Search input field doesn't autofocus

This happens for me using Google Chrome 44 (full version name 44.0.2403.125 m) on Windows 8.1. As far as I know the "autofocus" attribute, which exists on the search field tag, should work on this version of Chrome.

Improve handling of aliased functions

From discussion on #13 -

For aliased functions (like glUniform3f -> glUniform or glEnablei -> glEnable) it would be useful to have search results match when they are entered, and return the target of the alias function in the search results instead of nothing.

On top of that, if there is a 404 page for when an invalid page is specified (e.g. http://docs.gl/gl4/glNotFound) this page should check to see if the page is an alias source, and if so redirect to the alias target.

Error in vertex array example?

Noticed on es3/glDrawArrays, The vertex array example, https://github.com/BSVino/docs.gl/blob/master/html/examples/vertexarray_draw.htm#L11
calls:

glDrawArrays(GL_TRIANGLES, 0, vertex_data);

but also states that // vertex_data is a float*, 3 per vertex, where as far as I can tell this function always takes a GLint - so it should probably be a count of the vertex data instead. (I do not know the context of the examples, so cannot give a precise suggestion, assuming that this is a real error).

Provide option to peek a short definition of the function from the Search menu.

Hi Rodriguez or whoever is maintaining this...

I thought it would be useful if one could hover over the search results and with a small delay, show a mini view of the docs of the function in a popover. For example, if I quickly wanted to lookup clamp and I searched for it and hovered over the glsl4 link, I would be able to see something like what the quick documentation of intelliJ shows. I've attached a picture to give a quick and dirty idea of what I mean.

Let me know if you think it's a good idea.

Wireframe

Giving WebGL a tab (or tag)

i realize WebGL is 'based on' OpenGL ES 2.0, and is maybe more of an API than a language specification, but i think some mention should be made. Ideally it would have it's tab, but with browser and device support as tags. thank you!

Does PD cover Javascript too?

Hi there,
We're interested in using docs.gl as a basis for the documentation site for our project. Just wanted to give you a heads up, and to double check that so long as all the GL documentation is purged, that should be okay, with the Javascript and HTML, etc.

Sorry for clogging up your issues, seemed like the easiest way to ask.

Compressed formats for glTexStorage*

I know that the official refpages don't list the compressed formats for the glTexStorage* formats, but they're perfectly valid, so it might be a nice addition if they showed up in the docs.gl pages as well.

Although this might be pushing it, but it would be cool if (even though they're extensions) the S3TC formats showed up there as well, since they're so common and pretty much universally supported, as per this page.

The sidebar opens and closes unnecessarily

This is an excellent OpenGL resource - however, on first load, the site seems to animate opening all the categories in the sidebar and then immediately closing them again. After they are closed, the currently selected category is opened. It makes it quite to annoying to browse around. Switching API version or pressing the 'Hide Unavailable' button also seems to open+close the menus.

"Edit this page" link on docs.gl link to the master branch

The "Edit this page" link at the very bottom of each docs.gl page links to the master branch, but the main an most up-to-date branch on the repo seems to be mainline. I don't know if it's intentional or just an oversight, but just opening an issue in case.

glDrawArrays missing an error

glDrawArrays can fail (GL_INVALID_OPERATION) if there is no Vertex Array Object bound (core profile only). This is not currently specified. (I believe that similar issues may be present for other glDraw* commands but I am not sure).

Add documentation for wgl?

Just a suggestion, I personally would find better wgl documentation quite useful, as the existing wgl documentation is quite poor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.