news ] downloads ] plugins ] modules ] documentation ] info ]
OpenGL -- Documentation for the TKScript OpenGL bindings.
 

Table of contents

The tkopengl plugin

The tkopengl plugin provides bindings for the OpenGL API as well as some additional tool classes and functions to handle vectors, matrices, textures and display lists.

The plugin itself does not handle issues like user input or desktop windows and screens. It should be used in addition to the SDL or FOX plugins which can both provide an OpenGL context/visual to draw into.

Constants

GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE, GL_FOG_HINT, GL_LINE_SMOOTH_HINT, GL_PERSPECTIVE_CORRECTION_HINT, GL_POINT_SMOOTH_HINT, GL_POLYGON_SMOOTH_HINT, GL_FASTEST, GL_NICEST, GL_DONT_CARE, GL_ALPHA_TEST, GL_AUTO_NORMAL, GL_BLEND, GL_CULL_FACE, GL_DEPTH_TEST, GL_DITHER, GL_FOG, GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHT4, GL_LIGHT5, GL_LIGHT6, GL_LIGHT7, GL_LIGHTING, GL_LINE_SMOOTH, GL_LINE_STIPPLE, GL_NORMALIZE, GL_POINT_SMOOTH, GL_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_POINT, GL_POLYGON_SMOOTH, GL_POLYGON_STIPPLE, GL_SCISSOR_TEST, GL_STENCIL_TEST, GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, GL_OR_INVERTED, GL_FLAT, GL_SMOOTH, GL_FRONT, GL_BACK, GL_FRONT_AND_BACK, GL_POINT, GL_LINE, GL_FILL, GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA_SATURATE, GL_CW, GL_CCW, GL_KEEP, GL_REPLACE, GL_INCR, GL_DECR, GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS, GL_POLYGON_OFFSET_LINE, GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY, GL_COLOR_LOGIC_OP, GL_S, GL_T, GL_R, GL_Q, GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_Q, GL_EYE_LINEAR, GL_OBJECT_LINEAR, GL_SPHERE_MAP, GL_TEXTURE_GEN_MODE, GL_OBJECT_PLANE, GL_EYE_PLANE, GL_DEPTH_COMPONENT, GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_RGB, GL_RGBA, GL_LUMINANCE, GL_LUMINANCE8, GL_LUMINANCE_ALPHA, GL_LUMINANCE8_ALPHA8, GL_INTENSITY, GL_INTENSITY8, GL_RGB5, GL_RGB8, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_R3_G3_B2, GL_CURRENT_BIT, GL_ENABLE_BIT, GL_EVAL_BIT, GL_FOG_BIT, GL_HINT_BIT, GL_LIGHTING_BIT, GL_LINE_BIT, GL_LIST_BIT, GL_PIXEL_MODE_BIT, GL_POINT_BIT, GL_POLYGON_BIT, GL_POLYGON_STIPPLE_BIT, GL_SCISSOR_BIT, GL_TEXTURE_BIT, GL_TRANSFORM_BIT, GL_VIEWPORT_BIT, GL_ALL_ATTRIBS_BIT, GL_CLIENT_PIXEL_STORE_BIT, GL_CLIENT_VERTEX_ARRAY_BIT, GL_CLIENT_ALL_ATTRIB_BITS, GL_BGRA_EXT, GL_BGR_EXT, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION, GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_QUADS, GL_QUAD_STRIP, GL_POLYGON, GL_LINEAR, GL_EXP, GL_EXP2, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, GL_STENCIL_BUFFER_BIT, GL_CLIP_PLANE0, GL_CLIP_PLANE1, GL_CLIP_PLANE2, GL_CLIP_PLANE3, GL_CLIP_PLANE4, GL_CLIP_PLANE5.

Functions

  • glAlphaFunc (int _func, float _ref) - Specifies the alpha comparison function.
    • _func: Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL and GL_ALWAYS are accepted. The initial value is GL_ALWAYS.
    • _ref: Specifies the reference value that incoming alpha values are compared to.

     
  • glArrayElement (int _i) - render a vertex using the specified vertex array element.
    • _i: specifies an index into the enabled vertex data arrays.

     
  • glBegin (int _mode) - delimit the vertices of a primitive or a group of primitivs.
    • _mode: Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted.

     
  • glBindTexture (int _target, int _texture)- bind a named texture to a texturing target.
    • _target: GL_TEXTURE_1D or GL_TEXTURE_2D. _texture: Specifies the name of a texture.

     
  • glBlendFunc (int _sfactor, int _dfactor) - specify pixel arithmetic
    • _sfactor: One of GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_SRC_ALPHA_SATURATE. The initial value is GL_ONE.
    • _dfactor: Specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR , GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA. The initial value is GL_ZERO.

     
  • glCallList (int _list) - execute a display list.
    • _list : specifies the integer name of the display list to be executed.

     
  • glCullFace (int _mode) - Specifies whether front- or back-facing facets are candidates for culling.
    • _mode: Symbolic constants GL_FRONT, GL_BACK and GL_FRONT_AND_BACK are accepted. The initial value is GL_BACK.

     
  • glClearColor (float _r, float _g, float _b, float _a) - specify clear values for the color buffers. (0..[_r,_g,_b,_a]..1)
     
  • glClear (int _mask) - clear buffers to preset values.
    • _mask: Bitwise OR of masks that indicate the buffers to be cleared. The four masks are GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_ACCUM_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT.

     
  • glClearDepth (float _z) - specify the clear value for the depth buffer.
     
  • glClearStencil (int _val) - specify the clear value for the stencil buffer.
     
  • glColor3f (float _r, float _g, float _b) - set the current color. (0..[_r,_g,_b]..1)
     
  • glColor3ub (int _r, int _g, int _b) - set the current color. (0..[_r,_g,_b]..255)
     
  • glColor4f ( float _r, float _g, float _b, float _a ) - set the current color. (0..[_r,_g,_b,_a]..1)
     
  • glColor4ub ( int _r, int _g, int _b, int _a) - set the current color. (0..[_r,_g,_b,_a]..255)
     
  • glColorMask (int _r, int _g, int _b, int _a) - enable/disable writes to the r,g,b,a frame buffer components.
     
  • glCopyPixels (int _x, int _y, int _width, int _height, int _type) - copies a screen-aligned rectangle of pixels from the specified frame buffer location to a region relative to the current raster position.
    • _type: one of GL_COLOR, GL_DEPTH, GL_STENCIL.

     
  • glCopyTexSubImage2D (int _target, int _mipmap, int _xoffset, int _yoffset, int _x, int _y, int _width, int _height) - replaces a rectangular portion of a two-dimensional texture image with pixels from the current GL_READ_BUFFER (rather than from main memory, as is the case for glTexSubImage2D)
    • _target: specifies the target texture. Must be GL_TEXTURE_2D.

     
  • glCopyTexImage2D (int _target, int _mipmap, int _internalformat, int _x, int _y, int _width, int _height, int _border) - copy pixels [from the current GL_READ_BUFFER ] into a 2D texture image.
    • _target: GL_TEXTURE_2D or GL_TEXTURE_1D
    • _mipmap: mipmap level (0..n)
    • _internalformat: Specifies the internal format of the texture. Must be one of the following symbolic constants: GL_ALPHA, GL_ALPHA8, GL_LUMINANCE, GL_LUMINANCE8, GL_LUMINANCE_ALPHA, GL_LUMINANCE8_ALPHA8, GL_INTENSITY, GL_INTENSITY8, GL_RGB, GL_R3_G3_B2, GL_RGB5, GL_RGB8, GL_RGBA, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_BGRA_EXT or GL_BGR_EXT.

     
  • glDepthFunc (int _func) - specify the value used for depth comparisons
    • _func: Specifies the depth comparison function. Symbolic constants GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL, GL_GREATER, GL_NOTEQUAL, GL_GEQUAL and GL_ALWAYS are accepted. The initial value is GL_LESS.

     
  • glDepthMask (float _znear, float _zfar) - specify mapping of depth values from normalized device coordinates to window coordinates
     
  • glDisable (int _cap) - disable server-side GL capabilities
     
  • glDisableClientState (int _cap) - disable client-side GL capability.
     
  • glDrawArrays (int _mode, int _first, int _count) - render primitives from array data
    • _mode: Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, and GL_POLYGON are accepted.

     
  • glDrawBuffer (int _mode) - specify which color buffers are to be drawn into
    • _mode: GL_NONE, GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT or GL_FRONT_AND_BACK.

     
  • glEdgeFlag (int _b) - flag edges as either boundary or nonboundary
    • _b: flag edges as either boundary or nonboundary. Each vertex of a polygon, separate triangle, or separate quadrilateral specified between a glBegin/glEnd pair is marked as the start of either a boundary or nonboundary edge. If the current edge flag is true when the vertex is specified, the vertex is marked as the start of a boundary edge. Otherwise, the vertex is marked as the start of a nonboundary edge. glEdgeFlag sets the edge flag bit to GL_TRUE if flag is GL_TRUE, and to GL_FALSE otherwise.

     
    glEnable (int _cap) - enable server-side GL capabilities
    • _cap: GL_ALPHA_TEST, GL_AUTO_NORMAL, GL_BLEND, GL_COLOR_LOGIC_OP, GL_CULL_FACE, GL_DEPTH_TEST, GL_DITHER, GL_FOG, GL_LIGHT0, GL_LIGHT1, GL_LIGHT2, GL_LIGHT3, GL_LIGHTING, GL_LINE_SMOOTH, GL_LINE_STIPPLE, GL_NORMALIZE, GL_POINT_SMOOTH, GL_POLYGON_SMOOTH, GL_POLYGON_STIPPLE, GL_SCISSOR_TEST, GL_STENCIL_TEST, GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_GEN_Q, GL_TEXTURE_GEN_R, GL_TEXTURE_GEN_S, GL_TEXTURE_GEN_T.

     
  • glEnableClientState (int _cap) - enable server-side GL capability
    • _cap: One of GL_COLOR_ARRAY, GL_NORMAL_ARRAY, GL_TEXTURE_COORD_ARRAY, GL_VERTEX_ARRAY.

     
  • glEnd () - delimit the vertices of a primitive or a group of like primitives
     
  • glFinish () - block until all GL execution is complete.
     
  • glFlush () - force execution of GL commands in finite time.
     
  • glFrontFace (int _mode) - define front- and back-facing polygons
    • _mode: specifies the orientation of front-facing polygons. GL_CW and GL_CCW are accepted.

     
  • glFrustum (float _left, float _right, float _bottom, float _top, float _znear, float _zfar) - multiply the current matrix by a perspective matrix
    • _left, _right: specify the coordinates for the left and right vertical clipping planes
    • _bottom, _top: specify the coordinates for the bottom and top horizontal clipping planes
    • _znear, _zfar: specify the distances to the near and far depth clipping planes. Both distances must be positive.

     
  • glHint (int _target, int _mode) - specify implementation specific hints
    • _target: GL_FOG_HINT, GL_LINE_SMOOTH_HINT, GL_PERSPECTIVE_CORRECTION_HINT, GL_POINT_SMOOTH_HINT, GL_POLYGON_SMOOTH_HINT. _mode: GL_FASTEST, GL_NICEST or GL_DONT_CARE.

     
  • glLoadIdentity () - replace the current matrix with the identity matrix.
     
  • glLineWidth (float _width) - specify the width of rasterized lines.
     
  • glLineStipple (int _factor, int _pattern) - specify the line stipple pattern
    • _factor: Specifies a multiplier for each bit in the line stipple pattern. If factor is 3, for example, each bit in the pattern is used three times before the next bit in the pattern is used
    • _pattern: Specifies a 16-bit integer whose bit pattern determines which fragments of a line will be drawn when the line is rasterized. Bit zero is used first; the default pattern is all 1's.

     
  • glLogicOp (int _mode) - Specifies a symbolic constant that selects a logical [color] operation
    • _mode: The following symbols are accepted: GL_CLEAR, GL_SET, GL_COPY, GL_COPY_INVERTED, GL_NOOP, GL_INVERT, GL_AND, GL_NAND, GL_OR, GL_NOR, GL_XOR, GL_EQUIV, GL_AND_REVERSE, GL_AND_INVERTED, GL_OR_REVERSE, and GL_OR_INVERTED. The initial value is GL_COPY.

     
  • glMatrixMode (int _mode) - specify which matrix is the current matrix
    • _mode: GL_MODELVIEW, GL_PROJECTION, GL_TEXTURE)

     
  • glNormal3f (float _x, float _y, float _z) - set the current normal vector
     
  • glOrtho (float _left, float _right, float _bottom, float _top, float _znear, float _zfar) - multiply the current matrix with an orthographic matrix
     
  • glPointSize (float _size) - specify the diameter of rasterized points.
     
  • glPixelZoom (float _xfactor, float _yfactor) - specify the pixel zoom factors.
     
  • glPolygonMode (int _face, int _mode) - select a polygon rasterization mode
    • _face : One of GL_FRONT, GL_BACK or GL_FRONT_AND_BACK.
    • _mode : One of GL_POINT, GL_LINE or GL_FILL.

     
  • glPopAttrib () - pop the server attribut stack
     
  • glPushAttrib (int _mask) - push the server attribut stack
     
  • glPopClientAttrib () - pop the client attribut stack
     
  • glPushClientAttrib (int _mask) - push the client attribut stack
     
  • glPopMatrix () - pop the current matrix stack.
     
  • glPushMatrix () - push the current matrix stack
     
  • glRasterPos2i (int _x, int _y) - specify the raster position for pixel operations.
     
  • glRasterPos2f (float _x, float _y) - specify the raster position for pixel operations.
     
  • glRasterPos3f (float _x, float _y, float _z) - specify the raster position for pixel operations.
     
  • glReadBuffer (int _mode) - select a color buffer source for pixels
    • _mode: Specifies a color buffer. Accepted values are GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT.

     
  • glRectf (float _x1, float _y1, float _x2, float _y2) - draw a rectangle (x1, y1); (x2, y1); (x2, y2); (x1, y2)
     
  • glRotatef (float _deg, float _ax, float _ay, float _az) - multiply the current matrix by a rotation matrix
    • (_ax, _ay, _az): rotation angles (around x, around y, around z)

     
  • glScalef (float _x, float _y, float _z) - multiply the current matrix with a general scaling matrix.
     
  • glScissor (int _x, int _y, int _width, int _height) - define the scissor box.
    • _x and _y: specify the lower left corner of the box
    • _width and _height: specify the width and height of the box. (in window coordinates)

     
  • glShadeModel (int _mode) - select flat or smooth shading.
    • _mode: Accepted values are GL_FLAT and GL_SMOOTH.

     
  • glStencilFunc (int _func, int _ref, int _mask) - set function and reference value for stencil testing
    • _func: GL_NEVER, GL_LESS, GL_LEQUAL, GL_GREATER, GL_GEQUAL, GL_EQUAL, GL_NOTEQUAL, GL_ALWAYS.
    • _ref : Specifies the reference value for the stencil test. _ref is clamped to the range [0,2n-1], where n is the number of bitplanes in the stencil buffer.
    • _mask: Specifies a mask that is ANDed with both the reference value and the stored stencil value when the test is done.

     
  • glStencilOp (int _fail, int _zfail, int _zpass) - set stencil test actions
    • _fail, _zfail, _zpass: GL_KEEP, GL_ZERO, GL_REPLACE, GL_INCR, GL_DECR, GL_INVERT.

     
  • glStencilMask (int _mask) - control the writing of individual bits in the stencil planes
    • _mask : Specifies a bitmask to enable and disable writing of individual bits in the stencil planes.

     
  • glTexCoord1f (float _u) - set the current 1D texture coordinate.
     
  • glTexCoord2f (float _u, float _v) - set the current 2D texture coordinates.
     
  • glTexGeni (int _coord, int _pname, int _param) - control the generation of texture coordinates
    • _coord: GL_S, GL_T, GL_R or GL_Q.
    • _pname: GL_TEXTURE_GEN_MODE.
    • _param: GL_OBJECT_LINEAR, GL_EYE_LINEAR, GL_SPHERE_MAP.

     
  • glTranslatef (float _x, float _y, float _z) - multiply the current matrix by a translation matrix.
     
  • glVertex2i (int _x, int _y) - specify an 1D vertex
     
  • glVertex2fa (int _x, int _y) - specify a 2D vertex
     
  • glVertex3f (float _x, float _y) - specify a 3D vertex
     
  • glViewport (int _x, int _y, int _width, int _height) - specifies the affine transformation of x and y from normalized device coordinates to window coordinates.
    • _x, _y : specify the lower left corner of the viewport rectangle, in pixels.
    • _width, _height : Specify the width and height of the viewport.

     
  • zglClipPlane (int _glClipPlaneId, float _eq0, float _eq1, float _eq2, float _eq3, float _eq4, float _eq5) - specify a plane against which all geometry is clipped.
     
  • zglColorARGB (int _argb) - set the current color
     
  • zglColor1f (float _gray) - set the current color
     
  • zglColorPointer3f (FloatArray _fa) - define an array of colors. (r,g,b triples)
     
  • zglColorPointer4f (FloatArray _fa) - define an array of colors. (r,g,b,a quads)
     
  • zglColorPointer4b (IntArray _ia) - define an array of colors. (r,g,b,a >=32bit ints)
     
  • zglFogColor4f (float _r, float _g, float _b, float _a) - specify the fog color.
     
  • zglFogDensity (float _density) - specify the fog density used in both exponential fog equations.
     
  • zglFogEnd (float _z) - specify the far distance used in the linear fog equation.
     
  • zglFogMode (int _mode) - specify the equation to be used to compute the fog blend factor.
    • _mode: GL_LINEAR, GL_EXP, GL_EXP2.

     
  • zglFogStart (float _z) - specify the near distance used in the linear fog equation.
     
  • zglFrustum(float _aspect, float _fov, float _znear, float _zfar) - multiply the current matrix by a perspective matrix
     
  • zglInit2D (float _sx, float _sy) - load a 2D matrix (0.._sx,_sy)
     
  • zglInitOrtho (float _sx, float _sy) - load an orthographic matrix (-sx,-sy..sx,sy)
     
  • zglInitPerspective (float _aspect, float _fov, float _znear, float _zfar) - load a perspective matrix
     
  • zglLoadMatrix (Matrix _m, Vector _t) - replace the current matrix.
    • _m: rotation Matrix
    • _t: translation vector

     
  • zglLightAmbient4f (int _lightnr, float _r, float _g, float _b, float _a) - specify the ambient RGBA intensity of the light
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightConstantAttenuation (int _lightnr, float _f) - specify a light attenuation factor.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightDiffuse4f (int _lightnr, float _r, float _g, float _b, float _a) - specify the diffuse RGBA intensity of the light.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightLinearAttenuation (int _lightnr, float _f) - specify a light attenuation factor.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightMaterialAmbient4f (int _face, float _r, float _g, float _b, float _a) - specify the ambient RGBA reflectance of the material.
    • _face: GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

     
  • zglLightMaterialAmbientAndDiffuse4f (int _face, float _r, float _g, float _b, float _a) - specify the ambient and diffuse RGBA reflectance of the material.
    • _face: GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

     
  • zglLightMaterialDiffuse4f (int _face, float _r, float _g, float _b, float _a) - specify the diffuse RGBA reflectance of the material.
    • _face: GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

     
  • zglLightMaterialSpecular4f (int _face, float _r, float _g, float _b, float _a) - specify the specular RGBA reflectance of the material.
    • _face: GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

     
  • zglLightMaterialEmission4f (int _face, float _r, float _g, float _b, float _a) - specify the RGBA emitted light intensity of the material.
    • _face: GL_FRONT, GL_BACK, GL_FRONT_AND_BACK.

     
  • zglLightMaterialShininess (int _exp) - specify the RGBA specular exponent of the material.
    • _exp: 0..128

     
  • zglLightModelAmbient4f (int _lightnr, float _r, float _g, float _b, float _a) - specify the ambient RGBA intensity of the entire scene.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightModelLocalViewer (int _bool) - specify how reflection angles are computed.
    • _bool: 0=-z axis, 1=origin of the eye coordinate system.

     
  • zglLightModelTwoSide (int _bool) - specify whether one- or two-sided lighting calculations are done for polygons.
     
  • zglLightPositionf (int _lightnr, float _x, float _y, float _z) - specify the position of the light.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightPositionv (int _lightnr, Vector _v, float _w) - specify the position of the light.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightQuadraticAttenuation (int _lightnr, float _f) - specify a light attenuation factor.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightSpecular4f (int _lightnr, float _r, float _g, float _b, float _a) - specify the specular RGBA intensity of the light.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightSpotCutOff (int _lightnr, int _coff) - specify the maximum spread angle of a light source.
    • _lightnr: GL_LIGHTi. [0..3] _exp: [0..90, 180]

     
  • zglLightSpotDirectionf (int _lightnr, float _x, float _y, float _z) - specify the direction of the light.
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightSpotDirectionv (int _lightnr, Vector _v) - specify the direction of the light
    • _lightnr: GL_LIGHTi. [0..3]

     
  • zglLightSpotExponent (int _lightnr, int _exp) - specify the intensity distribution of the light.
    • _lightnr: GL_LIGHTi. [0..3] _exp: [0..128]

     
  • zglNormalPointer (FloatArray _fa) - define an array of normals.
     
  • zglNormalv (Vector _v) - glNormalf(_v.x, _v.y, _v.z)
     
  • zglRotate3f (float _x, float _y, float _z) - see zglRotatev()
     
  • zglRotatev (Vector _r) - multiply GL matrix by temporary Matrix (rotate _r.x, _r.y, _r.z (0..2PI) around x,y,z axis)
     
  • zglScalev (Vector _v) - glScalef(_v.x, _v.y, _v.z)
     
  • zglStoreMatrix (Matrix _m, Vector _t) - query the current matrix.
    • _m: dest. rotation Matrix
    • _t: dest. translation vector

     
  • zglTexCoordPointer2f (FloatArray _fa) - define an array of 2D texture coordinates.
     
  • zglTranslatev (Vector _v) - glTranslatef(_v.x, _v.y, _v.z)
     
  • zglVertexPointer (FloatArray _fa) - define an array of vertex data.
     
  • zglVertexv (Vertex _v) - see glVertex3f()
     
  • zgluLookAt (Vector _eye, Vector _center, Vector _up) - load a "camera"
     
  • int zglReadColorPixel (int _x, int _y) - read a pixel from the RGBA framebuffer
     
  • float zglReadDepthPixel (int _x, int _y) - read a pixel from the depthbuffer
     
  • int mathC32ToC8 (int _gray) - convert #AARRGGBB color to 8 bit grayscale
     
  • mathDistancePointPlane (Vector _a,Vector _pv, Vector _pn) - return distance of _a to infinite plane (_pv, _pnormal)
     
  • mathNormal (Vector _v1,Vector _v2, Vector _v3, Vector _ret) - calculate normal vector for triangle specified by (v1, v2, v3)
     
  • mathProject (Vector _v,Vector _ret) - project a single point _v using the current GL matrices.
     
  • mathReflect (Vector _in,Vector _n, Vector _ret) - return ray _in reflected by an infinite plane specified by its normal _n
     
  • mathUnproject (Vector _p,Vector _ret_znear, Vector _ret_zfar) - query znear/zfar values for e.g. a mouse coordinate
     
  • mathVectorMax (Vector _a,Vector _b, Vector _r) - return max (_a, _b) in _r
     
  • mathVectorMin (Vector _a,Vector _b, Vector _r) - return min (_a, _b) in _r
     
  • IVector ivector (int _x, int _y) - construct a new (temporary) IVector object
     
  • Vector vector (float _x, float _y, float _z) - construct a new (temporary) Vector object
     
  • Vector4 vector4 (float _x, float _y, float _z, float _w) - construct a new (temporary) Vector4 object
     

Examples

Please download the tks-examples.zip archive which also contains several OpenGL/SDL demos.

 

SimpleDirectLayer library OpenGL zlib compression library The FreeType project PortableNetworkGraphics MySQL