mirror of https://github.com/tongzx/nt5src
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
217 lines
6.1 KiB
217 lines
6.1 KiB
Syntax Rules for OpenGL Extensions
|
|
----------------------------------
|
|
|
|
This is a preliminary document. No ARB vote has been taken!
|
|
|
|
Required abbreviations
|
|
----------------------
|
|
|
|
Accum Accumulation Buffer
|
|
Attrib Attribute
|
|
Aux Auxiliary
|
|
CCW Counter Clockwise
|
|
Clip Clipping
|
|
CMYK Cyan Magenta Yellow Black
|
|
Coeff Coefficient
|
|
Coord Coordinate
|
|
CW Clockwise
|
|
Decr Decrement
|
|
Dim Dimension
|
|
Dst Destination
|
|
Env Environment
|
|
Eval Evaluate
|
|
Exp Exponential
|
|
Func Function
|
|
Gequal Greater than or equal to
|
|
Gen Generate
|
|
Incr Increment
|
|
Index Color Index
|
|
Lequal Less than or equal to
|
|
Light Model Lighting Model
|
|
List Display List
|
|
LSB Least significant bit
|
|
Mag Magnify
|
|
Max Maximum
|
|
Min Minify
|
|
Mult Multiply
|
|
Op Operation
|
|
Ortho Orthographic
|
|
Pname ParameterName
|
|
Pos Position (function names only)
|
|
Quad Quadrilateral
|
|
Rect Rectangle
|
|
Ref Reference
|
|
RGB Red Green Blue
|
|
RGBA Red Green Blue Alpha
|
|
Shade Model Shading Model
|
|
Src Source
|
|
Tex Texture (function names only)
|
|
|
|
Abbreviations specifically not allowed
|
|
--------------------------------------
|
|
|
|
Bgn Begin
|
|
C Color
|
|
Pnt Point
|
|
Cpack Color Pack
|
|
N Normal
|
|
Poly Polygon Poly means multiple
|
|
T Texture Coordinate
|
|
Tri Triangle
|
|
V Vertex
|
|
|
|
Compound words
|
|
--------------
|
|
|
|
Antialias
|
|
Bitmap
|
|
Cutoff
|
|
Doublebuffer
|
|
Feedback
|
|
Framebuffer
|
|
Modelview
|
|
Noop
|
|
Notequal
|
|
Subpixel
|
|
Viewport
|
|
Writemask
|
|
|
|
Name rules (for all names)
|
|
--------------------------
|
|
|
|
Always use the specified abbreviations. Never abbreviate terms
|
|
that are already in the OpenGL API and are not abbreviated. If you
|
|
add terms to your extensions, abbreviate consistently, maintaining
|
|
a local versions of extensions to the list of abbreviations.
|
|
|
|
Use Depth, never Z.
|
|
|
|
Procedure name rules
|
|
--------------------
|
|
|
|
Limit procedure names to 2 words, 3 for procedures that return state.
|
|
(This is really a recommendation, not a rule.)
|
|
|
|
Never use set, as in SetFeedbackBuffer.
|
|
|
|
Begin each word with a capital letter, except the second word of
|
|
compound words.
|
|
|
|
Use Verb-noun (DeleteList) and adjective-noun (EdgeFlag) formats.
|
|
|
|
Append a corporate-specific suffix to all procedures. For example:
|
|
glNewCommandSGI. All upper case is preferred for this suffix, but
|
|
is not required. The suffix is always last, following OpenGL type
|
|
and count suffixes. (e.g. glNewVertex3iSGI, not glNewVertexSGI3i.)
|
|
|
|
Definition name rules
|
|
---------------------
|
|
|
|
Use all capital letters.
|
|
|
|
Separate words with underbars, except words within compound words.
|
|
|
|
Append simple numeric suffixes directly to the end of definition
|
|
tokens (LIGHT0). Begin these sequences with 0.
|
|
|
|
Use an underbar to separate complex suffixes from the token body
|
|
(MAP_3V).
|
|
|
|
Append a corporate-specific suffix to the token, after any other
|
|
suffixes. For example: GL_NEW_TOKEN0_SGI. All upper case is
|
|
required.
|
|
|
|
Parameter name rules
|
|
--------------------
|
|
|
|
<target> is reserved for the notion of "which is affected", and for
|
|
the corresponding "which is returned" get commands.
|
|
|
|
<params> is reserved for an array of parameters whose contents are
|
|
defined by a second enumerated argument, called <pname>.
|
|
|
|
Begin number sequences with 1, not 0. (e.g. u1,u2, not u0,u1)
|
|
|
|
Parameter order
|
|
---------------
|
|
|
|
<X> precedes <Y> precedes <Z> precedes <W>.
|
|
|
|
<R> precedes <G> precedes <B> precedes <A>.
|
|
|
|
The array being passed is always the last argument.
|
|
|
|
If a passed array has a type, the type specification argument immediately
|
|
precedes the array.
|
|
|
|
<pname> always precedes <params>.
|
|
|
|
<x> and <y> precede <width> and <height>
|
|
|
|
<format> precedes <type>
|
|
|
|
<target> is first
|
|
|
|
<face> is first
|
|
|
|
Parameter types
|
|
---------------
|
|
|
|
All integer quantity parameters (widths, heights, array lengths, etc.)
|
|
should be typed GLsizei, not GLint or GLuint. Note that GLsizei
|
|
generates an error only for negative values, so all integer quantity
|
|
parameters should accept the value zero.
|
|
|
|
Names (of display lists, textures, etc.) should be typed GLuint.
|
|
Generic masks that do not have explicitly defined bit values (e.g.
|
|
color index write masks and stencil write masks) should be typed
|
|
GLuint. GLuint is also used for unsigned integer components, such as
|
|
color components and depth components.
|
|
|
|
Masks that do have explicitly defined bit values (e.g. attribute mask,
|
|
clear mask) should be typed GLbitfield, not GLuint.
|
|
|
|
All floating point parameters that are clamped to the range [0,1] when
|
|
received should be typed GLclampf or GLclampd, not GLfloat or GLdouble.
|
|
|
|
Extension name rules
|
|
--------------------
|
|
|
|
An extension name is prefixed with the same string that suffixes its
|
|
procedures and definitions. The prefix and the individual words are
|
|
separated with underbars, the prefix is all upper case, and the other
|
|
text is all lower case. For example, extension SGI_cool_feature, which
|
|
specifies glCoolProcedureSGI() and defines GL_COOL_DEFINITION_SGI.
|
|
|
|
Suffix codes
|
|
------------
|
|
|
|
i signed 32-bit integer
|
|
ui unsigned 32-bit integer
|
|
s signed 16-bit integer
|
|
us unsigned 16-bit integer
|
|
b signed 8-bit integer
|
|
ub unsigned 8-bit integer
|
|
l signed 64-bit integer
|
|
ul unsigned 64-bit integer
|
|
f 32-bit float
|
|
d 64-bit float
|
|
v vector format
|
|
|
|
Shared extensions
|
|
-----------------
|
|
|
|
An OpenGL extension may be deemed a shared extension if either:
|
|
|
|
1. Two or more OpenGL licensees agree in good faith to implement
|
|
and ship the extension, or
|
|
|
|
2. The OpenGL ARB determines that it is in the best interest of
|
|
the licensees that the extension be shared.
|
|
|
|
The procedures and definitions that are defined by a shared extension
|
|
are suffixed with EXT, rather than by a company-specific suffix.
|
|
Likewise, the extension name is prefixed by EXT. To avoid name
|
|
conflicts Silicon Graphics will maintain a registry of EXT extensions,
|
|
including all their procedures and definitions, in a location that is
|
|
accessible to all licensees.
|