icetDrawFunc(3)

NAME
icetDrawFunc - set a callback for drawing.

SYNOPSIS
#include <GL/ice-t.h>

typedef void (*IceTCallback)(void);

void icetDrawFunc(IceTCallback func);

DESCRIPTION
The icetDrawFunc function sets a callback that is used to draw the geometry from a given viewpoint.

func should be a function that issues appropriate OpenGL calls to draw geometry in the current OpenGL context. After func is called, the image left in the back frame buffer will be read back for compositing.

func should not modify the GL_PROJECTION_MATRIX as this would cause ICE-T to place image data in the wrong location in the tiled display and improperly cull geometry. It is acceptable to add transformations to GL_MODELVIEW_MATRIX, but the bounding vertices given with icetBoundingVerticies or icetBoundingBox* are assumed to already be transformed by any such changes to the modelview matrix. Also, GL_MODELVIEW_MATRIX must be restored before the draw function returns. Therefore, any changes to GL_MODELVIEW_MATRIX are to be done with care and should be surrounded by a pair of glPushMatrix and glPopMatrix functions.

func may be called several times from within a call to icetDrawFrame or not at all if the current bounds lie outside the current viewpoint. This can have a subtle but important impact on the behavior of func. For example, counting frames by incrementing a frame counter in func is obviously wrong (although you could count how many times a render occurs). func should also leave OpenGL in a state such that it will be correct for a subsequent run of func. Any matrices or attributes pushed in func should be popped before func returns, and any state that is assumed to be true on entrance to func should also be true on return.

ERRORS
None.

WARNINGS
None.

BUGS
None known.

NOTES
func is tightly coupled with the bounds set with icetBoundingVertices or icetBoundingBox*. If the geometry drawn by func is dynamic (changes from frame to frame), then the bounds may need to be changed as well. Incorrect bounds may cause the geometry to be culled in surprising ways.

COPYRIGHT
Copyright © 2003 Sandia Corporation
Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive license for use of this work by or on behalf of the U.S. Government. Redistribution and use in source and binary forms, with or without modification, are permitted provided that this Notice and any statement of authorship are reproduced on all copies.

SEE ALSO
icetDrawFrame, icetBoundingVertices, icetBoundingBox*