Overview Function List GLOD Web Site


glodDrawPatch - Draws a specific patch in a GLOD object


void glodDrawPatch(GLuint name, GLuint patchname)


The name of the object to draw

The name of the patch to draw within this object


This call draws a patch in a GLOD object based on the current OpenGL vertex array state. Only those vertex arrays that are enabled are issued for drawing. This means that to issue the normals of your GLOD Object, you must have GL_NORMAL_ARRAY enabled. Having GLOD_VERTEX_ARRAY disabled will disable any GLOD drawing.

This call will not modify your OpenGL state beyond what is listed below:

GLOD does not provide a DrawObject function. This is because you can duplicate this functionality by performing a DrawPatch for each patch that you have in your object. This provides fine-grained control of rendering parameters, including but not limited to texture and lighting modes.

Drawing an entire object

If you don't need to change your rendering state between patches of your object, the following utility code may be useful to you:

  int num_patches; 
  int *patches;
  glodGetObjectIntegerv(MY_OBJ_NUM, GLOD_NUM_PATCHES, &num_patches);
  patches = malloc(sizeof(int) * num_patches);
  glodGetObjectIntegerv(MY_OBJ_NUM, GLOD_PATCH_NAMES, patches);
  for(int i = 0; i < num_patches; i++)
    glodDrawPatch(MY_OBJ_NUM, patches[i]);


GLOD_INVALID_NAME is generated if the object specified does not exist.
GLOD_INVALID_PATCH is generated if the patch specified does not exist within this object.

Last modified: 06/10/04 06:32:24 PM