Show COMPSIZE() hints in the documentation tooltips #15

Closed
thefiddler opened this Issue Dec 6, 2013 · 3 comments

Projects

None yet

2 participants

@thefiddler

OpenGL functions with array parameters, such as DrawRangeElements, are decorated with COMPSIZE() hints that describe how the array size is calculated. For instance:

        <command>
            <proto>void <name>glDrawRangeElements</name></proto>
            <param group="PrimitiveType"><ptype>GLenum</ptype> <name>mode</name></param>
            <param><ptype>GLuint</ptype> <name>start</name></param>
            <param><ptype>GLuint</ptype> <name>end</name></param>
            <param><ptype>GLsizei</ptype> <name>count</name></param>
            <param group="DrawElementsType"><ptype>GLenum</ptype> <name>type</name></param>
            <param len="COMPSIZE(count,type)">const void *<name>indices</name></param>
        </command>

The last parameter has len="COMPSIZE(count,type)", which means that its length is determined by the count and type parameters (and not from mode as one might expect.)

It would be nice to display these hints in our documentation tooltips.

This requires the following changes:

  • Generator.Convert.GLXmlParser: read len attributes from gl.xml and store them in our signatures.xml
  • Generator.Bind.Parameter: add ComputeSize property
  • Generator.Bind.XmlSpecReader: set ComputeSize properties for relevant parameters
  • Generator.Bind.CSharpSpecWriter: generate doc comments for ComputeSize properties

The last step is the most complicated one, because doc comments do not currently pass through the data model, but are generated directly from the xml manpages of OpenGL via xslt.

@thefiddler

This looks nice, PR please?

@thefiddler thefiddler added a commit that referenced this issue Mar 13, 2014
@thefiddler thefiddler [Graphics] Documented parameter length
Fixes issue #15
51c173e
@thefiddler thefiddler added this to the 1.1.1 milestone Mar 13, 2014
@thefiddler

Many thanks, merged!

@thefiddler thefiddler closed this Mar 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment