OpenGL functions (GL)

Source: Internet
Author: User

Currently, OpenGL functions are mainly included in three libraries.
1. GL function library
2. Glu function library
3. glut function library

 

1. GL library functions

 

Color editing
-------------------
Glshademodel
Select either flat or smooth.
Void glshademodel (glenum Mode)
Parameter: mode indicates the symbol value of the Light and Dark modes. The options are gl_flat and gl_smooth. The default value is gl_smooth.
Glcolor
Set current color
This is a collection of family functions without the glcolor () function. The functions are as follows:
Void glcolor3b (glbyte red, glbyte green, glbyte blue)
Void glcolor3d (gldouble red, gldouble green, gldouble blue)
Void glcolor3f (glfloat red, glfloat green, glfloat blue)
Void glcolor3i (glint red, glint green, glint blue)
Void glcolor3s (glshort red, glshort green, glshort blue)
Void glcolor3ub (glubyte red, glubyte green, glubyte blue)
Void glcolor3ui (gluint red, gluint green, gluint blue)
Void glcolor3us (glushort red, glushort green, glushort blue)
Void glcolor4b (glbyte red, glbyte green, glbyte blue, glbyte alpha)
Void glcolor4d (gldouble red, gldouble green, gldouble blue, gldouble alpha)
Void glcolor4f (glfloat red, glfloat green, glfloat blue, glfloat alpha)
Void glcolor4i (glint red, glint green, glint blue, glint alpha)
Void glcolor4s (glshort red, glshort green, glshort blue, glshort alpha)
Void glcolor4ub (glubyte red, glubyte green, glubyte blue, glubyte alpha)
Void glcolor4ui (gluint red, gluint green, gluint blue, gluint alpha)
Void glcolor4us (glushort red, glushort green, glushort blue, glbyte alpha)
Parameter: red, green, blue specifies the current red, green, and blue color values.
Alpha transparency, indicating the current new Alpha color value. This parameter is specified only when the glcolor4 function contains four variables.
It also includes:
Void glcolor3bv (const glbyte * V)
Void glcolor3dv (const gldoble * V)
Void glcolor3fv (const glfloat * V)
Void glcolor3iv (const glint * V)
Void glcolor3sv (const glshort * V)
Void glcolor3ubv (const glubyte * V)
Void glcolor3uiv (const gluint * V)
Void glcolor3usv (const glushort * V)
Void glcolor4bv (const glbyte * V)
Void glcolor4dv (const gldoble * V)
Void glcolor4fv (const glfloat * V)
Void glcolor4iv (const glint * V)
Void glcolor4sv (const glshort * V)
Void glcolor4ubv (const glubyte * V)
Void glcolor4uiv (const gluint * V)
Void glcolor4usv (const glushort * V)
Parameter: V specifies an array pointer whose values are red, green, blue, and Alpha.
Glcolorpointer
Define color array
Void glcolorpointer (glint size, glenum type, glsizei stride, glsizei count, const glvoid * pointer)
Parameter: size the number of parts of each color. The value must be 3 or 4.
Type indicates the Data Type of each color component in the color array. The optional data types are:
Gl_byte gl_unsigned_byte gl_short gl_unsigned_short
Gl_int gl_unsigned_int gl_float gl_unsigned_float
The Byte offset of two adjacent colors of stride. When stride is zero, color values are arranged one by one in the array.
Count the number of static colors, starting from the first color.
Pointer Points to the pointer to the first component of the first color element in the color array.
Glindex
Set the current color index
Void glindexd (gldouble C)
Void glindexf (glfloat C)
Void glindexi (glint C)
Void glindexs (glshort C)
Parameter: new current color index value of C
Void glindexdv (gldouble * C)
Void glindexfv (glfloat * C)
Void glindexiv (glint * C)
Void glindexsv (glshort * C)
Parameter: C points to an array pointer composed of a single element, which contains the new current color index value.
Glindexpointer
Define color index array
Void glindexpointer (glenum type, glsizei stride, glsizei count, const glvoid * pointer)
Parameter: Data Type of each color index in the type array. The possible symbol constant is gl_short gl_int gl_float gl_double.
The Byte offset of two adjacent color indexes of stride. When stride is zero, the color index values are arranged one by one in the array.
Count the number of color indexes, starting from the first color. They are static.
Pointer Points to the pointer of the first color index in the color array.
Glcolortableext
Specify the format and size of the palette for the target palette texture
Void glcolortableext (glenum target, glenum internalformat, glsizei width, glenum format, glenum type, const glvoid * Data)
Parameter: Target needs to change the target texture of the palette, which must be texture_1d texture_2d proxy_texture_1d proxy_texture_2d
Intenalformat (awaiting editing)
Width: the size of the color palette. N must be 2n> = 1.
Format (awaiting editing)
The data type of type data. The following symbolic constants are optional:
Gl_unsigned_byte gl_byte gl_unsigned_short gl_short gl_unsigned_int gl_int gl_unsigned_float gl_float
Data points to the texture data of the palette. For a palette project, data is processed as a single pixel in a one-dimensional texture palette project.
Glcolorsubtableext
Specify part of the target texture palette to be replaced
Void glcolorsubtableext (glenum target, glsizei start, glsizei count, glenum format, glenum type, const glvoid * Data)
Parameter: Target needs to change the target texture of the palette, which must be texture_1d texture_2d proxy_texture_1d proxy_texture_2d
Start is the index item of the Start palette of the changed palette.
Count the number of palette index items starting from start in the changed palette. The Count parameter determines the range of the palette index items in the changed palette.
Format (awaiting editing)
The data type of type data. The following symbolic constants are optional:
Gl_unsigned_byte gl_byte gl_unsigned_short gl_short gl_unsigned_int gl_int gl_unsigned_float gl_float
Data points to the texture data of the palette. For a palette project, data is processed as a single pixel in a one-dimensional texture palette project.
Draw a geometric chart
-----------------------------
Glvertex
Glvertexpointer
Glarrayelement
Glbegin, glend
Gledgeflag, gledgeflagv
Glpointsize
Gllinewidth
Gllinestipple
Glpolygonmode
Glfrontface
Glpolygonstipple
Gldrawelements
Glrect
Coordinate Conversion
-----------------------------
Gltranslate
Glrotate
Glscale
Glviewpoint
Glfrustum
Glortho
Glclipplane
Stack operations
------------------------------
Glloadmatrix
Glmultmatrix
Glmatrixmode
Glpushmatrix, glpopmatrix
Glpushattrib, glpopattrib
Glpushname, glpopname
Glinitname
Glloadname

Display list
-----------------------------
Glnewlist, gldlist
Glcalllist
Glcalllists
Glgenlists
Gldeletelists
Glislist
Use illumination and Materials
-----------------------------
Glnormal
Glnormalpointer
Gllight
Gllightmodel
Glmaterial
Glcolormaterial
Pixel operations
------------------------------
Glrasterpos
Glbitmap
Glreadpixels
Gldrawpixels
Glcopypixels
Glcopyteximage1d
Glcopyteximage2d
Glcopytexsubimage1d
Glcopytexsubimage2d
Glpixelzoom
Glpixelstore
Glpixeltransfer
Glpixelmap
Texture ing
-----------------------------
Glteximage1d
Glteximage2d
Gltexparameter
Gltexsubimage1d
Gltexsubimage2d
Gltexenv
Gltexcoord
Gltexgen
Gltexcoordpointer
Gldeletetextures
Special effects
----------------------------
Glblendfunc
Glhint
Glfog

Frame cache operations
-----------------------------
Glclear
Glclearaccum
Glclearcolor
Glcleardepth
Glclearindex
Glclearstencel
Gldrawbuffer
Glindexmask
Glcolormask
Gldepthmask
Glstencilmask
Glalphafunc
Glstencilfunc
Glstencilop
Gldepthfunc
Gldepthrange
Gllogicop
Glaccum
Curve or surface drawing
------------------------------
Glevalcoord
Glmap1
Glmap2
Glmapgrid
Glevalmesh
Glevalpoint
Query Functions
-----------------------------
Glget
Glgetclipplane
Glgetcolortableext
Glgetcolortableparameterfvext, glgetcolortableparameterivext
Glgeterror
Glgetlight
Glgetmap
Glgetmaterial
Glgetpixelmap
Glgetpointerv
Glgetpolygonstipple
Glgetstring
Glgettexenv
Glgetteximage
Glgettexlevelparameter
Glgettexparameter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.