*vgl_DrawFunBegin - create an instance of a DrawFun object vgl_DrawFunEnd - destroy an instance of a DrawFun object vgl_DrawFunError - return DrawFun object error flag vgl_DrawFunCopy - make a copy of a DrawFun object
vgl_DrawFunSet - set function pointers Get - get function pointers vgl_DrawFunSetObj - set auxiliary object GetObj - get auxiliary object vgl_DrawFunAPI - set built-in drawing functions
vgl_DrawFunCloseWindow - close window vgl_DrawFunConfigureWindow - request window position, size, state vgl_DrawFunConnectWindow - connect to preexisting window vgl_DrawFunDisconnectWindow - disconnect from window vgl_DrawFunOpenWindow - open window vgl_DrawFunParentWindow - specify parent window vgl_DrawFunPositionWindow - request initial window position and size vgl_DrawFunQueryWindow - query current window vgl_DrawFunSetWindow - set currently active window for drawing vgl_DrawFunVisualWindow - request window visual properties
vgl_DrawFunBackColor - set current clear RGB color vgl_DrawFunBackColorIndex - set current clear color index vgl_DrawFunBell - ring bell vgl_DrawFunClear - clear frame buffer vgl_DrawFunDelay - time delay vgl_DrawFunFlush - flush all pending graphics primitives vgl_DrawFunRender - set rasterization mode vgl_DrawFunResize - resize frame buffer vgl_DrawFunSetFactors - set factors to control shader modes vgl_DrawFunSetMode - set current graphics mode GetMode - return current graphics modes vgl_DrawFunSetSwitch - enable, disable lights, clipping planes vgl_DrawFunSwap - swap frame buffers
vgl_DrawFunBufferSize - specify color buffer size vgl_DrawFunExtentQuery - query extent box vgl_DrawFunGetFloat - return selected floating point parameters vgl_DrawFunGetInteger - return selected integer parameters vgl_DrawFunGetString - return selected string parameters vgl_DrawFunSelectBuffer - specify selection hit buffers vgl_DrawFunSelectQuery - query number of selection hits vgl_DrawFunSelectRegion - specify selection region
vgl_DrawFunClip - define clipping rectangle vgl_DrawFunClipPlane - define clipping plane vgl_DrawFunDepthRange - define z buffer mapping vgl_DrawFunProjFrustum - define a perspective projection vgl_DrawFunProjOrtho - define an orthographic projection vgl_DrawFunProjPop - pop projection matrix from stack vgl_DrawFunProjPush - push projection matrix onto stack vgl_DrawFunProjLoad - load projection matrix onto stack vgl_DrawFunViewport - define viewport transformation
vgl_DrawFunXfmLoad - load modelview matrix onto stack vgl_DrawFunXfmMult - multiply modelview matrix vgl_DrawFunXfmPop - pop modelview matrix from stack vgl_DrawFunXfmPush - push modelview matrix on stack
vgl_DrawFunLight - define a light source vgl_DrawFunLightModel - define overall lighting model properties
vgl_DrawFunBitmapDefine - define a bitmap vgl_DrawFunBitmapSelect - select current bitmap vgl_DrawFunRasFontDefine - define a raster font vgl_DrawFunRasFontSelect - select current raster font vgl_DrawFunTextureDefine - define a texture map vgl_DrawFunTextureSelect - select current texture map
vgl_DrawFunAttPop - pop attributes from stack vgl_DrawFunAttPush - push attributes onto stack vgl_DrawFunColor - set current RGB color vgl_DrawFunColorIndex - set current color index vgl_DrawFunData - set current data values vgl_DrawFunDataIndex - load index values vgl_DrawFunLineStyle - set line style vgl_DrawFunLineWidth - set line width vgl_DrawFunPointSize - set point size vgl_DrawFunPointStyle - set point style vgl_DrawFunPolygonMode - specify polygon drawing mode vgl_DrawFunPolygonOffset - specify polygon factor and bias vgl_DrawFunSpecularity - set specularity vgl_DrawFunTextPixelSize - specify raster font pixel size vgl_DrawFunTextPlane - specify raster font plane vgl_DrawFunTrans - set transparency factor vgl_DrawFunTransIndex - set transparency index
vgl_DrawFunInitBuffer - create a vertex buffer vgl_DrawFunTermBuffer - delete a vertex buffer vgl_DrawFunCopyBuffer - copy vertex data to a vertex buffer
vgl_DrawFunPolygon - draw polygon vgl_DrawFunPolygonArray - draw arrays of polygons vgl_DrawFunPolygonBuffer - draw vertex buffers of polygons vgl_DrawFunPolygonColor - draw Gouraud shaded polygon vgl_DrawFunPolygonData - draw polygon with data vgl_DrawFunPolygonDC - draw device oriented polygon vgl_DrawFunPolyLine - draw polyline vgl_DrawFunPolyLineArray - draw arrays of polylines vgl_DrawFunPolyLineBuffer - draw vertex buffers of polylines vgl_DrawFunPolyLineColor - draw Gouraud shaded polyline vgl_DrawFunPolyLineData - draw polyline with data vgl_DrawFunPolyLineDC - draw device oriented polyline vgl_DrawFunPolyPoint - draw points vgl_DrawFunPolyPointArray - draw arrays of points vgl_DrawFunPolyPointBuffer - draw vertex buffers of points vgl_DrawFunPolyPointColor - draw colored points vgl_DrawFunPolyPointData - draw points with data vgl_DrawFunPolyPointDC - draw device oriented points vgl_DrawFunPolyArray - draw arrays of primitives vgl_DrawFunPolyBuffer - draw vertex buffers of primitives vgl_DrawFunPolyElemArray - draw indexed arrays of primitives vgl_DrawFunPolyElemBuffer - draw indexed vertex buffers of primitives vgl_DrawFunText - draw raster font text vgl_DrawFunTextDC - draw screen offset raster font text
vgl_DrawFunFBufferRead - read frame buffer to client side vgl_DrawFunFBufferWrite - write frame buffer from client side vgl_DrawFunZBufferRead - read z buffer to client side vgl_DrawFunZBufferWrite - write z buffer from client side vgl_DrawFunPixelmapCreate - create server side pixmap vgl_DrawFunPixelmapDestroy - destroy server side pixmap vgl_DrawFunPixelmapRead - read into server side pixmap vgl_DrawFunPixelmapWrite - write from server side pixmap
vgl_DrawFunPollMouse - poll mouse location and buttons vgl_DrawFunPollModifiers - poll control and shift buttons vgl_DrawFunWarpMouse - move mouse location vgl_DrawFunSetCursor - set cursor style vgl_DrawFunReadQueue - read from event queue vgl_DrawFunTestQueue - test event queue vgl_DrawFunResetQueue - reset event queue
#include <X11/Xlib.h> Display *display; int screen; /* open X display */ display = XOpenDisplay (0); screen = DefaultScreen (display);
Once the display and screen are established, each graphics device interface module must be passed this information. The display and screen are stored as "class" variables within each module. All subsequent objects instanced from a particular module will use the current display and screen class variables of the module. For example, to set the display and screen information in the OpenGL device interface module, OpenGLDev, use the following:
vgl_OpenGLDevConnectX (display,screen);Before rendering can occur to a graphics device, a device object and associated drawing function object must be instanced, window attributes set and a window opened. The following illustrates instancing OpenGLDev and DrawFun objects and setting OpenGL drawing functions.
vgl_OpenGLDev *ogldev; vgl_DrawFun *df; /* create drawing function */ df = vgl_DrawFunBegin(); /* create OpenGL device object */ ogldev = vgl_OpenGLDevBegin(); /* load drawing functions for OpenGL device */ vgl_OpenGLDevDrawFun (ogldev,df);At this point opening, closing and rendering to a graphics window can be accomplished abstractly using a DrawFun object generated in the manner above.
If the user wishes to open and close the graphics window, vgl_DrawFunConnectWindow must be used to inform the device interface object of the window id or handle of the window to render to. If the user opens the window using VglTools, set any window attributes such as parent, size, position, or visual class using vgl_DrawFunParentWindow, vgl_DrawFunConfigureWindow, vgl_DrawFunPositionWindow, and vgl_DrawFunVisualWindow. Then open the window using vgl_DrawFunOpenWindow. At this point the window is ready for rendering. To close a window and terminate VglTools, reverse the process described above. The following code fragment illustrates this process:
/* close window */ vgl_DrawFunCloseWindow (df); /* delete objects */ vgl_OpenGLDevEnd (ogldev); vgl_DrawFunEnd (df); /* disconnect from X server */ vgl_OpenGLDevDisconnect (); /* close X display */ XCloseDisplay (display);Table of Contents
Frame buffer modes are enabled and disabled using vgl_DrawFunSetMode. Examples of frame buffer modes include z-buffering, XOR drawing, double buffering, front buffer drawing and reading and stencil buffer control. One particularly unique frame buffer mode is polygon depth mode. When enabled, polygon depth mode ensures that when points, lines and polygons are drawn coincidently in space that polygons are automatically given a slightly greater depth than points and lines. This results in points and lines being given visibility priority over polygons. This is useful when drawing the edges of polygons or contour lines across a polygon.
Frame buffer actions include setting the background or "clear" color, swapping buffers in a double buffered frame buffer, resizing the frame buffer, etc. The frame buffer must be resized with vgl_DrawFunResize whenever the dimensions of the graphics window change.
Up to 8 lights may defined to light a scene. Ambient light is generally provided by a single ambient light, it produces no diffuse or specular reflections. Diffuse and specular reflections are generated by defining one or more distant lights. Lights which produce diffuse and specular reflections do not contribute to the ambient light. Diffuse and specular reflections are only produced by polygon primitives for which the polygon normals have been supplied by the user. VglTools does not compute polygon normals automatically.
The current color is assumed to be the base material color for ambient and diffuse lighting effects. Specular reflections are only produced if vgl_DrawFunSpecularity has been called to specify a current material specularity and shininess.
All point, line and polygon primitives come in 6 varieties. The basic function draws a graphics primitive with a constant color with all vertex coordinates expressed in world coordinates, eg. vgl_DrawFunPolyLine. A graphics primitive may be drawn with varying color, called "Gouraud shading", by adding an argument specifying a color for each vertex, eg. vgl_DrawFunPolyLineColor. A special "data" rendering function is provided for those rendering methods which render raw data to a frame buffer, eg. vgl_DrawFunPolyLineData. A fourth function type draws a graphics primitive anchored at a single 3D world coordinate location with all other vertices specified as device coordinate (pixel) offsets from the anchor point, eg. vgl_DrawFunPolyLineDC. This allows primitives to be drawn which are always oriented perpendicular to the view direction and are unaffected by scaling transformations.
The final two function types for drawing graphics primitives are designed to draw large arrays of primitives with varying vertex colors, normals, and texture coordinates. Point, line and polygon graphics primitives can be drawn with full access to vertex attributes such as color, normals and texture coordinates. These functions are designed to get high graphics performance from modern graphics hardware. They should be used whenever possible rather than the older single primitive functions such as vgl_DrawFunPolyLine, vgl_DrawFunPolyLineColor and vgl_DrawFunPolyLineData. The two function types are differentiated by their use of on-board graphics processing memory. The first set of functions delivers graphics primitives atomically from client memory. The specific functions for each of these dimensional classes of primitives are as follows, vgl_DrawFunPolyPointArray, vgl_DrawFunPolyLineArray and vgl_DrawFunPolygonArray. The second set of functions are specifically designed to use graphics card memory in the form of "vertex buffer objects". The drawing functions vgl_DrawFunInitBuffer, vgl_DrawFunTermBuffer, vgl_DrawFunCopyBuffer are required to specifically initialize buffer memory, delete it and copy data from client to buffer memory. Then in addition there are the usual functions to draw points, lines and polygons once the buffer objects have been generated, vgl_DrawFunPolyPointBuffer, vgl_DrawFunPolyLineBuffer and vgl_DrawFunPolygonBuffer.
Vertex color may be entered as float values ranging from (0.,1.) or unsigned char values in the interval (0,255). When entering color as float values two options are available, VGL_COLOR_3F enters red,green,blue components and VGL_COLOR_4F enters red,green,blue,alpha components. If VGL_COLOR_3F is used, the alpha component is set to 1. When unsigned char values are used for color, the alpha value must be explicitly included. The reason for this is to ensure that vertex color data lies on 4 byte boundaries for graphics performance.
Vertex normals may be entered as float values ranging from (-1.,1.) using VGL_NORMAL_3F or signed char values in the interval (-128,127) using VGL_NORMAL_4B. The 4th byte is unused but should be set to 0. The 4 byte format is utilized to ensure graphics performance. Vertex coordinates and texture coordinates are entered as float values.
Text functions are drawn using a raster font. The text drawing functions are vgl_DrawFunText and vgl_DrawFunTextDC.
All device interface modules treat graphics attributes and primitives procedurally. This means that once a particular graphics attribute is set, all subsequent graphics primitives use the current value of the graphics attribute. Color is treated as a special attribute in that its value may be set independently of any graphics primitive or supplied directly in the graphics primitive function call.
Raster text can be drawn either parallel to the display surface relative to a world coordinate anchor point (using bitmap technology internally) or oriented along a path lying in a specified plane (using texture map technology internally). Orientable raster fonts must be defined using the RasFont module. The current raster font orientation is specified using vgl_DrawFunTextPlane. The world coordinate size of a "raster" in an orientable raster font may be set using vgl_DrawFunTextPixelSize.
A user may define any number of raster fonts indexed by a positive integer. Raster font index 0 is the default, built-in raster font and may not be changed by the user. The RasFont module is used to define raster fonts. Use vgl_DrawFunRasFontDefine to associate a RasFont object with a raster font index. Once defined, a user defined raster font may be selected as the current raster font using vgl_DrawFunRasFontSelect. Generally the default raster font gives the best graphics performance. User defined fonts may be slower. Use vgl_DrawFunGetInteger to return information about the current font.
A user may define any number of bitmaps indexed by a positive integer. Bitmap index 0 is used to disable polygon stippling.
The Bitmap module is used to define bitmaps. Use vgl_DrawFunBitmapDefine to associate a Bitmap object with a bitmap index. Once defined, a user defined bitmap may be selected as the current bitmap using vgl_DrawFunBitmapSelect. Use vgl_DrawFunGetInteger to return information about the current bitmap.
Polygon stippling is also used to support transparency using a "screen door" technique. If the VGL_BLENDTRANSMODE is not enabled then polygon stippling is used to simulate transparency. In this case if a non zero bitmap index is selected, this bitmap stipple will override any stipple used for screen door transparency. Selecting a zero bitmap will reinstate any stipple used for transparency.
In VglTools, texture data and parameters are defined using a Texture object. A user may define any number of texture maps indexed by a positive integer. Texture map index 0 is used to disable texture mapping. The Texture module is used to define texture maps. Use vgl_DrawFunTextureDefine to associate a Texture object with a texture map index. Once defined, a user defined texture map may be selected as the current texture map using vgl_DrawFunTextureSelect. Use vgl_DrawFunGetInteger to return information about the current texture map.
While texture mapping may be theorically applied to all point, line and polygon primitives, the current release of VglTools supports texture mapping for polygons only. Vertex normals and texture coordinates may be specified in the argument list of the Polygon, PolygonColor and PolygonData drawing functions. If a texture mapping is enabled an no texture coordinates are specified, zero values are assumed for the texture coordinates.
The first method utilizes a Pixelmap object to store frame buffer or zbuffer information in a device dependent manner. It is optimized for reading and writing an entire buffer as quickly as possible with no alteration of the buffer contents. This is useful for creating and replaying animations of complex scenes. Use vgl_DrawFunPixelmapCreate and vgl_DrawFunPixelmapDestroy to allocate and free the memory required to save a pixelmap. Use vgl_DrawFunPixelmapRead and vgl_DrawFunPixelmapWrite to read/write the contents of a buffer to/from a Pixelmap object. Use vgl_PixelmapSetBuffer to set the buffer type (frame buffer or zbuffer) to be read/written.
The second method of reading and writing frame buffer pixels is device independent and utilizes a FBuffer object. In addition the ZBuffer object can be used to read and write z buffer information in a device independent manner. An FBuffer object can be used to store any selected rectangle of pixels in a frame buffer. Once stored in an FBuffer object the pixels can be written to any other VglTools supported device. FBuffer objects may also be written to disk files. This is useful for saving images or creating hardcopy of generated images. Use vgl_DrawFunFBufferRead and vgl_DrawFunFBufferWrite to read/write the contents of a frame buffer to/from an FBuffer object. Use FBuffer functions to transfer the frame buffer contents to disk, modify the image, etc. Use vgl_DrawFunZBufferRead and vgl_DrawFunZBufferWrite to read/write the contents of a z buffer to/from a ZBuffer object.
There are two possible formats in which hit records are recorded. By default A hit record consists of the current DataIndex attribute at the top of the index stack within the selection region. As an option, a hit record can consist of the number of indices in the index stack followed by the indices in the index stack. In either case the minimum and maximum depth coordinate of the primitive is recorded. The format of the hit record is determined by setting the VGL_SELECTSTACKMODE using vgl_DrawFunSetMode.
The number of hits may be returned using vgl_DrawFunSelectQuery. Once a hit is recorded for the current DataIndex attribute, no further hits are recorded unitl the DataIndex attribute is changed. In this way duplicative consecutive hits are not recorded for a given DataIndex.
The three types of selection regions use two different algorithms for determining if a given primitive hits the selection region. For rectangular regions, the primitive must intersect the rectangle. For polygonal and clipping plane regions, a vertex of the primitive must lie within the polygon or clipping planes.
vgl_DrawFunSetMode (drawfun,VGL_SHADERMODE,VGL_ON);
vgl_DrawFunSetMode (drawfun,VGL_ZBUFFEREDGEMODE,VGL_ON);
/* ensure that peel mode is off to start */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,VGL_OFF); vgl_DrawFunClear (drawfun);Render any opaque objects.
/* enable peel 1 */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,1);Render transparent objects.
/* enable peel 2 */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,2);Render transparent objects.
/* enable peel 3 */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,3);Render transparent objects.
/* enable last peel */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,VGL_DEPTHPEELLAST);Render transparent objects.
/* turn off peeling */ vgl_DrawFunSetMode (drawfun,VGL_DEPTHPEELMODE,VGL_OFF);Render any opaque objects.
vgl_DrawFunSwap (drawfun);
vgl_DrawFunSetMode (drawfun,VGL_OITMODE,VGL_ON);GPU memory for this feature must be allocated internally before rendering. The memory required in bytes is 4*3*number_pixels*layers. Where 4*3 bytes is the memory required to store a single fragment. The average depth is set using:
vgl_DrawFunSetMode (drawfun,VGL_OITLAYERS,layers);A GPU memory allocation failure may be queried as follows. A non-zero flag indicates a memory failure.
vgl_DrawFunGetInteger (drawfun,VGL_OIT_MEMORYFAIL,&flag);The count of the current number of fragments encountered and the maximum number of fragments which can be stored may be queried as follows, where icount[0] is the maximum count and icount[1] is the current count.
vgl_DrawFunGetInteger (drawfun,VGL_OIT_COUNTERS,icount);
vgl_DrawFunSetMode (drawfun,VGL_SSAOMODE,VGL_ON);
Two functions are used to poll the state of the mouse and selected keyboard keys: vgl_DrawFunPollMouse returns the current pixel location of the mouse and the state of all mouse buttons, vgl_DrawFunPollModifiers returns the current state of the keyboard Control and Shift keys.
Input devices and other window operations create entries in the event queue. Each entry consists of an event token and an associated event value. The functions vgl_DrawFunTestQueue, vgl_DrawFunReadQueue and vgl_DrawFunResetQueue are used to test for entries in the event queue, read events from the event queue and flush all events from the event queue. Events which are currently supported are mouse button events, keyboard events and exposure events. Dialbox motion events are also supported as an X-windows extension. By default VglTools will only recognize exposure events. Use vgl_DrawFunSetMode with VGL_EVENTQUEUEMODE enabled to recognize button and key events.
The style and location of the cursor are controlled by vgl_DrawFunSetCursor and vgl_DrawFunWarpMouse.
*vgl_DrawFunBegin - create an instance of a DrawFun object
vgl_DrawFun *vgl_DrawFunBegin ()
None
Destroy an instance of a DrawFun object using
void vgl_DrawFunEnd (vgl_DrawFun *drawfun)
Return the current value of a DrawFun object error flag using
Vint vgl_DrawFunError (vgl_DrawFun *drawfun)
Make a copy of a DrawFun object. The private data from the fromdrawfun object is copied to the drawfun object. Any previous private data in drawfun is lost.
void vgl_DrawFunCopy (vgl_DrawFun *drawfun,vgl_DrawFun *fromdrawfun)
vgl_DrawFunSet - set pointer to drawing function
void vgl_DrawFunSet (vgl_DrawFun *drawfun, Vint type, void (*function)())
drawfun Pointer to DrawFun object. type Function type being set =DRAWFUN_CLOSEWINDOW Set CloseWindow function =DRAWFUN_CONFIGUREWINDOW Set ConfigureWindow function =DRAWFUN_CONNECTWINDOW Set ConnectWindow function =DRAWFUN_DISCONNECTWINDOW Set DisconnectWindow function =DRAWFUN_OPENWINDOW Set OpenWindow function =DRAWFUN_PARENTWINDOW Set ParentWindow function =DRAWFUN_POSITIONWINDOW Set PositionWindow function =DRAWFUN_QUERYWINDOW Set QueryWindow function =DRAWFUN_SETWINDOW Set SetWindow function =DRAWFUN_VISUALWINDOW Set VisualWindow function =DRAWFUN_BACKCOLORINDEX Set BackColorIndex function =DRAWFUN_BACKCOLORRGB Set BackColor function =DRAWFUN_BUFFERSIZE Set BufferSize function =DRAWFUN_BELL Set Bell function =DRAWFUN_CLEAR Set Clear function =DRAWFUN_DELAY Set Delay function =DRAWFUN_FLUSH Set Flush function =DRAWFUN_RESIZE Set Resize function =DRAWFUN_RENDER Set Render function =DRAWFUN_SETMODE Set SetMode function =DRAWFUN_SETSWITCH Set SetSwitch function =DRAWFUN_SWAP Set Swap function =DRAWFUN_EXTENTQUERY Set ExtentQuery function =DRAWFUN_GETFLOAT Set GetFloat function =DRAWFUN_GETINTEGER Set GetInteger function =DRAWFUN_GETMODE Set GetMode function =DRAWFUN_GETSTRING Set GetString function =DRAWFUN_SELECTBUFFER Set SelectBuffer function =DRAWFUN_SELECTQUERY Set SelectQuery function =DRAWFUN_SELECTREGION Set SelectRegion function =DRAWFUN_CLIP Set Clip function =DRAWFUN_CLIPPLANE Set ClipPlane function =DRAWFUN_DEPTHRANGE Set DepthRange function =DRAWFUN_PROJFRUSTUM Set ProjFrustum function =DRAWFUN_PROJORTHO Set ProjOrtho function =DRAWFUN_PROJPOP Set ProjPop function =DRAWFUN_PROJPUSH Set ProjPush function =DRAWFUN_PROJLOAD Set ProjLoad function =DRAWFUN_VIEWPORT Set Viewport function =DRAWFUN_XFMLOAD Set XfmLoad function =DRAWFUN_XFMMULT Set XfmMult function =DRAWFUN_XFMPUSH Set XfmPush function =DRAWFUN_XFMPOP Set XfmPop function =DRAWFUN_LIGHT Set Light function =DRAWFUN_LIGHTMODEL Set LightModel function =DRAWFUN_BITMAPDEFINE Set BitmapDefine function =DRAWFUN_BITMAPSELECT Set BitmapSelect function =DRAWFUN_RASFONTDEFINE Set RasFontDefine function =DRAWFUN_RASFONTSELECT Set RasFontSelect function =DRAWFUN_TEXTUREDEFINE Set TextureDefine function =DRAWFUN_TEXTURESELECT Set TextureSelect function =DRAWFUN_ATTPOP Set AttPop function =DRAWFUN_ATTPUSH Set AttPush function =DRAWFUN_COLORINDEX Set ColorIndex function =DRAWFUN_COLORRGB Set Color function =DRAWFUN_DATA Set Data function =DRAWFUN_DATAINDEX Set DataIndex function =DRAWFUN_LINESTYLE Set LineStyle function =DRAWFUN_LINEWIDTH Set LineWidth function =DRAWFUN_POINTSIZE Set PointSize function =DRAWFUN_POINTSTYLE Set PointStyle function =DRAWFUN_POINTER Set Pointer function =DRAWFUN_POLYGONMODE Set PolygonMode function =DRAWFUN_POLYGONOFFSET Set PolygonOffset function =DRAWFUN_SPECULARITY Set Specularity function =DRAWFUN_TRANS Set Trans function =DRAWFUN_TRANSINDEX Set TransIndex function =DRAWFUN_INITBUFFER Set InitBuffer function =DRAWFUN_COPYBUFFER Set CopyBuffer function =DRAWFUN_TERMBUFFER Set TermBuffer function =DRAWFUN_POLYPOINT Set PolyPoint function =DRAWFUN_POLYPOINTARRAY Set PolyPointArray function =DRAWFUN_POLYPOINTBUFFER Set PolyPointBuffer function =DRAWFUN_POLYPOINTCOLOR Set PolyPointColor function =DRAWFUN_POLYPOINTDATA Set PolyPointData function =DRAWFUN_POLYPOINTDC Set PolyPointDC function =DRAWFUN_POLYLINE Set PolyLine function =DRAWFUN_POLYLINEARRAY Set PolyLineArray function =DRAWFUN_POLYLINEBUFFER Set PolyLineBuffer function =DRAWFUN_POLYLINECOLOR Set PolyLineColor function =DRAWFUN_POLYLINEDATA Set PolyLineData function =DRAWFUN_POLYLINEDC Set PolyLineDC function =DRAWFUN_POLYGON Set Polygon function =DRAWFUN_POLYGONARRAY Set PolygonArray function =DRAWFUN_POLYGONBUFFER Set PolygonBuffer function =DRAWFUN_POLYGONCOLOR Set PolygonColor function =DRAWFUN_POLYGONDATA Set PolygonData function =DRAWFUN_POLYGONDC Set PolygonDC function =DRAWFUN_POLYARRAY Set PolyArray function =DRAWFUN_POLYBUFFER Set PolyBuffer function =DRAWFUN_POLYELEMARRAY Set PolyElemArray function =DRAWFUN_POLYELEMBUFFER Set PolyElemBuffer function =DRAWFUN_TEXT Set Text function =DRAWFUN_TEXTDC Set TextDC function =DRAWFUN_TEXTPIXELSIZE Set TextPixelSize function =DRAWFUN_TEXTPLANE Set TextPlane function =DRAWFUN_FBUFFERREAD Set FBufferRead function =DRAWFUN_FBUFFERWRITE Set FBufferWrite function =DRAWFUN_ZBUFFERREAD Set ZBufferRead function =DRAWFUN_ZBUFFERWRITE Set ZBufferWrite function =DRAWFUN_PIXELMAPCREATE Set PixelmapCreate function =DRAWFUN_PIXELMAPDESTROY Set PixelmapDestroy function =DRAWFUN_PIXELMAPREAD Set PixelmapRead function =DRAWFUN_PIXELMAPWRITE Set PixelmapWrite function =DRAWFUN_POLLMOUSE Set PollMouse function =DRAWFUN_POLLMODIFIERS Set PollModifiers function =DRAWFUN_WARPMOUSE Set WarpMouse function =DRAWFUN_SETCURSOR Set SetCursor function =DRAWFUN_READQUEUE Set ReadQueue function =DRAWFUN_TESTQUEUE Set TestQueue function =DRAWFUN_RESETQUEUE Set ResetQueue function function Pointer to drawing function
None
Get function as an output argument using
void vgl_DrawFunGet (vgl_DrawFun *drawfun, Vint type, void (**function)())
vgl_DrawFunSetObj - set pointer to auxiliary object
void vgl_DrawFunSetObj (vgl_DrawFun *drawfun, Vobject *obj)
drawfun Pointer to DrawFun object. obj Pointer to auxiliary object
None
Get obj as an output argument using
void vgl_DrawFunGetObj (vgl_DrawFun *drawfun, Vobject **obj)
vgl_DrawFunAPI - set built-in drawing functions
void vgl_DrawFunAPI (vgl_DrawFun *drawfun, Vint api)
drawfun Pointer to DrawFun object. api Type of built-in drawing function to return. =DRAWFUN_APIPRINT Set printing drawing functions =DRAWFUN_APIRETURN Set return drawing functions
None
vgl_DrawFunAttPop,vgl_DrawFunAttPush - pop and push graphics attribute stack
void vgl_DrawFunAttPop (vgl_DrawFun *drawfun) void vgl_DrawFunAttPush (vgl_DrawFun *drawfun, Vint mask)
drawfun Pointer to DrawFun object. mask A mask which indicates which graphics attributes to push. The mask is constructed by ORing one or more of the following. =VGL_COLORATT Push color, transparency =VGL_POINTATT Push point size =VGL_LINEATT Push line width and line style =VGL_POLYGONATT Push specularity =VGL_VIEWPORTATT Push viewport, depth range
None
vgl_DrawFunBackColor,vgl_DrawFunBackColorIndex - set background or clear color
void vgl_DrawFunBackColor (vgl_DrawFun *drawfun, Vfloat c[3]) Vfloat c[3]) void vgl_DrawFunBackColorIndex (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. c Current background color RGB values index Current background color index
None
vgl_DrawFunBell - ring bell
void vgl_DrawFunBell (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunClear - clear frame buffer to background color
void vgl_DrawFunClear (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunBitmapDefine - define a bitmap index
void vgl_DrawFunBitmapDefine (vgl_DrawFun *drawfun, Vint index, vgl_Bitmap *bitmap)
drawfun Pointer to DrawFun object. index Bitmap index, 1 <= index bitmap Pointer to Bitmap object.
None
vgl_DrawFunBitmapSelect - select current bitmap
void vgl_DrawFunBitmapSelect (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. index Bitmap index, 0 <= index
None
vgl_DrawFunBufferSize - specify color buffer size
void vgl_DrawFunBufferSize (vgl_DrawFun *drawfun, Vint xsize, Vint ysize)
drawfun Pointer to DrawFun object. xsize Horizontal size of off-screen color buffer ysize Vertical size of off-screen color buffer
None
vgl_DrawFunClip - define clipping rectangle
void vgl_DrawFunClip (vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top)
drawfun Pointer to DrawFun object. left Left device coordinate limit of clipping rectangle right Right device coordinate limit of clipping rectangle bottom Bottom device coordinate limit of clipping rectangle top Top device coordinate limit of clipping rectangle
None
vgl_DrawFunCloseWindow - close a graphics window or file
void vgl_DrawFunCloseWindow (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunClipPlane - define clipping plane
void vgl_DrawFunClipPlane (vgl_DrawFun *drawfun, Vint index, Vfloat equation[4])
drawfun Pointer to DrawFun object. index Clipping plane index, 0 <= index <= 5; equation Coefficients A,B,C,D of equation of clipping plane
None
vgl_DrawFunColor,vgl_DrawFunColorIndex - set current color
void vgl_DrawFunColor (vgl_DrawFun *drawfun, Vfloat c[3]) void vgl_DrawFunColorIndex (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. c Current color RGB values index Current color index
None
vgl_DrawFunConfigureWindow - configure window size and position
void vgl_DrawFunConfigureWindow (vgl_DrawFun *drawfun, Vint oper, Vint params[])
drawfun Pointer to DrawFun object. oper Window configuration operation. The information expected in params depends upon the operation. =VGL_WINDOWLOWER Lower the window =VGL_WINDOWORIGIN Specify the window origin =VGL_WINDOWORIGINSIZE Specify the window origin and size =VGL_WINDOWRAISE Raise the window =VGL_WINDOWSIZE Specify the window size =VGL_WINDOWSTATEINIT Inherit the window graphics state =VGL_WINDOWSTATETERM Restore the window graphics state params Configuration parameters
None
If this function is called before a window is opened, then the requested origin and/or size are enforced when the window is opened. If this function is called after a window is opened, then the specified window configuration is enforced immediately.
The VGL_WINDOWORIGIN operation requires the horizontal and vertical origin of the window in pixels measured from the lower left corner of the screen or parent window. The VGL_WINDOWORIGINSIZE operation requires the horizontal and vertical origin and size of the window in pixels. The VGL_WINDOWSIZE operation just requires the horizontal and vertical size of the window in pixels. By default the location of the lower left hand corner of the window is (100,100) and the size is (400,300).
The VGL_WINDOWSTATEINIT operation forces the device object (for example, OpenGLDev) to inherit the window graphics state. Use VGL_WINDOWSTATETERM to return the window graphics state to the same condition it was upon VGL_WINDOWSTATEINIT. The params argument is unused and may be set to NULL. This function is necessary for embedded graphics applications which must share the graphics state with another application. This function should be called just before drawing to the device object.
vgl_DrawFunConnectWindow - connect to existing graphics window
void vgl_DrawFunConnectWindow (vgl_DrawFun *drawfun, Vword window)
drawfun Pointer to DrawFun object. window Window id or Pixmap if X window. Window HWND or device context HDC if Microsoft Windows
None
By default the window is a Window id in X Windows and a HWND window in Microsoft Windows. If VGL_VISUAL_USECONTEXT is set using vgl_DrawFunVisualWindow, then window is ignored.
vgl_DrawFunDataIndex - load index values
void vgl_DrawFunDataIndex (vgl_DrawFun *drawfun, Vint nprims, Vint nrows, Vint *index)
drawfun Pointer to DrawFun object. nprims Number of primitives nrows Number of rows in data index vector per primitive index Current index values
None
vgl_DrawFunData - set current data
void vgl_DrawFunData (vgl_DrawFun *drawfun, Vint nrws, Vfloat d[])
drawfun Pointer to DrawFun object. nrws Number of values in d vector d Vector of data values
None
vgl_DrawFunDelay - delay for a specified time
void vgl_DrawFunDelay (vgl_DrawFun *drawfun, Vfloat seconds)
drawfun Pointer to DrawFun object. seconds Number of seconds to delay
None
vgl_DrawFunDepthRange - define depth range viewport transformation
void vgl_DrawFunDepthRange (vgl_DrawFun *drawfun, Vfloat znear, Vfloat zfar)
drawfun Pointer to DrawFun object. znear,zfar Normalized coordinates of near and far planes of viewing volume
None
vgl_DrawFunDisconnectWindow - disconnect from existing graphics window or file
void vgl_DrawFunDisconnectWindow (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunExtentQuery - query for current extent box
void vgl_DrawFunExtentQuery(vgl_DrawFun *drawfun, Vfloat *left, Vfloat *right, Vfloat *bottom, Vfloat *top, Vfloat *znear, Vfloat *zfar)
drawfun Pointer to DrawFun object.
left,right Coordinates of left and right extent limits. bottom,top Coordinates of bottom and top extent limits. znear,zfar Depth coordinates of near and far extent limits.
If world coordinates are returned then left and right are the minimum and maximum x coordinate, bottom and top are the minimum and maximum y coordinate and znear and zfar are the minimum and maximum z coordinate.
vgl_DrawFunFBufferRead,vgl_DrawFunFBufferWrite - read and write frame buffer
void vgl_DrawFunFBufferRead(vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top, vgl_FBuffer *fbuffer) void vgl_DrawFunFBufferWrite(vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top, vgl_FBuffer *fbuffer)
drawfun Pointer to DrawFun object. left,right Pixel coordinates of left and right limits of rectangle bottom,top Pixel coordinates of bottom and top limits of rectangle fbuffer Pointer to FBuffer object to read into or write from.
None
The current frame buffers for reading and writing (drawing) are determined by the VGL_FRONTBUFFERREADMODE and VGL_FRONTBUFFERDRAWMODE modes specified with the vgl_DrawFunSetMode function.
The reading and writing operations supported by these functions are relatively slow compared to the functions which operate on Pixelmap objects. Use Pixelmap objects to maximize performance when entire an frame buffer and/or zbuffer are to be simply written to and read from buffer memory.
vgl_DrawFunFlush - flush all pending graphics operations
void vgl_DrawFunFlush (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunGetFloat - return the value of a selected floating point parameter
void vgl_DrawFunGetFloat (vgl_DrawFun *drawfun, Vint type, Vfloat params[])
drawfun Pointer to DrawFun object. type Specify the type of parameter to return =VGL_BACKCOLOR Return 3 RGB components of current back ground color. =VGL_COLOR Return 3 RGB components of current color. =VGL_DEPTHRANGE Return 2 values which are the current near and far settings of the depth range. =VGL_MAXDEPTHRANGE Return 2 values which are the maximum allowable near and far limits of the depth range =VGL_MAXWINDOWCENTIMETERS Return 2 values which are the horizontal and vertical sizes of display screen in centimeters =VGL_MODELVIEWMATRIX Return 16 values which are the elements of the current modelview matrix =VGL_POLYGONOFFSET Return 2 values which are the arguments input to PolygonOffset =VGL_PROJECTIONLIMITS Return 6 values which are the arguments input to either ProjOrtho or ProjFrustum =VGL_PROJECTIONMATRIX Return 16 values which are the elements of the current projection matrix =VGL_SECONDS Return current processor time used by current process in seconds. =VGL_SPECULARITY Return 2 values which are the current material specularity and shininess. =VGL_TRANS Return 1 value which is the current material transparency. =VGL_WINDOWCENTIMETERS Return 2 values which are the horizontal and vertical sizes of the current graphics window in centimeters
params Pointer to floating point return values
vgl_DrawFunGetInteger - return the value of a selected integer parameter
void vgl_DrawFunGetInteger (dvgl_DrawFun *drawfun, Vint type, Vint params[])
drawfun Pointer to DrawFun object. type Specify the type of parameter to return =VGL_BACKCOLORINDEX Return 1 value which is the current back ground color index. =VGL_BITMAPINDEX Return 1 value which is the current bitmap index =VGL_BITMAPNUMBER Return 1 value which is the number of defined bitmaps. =VGL_BITMAPINDICES Return values of all defined bitmap indices =VGL_BUFFER_SUPPORTED Return 1 if Buffer primitives supported =VGL_COLORINDEX Return 1 value which is the current color index. =VGL_DEPTHPEEL_PIXELS Return number of pixels touched by last depth peel. =VGL_DEVICESIZE Return 2 values which are the horizontal and vertical sizes of the device driver in pixels. This value may differ from the window size. =VGL_DOUBLEBUFFER Return 1 boolean value which indicates whether the frame buffer supports double buffering =VGL_LINESTYLE Return 1 value which is the current line style. =VGL_LINEWIDTH Return 1 value which is the current line width. =VGL_MAXWINDOWSIZE Return 2 values which are the horizontal and vertical sizes of display screen in pixels =VGL_MULTISAMPLE_SUPPORTED Return 1 if multisample supported =VGL_NUMRASTERPRIM Return 1 value which is the number of rasterized primitives =VGL_NUMVECTORPRIM Return 1 value which is the number of vector primitives =VGL_OIT_COUNTERS Return 2 values which are the maximum and current fragment counts. =VGL_OIT_MEMORYFAIL Return 1 value which is a flag indicating GPU memory failure =VGL_PLANEDEPTH Return 1 value which is the number of planes in the frame buffer. =VGL_POINTSIZE Return 1 value which is the current point size. =VGL_POINTSTYLE Return 1 value which is the current point style. =VGL_POLYGONMODE Return 1 value which is the argument input to PolygonMode =VGL_PROJECTIONTYPE Return 1 value which is the current projection type. The value is zero (VGL_PROJORTHO) if the projection is orthographic and unity (VGL_PROJFRUSTUM) if the projection is perspective. =VGL_RASFONTINDEX Return 1 value which is the current raster font index =VGL_RASFONTNUMBER Return 1 value which is the number of defined raster fonts. =VGL_RASFONTINDICES Return values of all defined raster font indices =VGL_RASFONT_METRICS Return 4 values which are the current raster font width, height, offset and base. =VGL_RASFONT_SIZE Return 1 value which is the current raster font size. =VGL_RASFONT_SPACING Return 1 value which is the current raster font spacing. =VGL_RENDERMODE Return 1 value which is the current rendermode set by the Render drawing function. =VGL_SHADER_SUPPORTED Return 1 if shader supported. =VGL_TEXTUREINDEX Return 1 value which is the current texture map index =VGL_TEXTURENUMBER Return 1 value which is the number of defined texture maps =VGL_TEXTUREINDICES Return values of all defined texture map indices =VGL_TRANSINDEX Return 1 value which is the current transparency index. =VGL_TRUECOLOR Return 1 boolean value which indicates whether the frame buffer supports a true color visual =VGL_VIEWPORT Return 4 values which are the limits of the current viewport in pixels. =VGL_WINDOWSIZE Return 2 values which are the horizontal and vertical sizes of the current graphics window in pixels =VGL_WINDOWORIGIN Return 2 values which are the horizontal and vertical position of the current graphics window in pixels in screen coordinates =VGL_WINDOWSYSTEM Return 1 boolean value which indicates whether the frame buffer is associated with a graphics window. =VGL_ZBUFFERDEPTH Return 1 value which is the number of planes in the z buffer.
params Pointer to integer return values
vgl_DrawFunGetString - return the value of a selected string parameter
void vgl_DrawFunGetString (vgl_DrawFun *drawfun, Vint type, Vchar params[])
drawfun Pointer to DrawFun object. type Specify the type of parameter to return =VGL_RENDERER Return renderer string. This is a parameter which is normally specific to a hardware platform. =VGL_VENDOR Return vendor string. This is the company responsible for the underlying graphics interface. =VGL_VERSION Return version string of underlying graphics interface. =VGL_SHADER VERSION Return version string of underlying shader language.
params Pointer to character buffer into which to copy a string. Reserve at least a 128 character buffer including terminating NULL character.
vgl_DrawFunLight - define a light source
void vgl_DrawFunLight (vgl_DrawFun *drawfun, Vint index, Vint type, Vfloat c[3], Vfloat x[3])
drawfun Pointer to DrawFun object. index Light source index, 0 <= index <= 7; type Light source type =VGL_LIGHT_AMBIENT Ambient light =VGL_LIGHT_DISTANT Distant light c Light color RGB values x World coordinate position of light source
None
vgl_DrawFunLightModel - define global lighting model parameters
void vgl_DrawFunLightModel (vgl_DrawFun *drawfun, Vint localviewer, Vfloat koffset, Vfloat krate)
drawfun Pointer to DrawFun object. localviewer Local viewer flag =VGL_OFF Turn localviewer off =VGL_ON Turn localviewer on koffset Light attenuation offset krate Light attenuation rate
None
vgl_DrawFunLineStyle,vgl_DrawFunLineWidth - set line drawing attributes
void vgl_DrawFunLineStyle (vgl_DrawFun *drawfun, Vint linestyle) void vgl_DrawFunLineWidth (vgl_DrawFun *drawfun, Vint linewidth)
drawfun Pointer to DrawFun object. linestyle Current line style =VGL_LINESTYLE_SOLID Solid =VGL_LINESTYLE_DOT Dotted =VGL_LINESTYLE_DASH Dashed =VGL_LINESTYLE_DOTDASH Dot dash =VGL_LINESTYLE_LDASH Long dash =VGL_LINESTYLE_DOTLDASH Dot long dash =VGL_LINESTYLE_DOTDOT Dot dot =VGL_LINESTYLE_DOTDOTLDASH Dot dot long dash =VGL_LINESTYLE_LLDASH Long long dash linewidth Current line width, 1 <= linewidth
None
VGL_LINESTYLE_DOT xx xx xx xx VGL_LINESTYLE_DASH xxxx xxxx xxxx xxxx VGL_LINESTYLE_DOTDASH xxxx xx xxxx xx VGL_LINESTYLE_LDASH xxxxxx xxxxxx xxxxxx xxxxxx VGL_LINESTYLE_DOTLDASH xxxxxx xx xxxxxx xx VGL_LINESTYLE_DOTDOT xx xx xx xx xx xx xx xx VGL_LINESTYLE_DOTDOTLDASH xxxxxx xx xx xxxxxx xx xx VGL_LINESTYLE_LLDASH xxxxxxxxxxxx xxxxxxxxxxxx
vgl_DrawFunOpenWindow - open a graphics window or file
void vgl_DrawFunOpenWindow (vgl_DrawFun *drawfun, const Vchar title[])
drawfun Pointer to DrawFun object. title Graphics window title or host file name
None
vgl_DrawFunParentWindow - specify parent window
void vgl_DrawFunParentWindow (vgl_DrawFun *drawfun, Vword parent)
drawfun Pointer to DrawFun object. parent Window id of parent window, if X window. Window handle of parent window, if Microsoft Windows window.
None
vgl_DrawFunPositionWindow - initial window size and position
void vgl_DrawFunPositionWindow (vgl_DrawFun *drawfun, Vint xorig, Vint yorig, Vint xsize, Vint ysize)
drawfun Pointer to DrawFun object. xorig Horizontal origin of window yorig Vertical origin of window xsize Horizontal size of window ysize Vertical size of window
None
vgl_DrawFunPixelmapCreate,vgl_DrawFunPixelmapDestroy - begin and end a Pixelmap
void vgl_DrawFunPixelmapCreate (vgl_DrawFun *drawfun, vgl_Pixelmap *pixelmap) void vgl_DrawFunPixelmapDestroy (vgl_DrawFun *drawfun, vgl_Pixelmap *pixelmap)
drawfun Pointer to DrawFun object. pixelmap Pointer to Pixelmap object.
None
vgl_DrawFunPixelmapRead,vgl_DrawFunPixelmapWrite - read and write to Pixelmap
void vgl_DrawFunPixelmapRead (vgl_DrawFun *drawfun, vgl_Pixelmap *pixelmap) vgl_Pixelmap *pixelmap) void vgl_DrawFunPixelmapWrite (vgl_DrawFun *drawfun, vgl_Pixelmap *pixelmap)
drawfun Pointer to DrawFun object. pixelmap Pointer to Pixelmap object.
None
The current front or back device buffers for reading and writing (drawing) are determined by the VGL_FRONTBUFFERREADMODE and VGL_FRONTBUFFERDRAWMODE modes specified with the vgl_DrawFunSetMode function.
vgl_DrawFunPointSize - set point size
void vgl_DrawFunPointSize (vgl_DrawFun *drawfun, Vint pointsize)
drawfun Pointer to DrawFun object. pointsize Current point size, 1 <= pointsize <= 8
None
vgl_DrawFunPointStyle - set point style
void vgl_DrawFunPointStyle (vgl_DrawFun *drawfun, Vint pointstyle)
drawfun Pointer to DrawFun object. pointstyle Current point style. =VGL_POINTSTYLE_DOT Square dot =VGL_POINTSTYLE_CIRCLE Device sized filled circle =VGL_POINTSTYLE_SPHERE Device sized sphere =VGL_POINTSTYLE_SPHEREWORLD World sized sphere =VGL_POINTSTYLE_UINT Unsigned int center register =VGL_POINTSTYLE_UINTLL Unsigned int lower left register =VGL_POINTSTYLE_PLUS9 Plus =VGL_POINTSTYLE_ASTERISK9 Asterisk =VGL_POINTSTYLE_CROSS9 Cross =VGL_POINTSTYLE_BOX9 Box =VGL_POINTSTYLE_CROSSBOX9 CrossBox =VGL_POINTSTYLE_CIRCLE9 Circle =VGL_POINTSTYLE_TRIUP9 Upward Triangle =VGL_POINTSTYLE_TRIRIGHT9 Rightward Triangle =VGL_POINTSTYLE_TRIDOWN9 Downward Triangle =VGL_POINTSTYLE_TRILEFT9 Leftward Triangle =VGL_POINTSTYLE_DIAMOND9 Diamond =VGL_POINTSTYLE_TBOXBITS9 T Box with bits =VGL_POINTSTYLE_TDIAMONDBITS9 T Diamond with bits =VGL_POINTSTYLE_CROSSCIRCLE9 Crossed Circle =VGL_POINTSTYLE_PLUSCIRCLE9 Plussed Circle
None
The VGL_POINTSTYLE_DOT style draws a device sized square reqion of pixels The width and height of the square in pixels is set by the current point size set by vgl_DrawFunPointSize.
The VGL_POINTSTYLE_CIRCLE style draws a device sized filled circle The diameter of the circle in pixels is set by the current point size set by vgl_DrawFunPointSize.
The VGL_POINTSTYLE_SPHERE style draws a device sized sphere. The diameter of the sphere in pixels is set by the current point size set by vgl_DrawFunPointSize.
The VGL_POINTSTYLE_SPHEREWORLD style draws a world sized sphere. The diameter of the sphere is set using the function vgl_DrawFunSetFactors with type VGL_WORLDSIZE.
The VGL_POINTSTYLE_UINT and VGL_POINTSTYLE_UINTLL styles draw unsigned integers. The unsigned integers are installed in the vertex data vectors in vgl_DrawFunPolyPointArray and vgl_DrawFunPolyPointBuffer. The size is constant.
The VGL_POINTSTYLE_PLUS9 through VGL_POINTSTYLE_PLUSCIRCLE9 styles draw 9 by 9 pixel bitmaps. The size is constant.
vgl_DrawFunInitBuffer - create a vertex buffer
void vgl_DrawFunInitBuffer (vgl_DrawFun *drawfun, Vint size, Vint *vboid)
drawfun Pointer to DrawFun object. size Size of vertex buffer in bytes.
vboid Vertex buffer identifier
vgl_DrawFunTermBuffer - delete a vertex buffer
void vgl_DrawFunTermBuffer (vgl_DrawFun *drawfun, Vint vboid)
drawfun Pointer to DrawFun object. vboid Vertex buffer identifier
None
vgl_DrawFunCopyBuffer - copy vertex data to a vertex buffer
void vgl_DrawFunCopyBuffer (vgl_DrawFun *drawfun, Vint vboid, Vint npts, Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d, Vint *offset)
drawfun Pointer to DrawFun object. vboid Vertex buffer identifier npts Number of vertex points x Vertex world coordinates cflag Vertex color flag =0 No color =VGL_COLOR_4B RGBA unsigned char =VGL_COLOR_3F RGB float =VGL_COLOR_4F RGBA float c Vertex colors vflag Vertex normal flag =0 No normals =VGL_NORMAL_4B signed char =VGL_NORMAL_3F float v Vertex normals tflag Vertex texture coordinate flag =0 No texture coordinates =VGL_1DTEXTURE 1-component texture =VGL_2DTEXTURE 2-component texture t Vertex texture coordinates dflag Vertex data flag, number of data components per vertex d Vertex data
offset Offset into vertex buffer
vgl_DrawFunPolygon,vgl_DrawFunPolygonColor - draw polygons
void vgl_DrawFunPolygon (vgl_DrawFun *drawfun, Vint polygontype, Vint npts, Vfloat x[][3], Vint vflag, Vfloat v[]) void vgl_DrawFunPolygonColor (vgl_DrawFun *drawfun, Vint polygontype, Vint npts, Vfloat x[][3], Vfloat c[][3], Vint vflag, Vfloat v[])
drawfun Pointer to DrawFun object. polygontype Type of polygon to draw =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertices in polygon primitive x Vertex world coordinates c Vertex color RGB values vflag Normal vector and vertex texture coordinate flag. OR the following flags. A zero means no normals or texture coordinates are present. =VGL_NOSHADE No normals present =VGL_FLATSHADE Normals per tri, quad or poly =VGL_VERTEXSHADE Normals per vertex =VGL_1DTEXTURE 1 texture coordinate per vertex =VGL_2DTEXTURE 2 texture coordinates per vertex v Normal vectors and texture coordinates. Normal vectors for each facet or vertex appear first followed by texture coordinates for each vertex.
None
If no normals are present and lighting is enabled, the normals used for lighting effects are undefined. Lighting should be diabled in this case.
If texture coordinates are specified then 1 or 2 texture coordinates are required for each vertex. If no texture coordinates are specified while texture mapping is enabled, zeros are assumed.
vgl_DrawFunPolyPointArray,vgl_DrawFunPolyLineArray,vgl_DrawFunPolygonArray,vgl_DrawFunPolyArray - draw arrays of primitives
void vgl_DrawFunPolyPointArray (vgl_DrawFun *drawfun, Vint npts, Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d) void vgl_DrawFunPolyLineArray (vgl_DrawFun *drawfun, Vint polylinetype, Vint npts, Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d) void vgl_DrawFunPolygonArray (vgl_DrawFun *drawfun, Vint polygontype, Vint npts, Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d) void vgl_DrawFunPolyArray (vgl_DrawFun *drawfun, Vint polytype, Vint npts, Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d)
drawfun Pointer to DrawFun object. polytype Type of primitive to draw =VGL_POINTS Draw a series of points =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertex points x Vertex world coordinates cflag Vertex color flag =0 No color =VGL_COLOR_4B RGBA unsigned char =VGL_COLOR_3F RGB float =VGL_COLOR_4F RGBA float c Vertex colors vflag Vertex normal flag =0 No normals =VGL_NORMAL_4B signed char =VGL_NORMAL_3F float v Vertex normals tflag Vertex texture coordinate flag =0 No texture coordinates =VGL_1DTEXTURE 1-component texture =VGL_2DTEXTURE 2-component texture t Vertex texture coordinates dflag Vertex data flag, number of data components per vertex d Vertex data
None
vgl_DrawFunPolyPointBuffer,vgl_DrawFunPolyLineBuffer,vgl_DrawFunPolygonBuffer,vgl_DrawFunPolyBuffer - draw vertex buffers of primitives
void vgl_DrawFunPolyPointBuffer (vgl_DrawFun *drawfun, Vint vboid, Vint offset, Vint npts, Vint cflag, Vint vflag, Vint tflag, Vint dflag) void vgl_DrawFunPolyLineBuffer (vgl_DrawFun *drawfun, Vint vboid, Vint offset, Vint polylinetype, Vint npts, Vint cflag, Vint vflag, Vint tflag, Vint dflag) void vgl_DrawFunPolygonBuffer (vgl_DrawFun *drawfun, Vint vboid, Vint offset, Vint polygontype, Vint npts, Vint cflag, Vint vflag, Vint tflag, Vint dflag) void vgl_DrawFunPolyBuffer (vgl_DrawFun *drawfun, Vint vboid, Vint offset, Vint polytype, Vint npts, Vint cflag, Vint vflag, Vint tflag, Vint dflag)
drawfun Pointer to DrawFun object. vboid Vertex buffer identifier offset Offset into vertex buffer polytype Type of primitive to draw =VGL_POINTS Draw a series of points =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertex points cflag Vertex color flag =0 No color =VGL_COLOR_4B RGBA unsigned char =VGL_COLOR_3F RGB float =VGL_COLOR_4F RGBA float vflag Vertex normal flag =0 No normals =VGL_NORMAL_4B signed char =VGL_NORMAL_3F float tflag Vertex texture coordinate flag =0 No texture coordinates =VGL_1DTEXTURE 1-component texture =VGL_2DTEXTURE 2-component texture dflag Vertex data flag, number of data components per vertex
None
vgl_DrawFunPolyElemArray - draw indexed arrays of primitives
void vgl_DrawFunPolyElemArray (vgl_DrawFun *drawfun, Vint polytype, Vint npts, Vuint ix[], Vfloat x[][3], Vint cflag, void *c, Vint vflag, void *v, Vint tflag, Vfloat *t, Vint dflag, Vfloat *d)
drawfun Pointer to DrawFun object. polytype Type of primitive to draw =VGL_POINTS Draw a series of points =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertex points ix Primitive vertex npts indices x Vertex world coordinates cflag Vertex color flag =0 No color =VGL_COLOR_4B RGBA unsigned char =VGL_COLOR_3F RGB float =VGL_COLOR_4F RGBA float c Vertex colors vflag Vertex normal flag =0 No normals =VGL_NORMAL_4B signed char =VGL_NORMAL_3F float v Vertex normals tflag Vertex texture coordinate flag =0 No texture coordinates =VGL_1DTEXTURE 1-component texture =VGL_2DTEXTURE 2-component texture t Vertex texture coordinates dflag Vertex data flag, number of data components per vertex d Vertex data
None
vgl_DrawFunPolyElemBuffer - draw indexed vertex buffers of primitives
void vgl_DrawFunPolyElemBuffer (vgl_DrawFun *drawfun, Vint elemvboid, Vint elemoffset, Vint vboid, Vint offset, Vint polytype, Vint npts, Vint cflag, Vint vflag, Vint tflag, Vint dflag)
drawfun Pointer to DrawFun object. elemvboid Index Vertex buffer identifier elemoffset Offset into index vertex buffer vboid Vertex buffer identifier offset Offset into vertex buffer polytype Type of primitive to draw =VGL_POINTS Draw a series of points =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertex points cflag Vertex color flag =0 No color =VGL_COLOR_4B RGBA unsigned char =VGL_COLOR_3F RGB float =VGL_COLOR_4F RGBA float vflag Vertex normal flag =0 No normals =VGL_NORMAL_4B signed char =VGL_NORMAL_3F float tflag Vertex texture coordinate flag =0 No texture coordinates =VGL_1DTEXTURE 1-component texture =VGL_2DTEXTURE 2-component texture dflag Vertex data flag, number of data components per vertex
None
vgl_DrawFunPolygonData - draw a data polygon
void vgl_DrawFunPolygonData (vgl_DrawFun *drawfun, Vint polygontype, Vint npts, Vfloat x[][3], Vint nrws, Vfloat d[], Vint vflag, Vfloat v[])
drawfun Pointer to DrawFun object. polygontype Type of polygon to draw =VGL_POLYGON Draw a single polygon =VGL_POLYHEDRON Draw a single polyhedron =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertices in polygon primitive x Vertex world coordinates nrws Number of values in d vector d Vector of data values vflag Normal vector and vertex texture coordinate flag. OR the following flags. A zero means no normals or texture coordinates are present. =VGL_NOSHADE No normals present =VGL_FLATSHADE Normals per tri, quad or poly =VGL_VERTEXSHADE Normals per vertex =VGL_1DTEXTURE 1 texture coordinate per vertex =VGL_2DTEXTURE 2 texture coordinates per vertex v Normal vectors and texture coordinates. Normal vectors for each facet or vertex appear first followed by texture coordinates for each vertex.
None
If flat shading is used with a polyhedron a single normal is required. If no normals are present and lighting is enabled, the normals used for lighting effects are undefined. Lighting should be diabled in this case.
If texture coordinates are specified then 1 or 2 texture coordinates are required for each vertex. If no texture coordinates are specified while texture mapping is enabled, zeros are assumed.
vgl_DrawFunPolygonDC - draw a device oriented polygon
void vgl_DrawFunPolygonDC (vgl_DrawFun *drawfun, Vint polygontype, Vint npts, Vfloat x[3], Vint dc[][3])
drawfun Pointer to DrawFun object. polygontype Type of polygon to draw =VGL_POLYGON Draw a single polygon =VGL_QUADS Draw a set of quadrilaterals =VGL_TRIANGLES Draw a set of triangles =VGL_TRISTRIP Draw a triangle strip =VGL_TRIFAN Draw a triangle fan npts Number of vertices in polygon primitive x World coordinate anchor point dc Vertex device coordinate offsets
None
vgl_DrawFunPolygonMode - specify polygon drawing mode
void vgl_DrawFunPolygonMode (vgl_DrawFun *drawfun, Vint rend)
drawfun Pointer to DrawFun object. rend Number of dimensions to reduce polygon rendering =0 Draw filled polygons =1 Draw polygons as lines =2 Draw polygons as points at vertices =3 Do not draw polygons
None
vgl_DrawFunPolygonOffset - specify polygon depth adjustment
void vgl_DrawFunPolygonOffset (vgl_DrawFun *drawfun, Vfloat factor, Vfloat units)
drawfun Pointer to DrawFun object. factor Polygon depth slope factor. units Polygon depth constant offset
None
vgl_DrawFunPolyLine,vgl_DrawFunPolyLineColor - draw polylines
void vgl_DrawFunPolyLine (vgl_DrawFun *drawfun, Vint polylinetype, Vint npts, Vfloat x[][3]) void vgl_DrawFunPolyLineColor (vgl_DrawFun *drawfun, Vint polylinetype, Vint npts, Vfloat x[][3], Vfloat c[][3])
drawfun Pointer to DrawFun object. polylinetype Type of polyline to draw =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines npts Number of vertices in polyline primitive x Vertex world coordinates c Vertex color RGB values
None
vgl_DrawFunPolyLineData - draw a data polyline
void vgl_DrawFunPolyLineData (vgl_DrawFun *drawfun, Vint polylinetype, Vint npts, Vfloat x[][3], Vint nrws, Vfloat d[])
drawfun Pointer to DrawFun object. polylinetype Type of polyline to draw =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines npts Number of vertices in polyline primitive x Vertex world coordinates nrws Number of values in d vector d Vector of data values
None
vgl_DrawFunPolyLineDC - draw a device oriented polyline
void vgl_DrawFunPolyLineDC (vgl_DrawFun *drawfun, Vint polylinetype, Vint npts, Vfloat x[3], Vint dc[][3])
drawfun Pointer to DrawFun object. polylinetype Type of polyline to draw =VGL_LINESTRIP Draw a series of line segments =VGL_LINELOOP Draw a close loop of line segments =VGL_LINES Draw a set of unconnected lines npts Number of vertices in polyline primitive x World coordinate anchor point dc Vertex device coordinate offsets
None
vgl_DrawFunPolyPoint,vgl_DrawFunPolyPointColor - draw points
void vgl_DrawFunPolyPoint (vgl_DrawFun *drawfun, Vint npts, Vfloat x[][3]) void vgl_DrawFunPolyPointColor (vgl_DrawFun *drawfun, Vint npts, Vfloat x[][3], Vfloat c[][3])
drawfun Pointer to DrawFun object. npts Number of vertex points x Vertex world coordinates c Vertex color RGB values
None
vgl_DrawFunPolyPointData - draw data points
void vgl_DrawFunPolyPointData (vgl_DrawFun *drawfun, Vint npts, Vfloat x[][3], Vint nrws, Vfloat d[])
drawfun Pointer to DrawFun object. npts Number of vertex points x Vertex world coordinates nrws Number of values in d vector d Vector of data values
None
vgl_DrawFunPolyPointDC - draw device oriented points
void vgl_DrawFunPolyPointDC (vgl_DrawFun *drawfun, Vint npts, Vfloat x[3], Vint dc[][3])
drawfun Pointer to DrawFun object. npts Number of vertex points x World coordinate anchor point dc Vertex device coordinate offsets
None
vgl_DrawFunPollModifiers - poll shift and control button state
void vgl_DrawFunPollModifiers (vgl_DrawFun *drawfun, Vint *cntl, Vint *shft)
drawfun Pointer to DrawFun object.
cntl Boolean value indicating Control key depressed shft Boolean value indicating Shift key depressed
vgl_DrawFunPollMouse - poll mouse location and button state
void vgl_DrawFunPollMouse (vgl_DrawFun *drawfun, Vint *px, Vint *py, Vint *but1, Vint *but2, Vint *but3)
drawfun Pointer to DrawFun object.
px,py Location of mouse in pixels but1 Boolean value indicating left mouse button depressed but2 Boolean value indicating middle mouse button depressed but3 Boolean value indicating right mouse button depressed
vgl_DrawFunProjFrustum,vgl_DrawFunProjOrtho - define projection transformation
void vgl_DrawFunProjFrustum (vgl_DrawFun *drawfun, Vfloat left, Vfloat right, Vfloat bottom, Vfloat top, Vfloat nearz, Vfloat farz) void vgl_DrawFunProjOrtho (vgl_DrawFun *drawfun, Vfloat left, Vfloat right, Vfloat bottom, Vfloat top, Vfloat nearz, Vfloat farz;
drawfun Pointer to DrawFun object. left,right Coordinates of left and right vertical clipping planes bottom,top Coordinates of bottom and top horizontal clipping planes nearz,farz Distances to near and far depth clipping planes
None
vgl_DrawFunProjPop,vgl_DrawFunProjPush - pop and push projection matrix stack
void vgl_DrawFunProjPop (vgl_DrawFun *drawfun) void vgl_DrawFunProjPush (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunProjLoad - load the current projection matrix
void vgl_DrawFunProjLoad (vgl_DrawFun *drawfun, Vfloat m4x4[4][4])
drawfun Pointer to DrawFun object. m4x4 A 4 by 4 matrix stored in column major order
None
vgl_DrawFunQueryWindow - query for graphics window id or handle
void vgl_DrawFunQueryWindow (vgl_DrawFun *drawfun, Vword *window)
drawfun Pointer to DrawFun object. window Window id, if X window. Window handle, if Microsoft Windows
None
vgl_DrawFunRasFontDefine - define a raster font index
void vgl_DrawFunRasFontDefine (vgl_DrawFun *drawfun, Vint index, vgl_RasFont *rasfont)
drawfun Pointer to DrawFun object. index Raster font index, 1 <= index rasfont Pointer to RasFont object.
None
vgl_DrawFunRasFontSelect - select current raster font
void vgl_DrawFunRasFontSelect (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. index Raster font index, 0 <= index
None
vgl_DrawFunReadQueue,vgl_DrawFunResetQueue,vgl_DrawFunTestQueue - event queue
void vgl_DrawFunReadQueue (vgl_DrawFun *drawfun, Vint *dev, Vint *val) void vgl_DrawFunResetQueue (vgl_DrawFun *drawfun) void vgl_DrawFunTestQueue (vgl_DrawFun *drawfun, Vint *dev)
drawfun Pointer to DrawFun object.
dev Type of event token =VGL_EVENT_NONE No event =VGL_EVENT_UNRECOGNIZED Unrecognized event =VGL_EVENT_LEFTMOUSE Left mouse button =VGL_EVENT_MIDDLEMOUSE Middle mouse button =VGL_EVENT_RIGHTMOUSE Right mouse button =VGL_EVENT_KEYPRESS Key press =VGL_EVENT_KEYRELEASE Key release =VGL_EVENT_EXPOSE Exposure event val Value of event token.
By default, the key and mouse button events are not recognized. Use vgl_DrawFunSetMode with VGL_EVENTQUEUEMODE enabled to recognize key and button events.
vgl_DrawFunRender - set rendering mode
void vgl_DrawFunRender (vgl_DrawFun *drawfun, Vint rendermode)
drawfun Pointer to DrawFun object. rendermode Rendering mode =VGL_BUFFER_COLOR Render to off-screen buffer =VGL_EXTENT_WORLD World coordinate extent =VGL_EXTENT_EYE Eye coordinate extent =VGL_EXTENT_DEVICE Device coordinate extent =VGL_RENDER Normal rendering to frame buffer =VGL_SELECT Selection mode
None
The VGL_BUFFER_COLOR rendering mode will render color to an off-screen frame buffer. For VGL_BUFFER_COLOR mode, use vgl_DrawFunBufferSize to specify an optional size of the off-screen frame buffer.
The VGL_EXTENT_EYE and VGL_EXTENT_DEVICE rendering modes specify that all subsequent graphics primitives are transformed and an extent box bounds calculation is performed in the appropriate coordinate system. The VGL_EXTENT_EYE mode performs the modelview transformation on input graphics primitives. The VGL_EXTENT_DEVICE mode performs the modelview, projection and viewport transformations on input graphics primitives. The VGL_EXTENT_WORLD mode does not perform any transformation on the graphics primitives to perform extent box bounds calculations. The frame buffer is not modified while the rendering mode is set to perform extent box calculations. Use vgl_DrawFunExtentQuery to return the extent box. If the extent box is queried before any primitives are drawn, then zeros are returned. Z-buffering is not performed in extent mode.
The VGL_SELECT rendering mode specifies that all subsequent graphics primitives are rasterized and checked to see if any portion of the primitive lies within the selection region specified by vgl_DrawFunSelectRegion. The selection buffers used to record hit information are specified by vgl_DrawFunSelectBuffer. Z-buffering is not performed in selection mode. The number of hits is set to zero. The index stack is initialized and a 0 is pushed onto the index stack. After the rendering mode is returned to VGL_RENDER, the number of hits may be returned using vgl_DrawFunSelectQuery.
vgl_DrawFunResize - resize a frame buffer
void vgl_DrawFunResize (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunSelectBuffer - specify selection buffers
void vgl_DrawFunSelectBuffer (vgl_DrawFun *drawfun, Vint size, Vint *indexlist, Vfloat *mindepth, Vfloat *maxdepth)
drawfun Pointer to DrawFun object. size Size of selection buffers indexlist Pointer to vector of hit indices. mindepth Pointer to vector of minimum depth of hit primitives. maxdepth Pointer to vector of maximum depth of hit primitives.
None
If a hit has been generated for the current DataIndex, no subsequent hits will be recorded until the value of the DataIndex changes. Use vgl_DrawFunSelectRegion to specify the selection region. Query for the number of hits using vgl_DrawFunSelectQuery.
vgl_DrawFunSelectQuery - query number of selection hits
void vgl_DrawFunSelectQuery (vgl_DrawFun *drawfun, Vint *hits)
drawfun Pointer to DrawFun object.
hits Number of hits recorded.
The number of hits is initialized to zero when the rendering mode is set to VGL_SELECT using vgl_DrawFunRender. The number of hits is not defined until the selection mode is exited by setting the rendering mode to VGL_RENDER using vgl_DrawFunRender.
vgl_DrawFunSelectRegion - specify selection region
void vgl_DrawFunSelectRegion (vgl_DrawFun *drawfun, Vint type, Vint iparam[])
drawfun Pointer to DrawFun object. type Type of selection region. =VGL_REGION_POLYGON Any vertex in a polygonal region =VGL_REGION_RECTANGLE Rectangular selection region =VGL_REGION_CLIPPLANE Any vertex inside clipping planes iparam Integer parameters used to define selection region.
None
If the selection region is a rectangle, then iparam[0] through iparam[3] contain the left, right, bottom and top device coordinates of the rectangle. A hit is recorded if one or more rasterized pixels of a primitive lie within the rectangular region.
If the selection region is VGL_REGION_CLIPPLANE, then iparam is ignored (it may be set to NULL), and the selection region is assumed to be the set of active clipping planes as defined by vgl_DrawFunClipPlane and vgl_DrawFunSetSwitch. Hits are determined by checking vertices against the clipping planes only. A hit is recorded for a given DataIndex if one or more vertices of any primitive corresponding to a given DataIndex lies within all active clipping planes.
Use vgl_DrawFunSelectQuery to return the number of hits. Use vgl_DrawFunSelectBuffer to specify the buffers used to record hit information.
vgl_DrawFunSetCursor - set the active cursor style
void vgl_DrawFunSetCursor (vgl_DrawFun *drawfun, Vint type)
drawfun Pointer to DrawFun object. type Cursor type =VGL_CURSOR_ARROW Left pointing arrow cursor =VGL_CURSOR_CROSSHAIR Crosshair cursor =VGL_CURSOR_DEFAULT Default cursor =VGL_CURSOR_DOLLY Dolly cursor =VGL_CURSOR_FAR Far plane cursor =VGL_CURSOR_HAND Hand cursor =VGL_CURSOR_LLANGLE Lower left angle cursor =VGL_CURSOR_LRANGLE Lower right angle cursor =VGL_CURSOR_MAGNIFYGLASS Magnifying glass cursor =VGL_CURSOR_NEAR Near plane cursor =VGL_CURSOR_PENCIL Pencil cursor =VGL_CURSOR_PIRATE Skull and cross bones cursor =VGL_CURSOR_QUESTION Question mark cursor =VGL_CURSOR_ROTATION Rotation cursor =VGL_CURSOR_TRANSLATION Translation cursor =VGL_CURSOR_ULANGLE Upper left angle cursor =VGL_CURSOR_URANGLE Upper right angle cursor =VGL_CURSOR_WATCH Watch cursor =VGL_CURSOR_ZOOM Zoom cursor
None
vgl_DrawFunSetFactors - set factors to control shader modes
void vgl_DrawFunSetFactors (vgl_DrawFun *drawfun, Vint type, Vfloat factors[])
drawfun Pointer to DrawFun object. type The type of factor to set. =VGL_ZBUFFEREDGESCALE Z Buffer edge lightness scaling =VGL_SSAODIST Occlusion region radius =VGL_WORLDSIZE World size of points.
None
The VGL_ZBUFFEREDGESCALE factor is used to control the amount of lightness reduction as a function of z-buffer depth discontinuity. By default VGL_ZBUFFEREDGESCALE is set to 10000.
The VGL_SSAODIST factor is a physical distance used to limit the geometry considered for ambient light occlusion at a point. Any geometry more than this distance from a point is ignored as occluding geometry. A reasonable value for this parameter would be 5 percent of the model world coordinate extent. By default VGL_SSAODIST is set to 1.
The VGL_WORLDSIZE factor is a world coordinate size of world-sized points. For example the VGL_POINTSTYLE_SPHEREWORLD point style will draw spheres with a diameter of the current world size.
vgl_DrawFunSetMode - set current graphics mode
void vgl_DrawFunSetMode (vgl_DrawFun *drawfun, Vint mode, Vint flag)
drawfun Pointer to DrawFun object. mode The graphics mode to turn on or off =VGL_BACKFACECULLMODE Back face culling =VGL_BLENDTRANSMODE Alpha blended transparency =VGL_CLIPMODE Clipping rectangle =VGL_COLORWRITEMODE Color buffer writing =VGL_DBUFFERMODE Double buffering =VGL_DATAINDEXMAXROWS Set maximum dataindex rows =VGL_DEPTHPEELMODE Depth peel number or mode =VGL_EVENTQUEUEMODE Button and key events =VGL_FRONTBUFFERDRAWMODE Front buffer drawing =VGL_FRONTBUFFERREADMODE Front buffer reading =VGL_FRONTFACECULLMODE Front face culling =VGL_FRONTFACEFLIPMODE Front face flip sense =VGL_LEFTBUFFERDRAWMODE Left buffer drawing =VGL_LIGHTMODE Lighting calculations =VGL_LINECULLMODE Line back pointing fulling =VGL_LINEDRAWMODE Line drawing =VGL_LINESTYLEFACTOR Line style integer scale factor =VGL_LINETRANSMODE Line, point, text transparency =VGL_LINEARRAYLIGHTMODE LineArray light mode =VGL_MULTISAMPLEMODE Multi-sampled mode =VGL_OITMODE Order independent transparency mode =VGL_OITAVERAGELAYERS Set average OIT layers per pixel =VGL_POINTARRAYLIGHTMODE PointArray light mode =VGL_POLYGONDEPTHMODE Polygon depth alteration =VGL_RASFONTDRAWMODE RasFont draw mode =VGL_SELECTSTACKMODE Select index stack mode =VGL_STENCILMODE Stencil buffering =VGL_STENCILWRITEMASK Stencil write mask =VGL_STENCILFUNCMODE Stencil function =VGL_STENCILFUNCREF Stencil function reference value =VGL_STENCILFUNCMASK Stencil function mask =VGL_STENCILOPFAIL Stencil operation fail =VGL_STENCILOPZFAIL Stencil operation z-buffer fail =VGL_STENCILOPZPASS Stencil operation z-buffer pass =VGL_TEXTANCHORMODE Text anchor mode =VGL_TEXTDIRECTIONMODE Text direction mode =VGL_TEXTPIXELSIZEMODE Text pixel size mode =VGL_TWOSIDELIGHTMODE Two sided lighting =VGL_UPDATEMODE Color and Z buffer initialization =VGL_XORMODE XOR drawing =VGL_ZBUFFERMODE Z-buffering =VGL_ZBUFFERFUNCMODE Z-buffer depth function =VGL_ZBUFFERWRITEMODE Z-buffer writing flag Mode flag =VGL_OFF Turn mode off =VGL_ON Turn mode on =VGL_RIGHT Text anchor right baseline. Text direction right =VGL_LEFT Text anchor left baseline. Text direction left =VGL_BOTTOM Text anchor bottom center. Text direction bottom =VGL_TOP Text anchor top center. Text direction top =VGL_CENTER Text anchor center baseline =VGL_BOTTOMRIGHT Text anchor bottom right =VGL_BOTTOMLEFT Text anchor bottom left =VGL_TOPRIGHT Text anchor top right =VGL_TOPLEFT Text anchor top left =VGL_LESS Function less than =VGL_LEQUAL Function less than or equal =VGL_GREATER Function greater than =VGL_GEQUAL Function greater than or equal =VGL_EQUAL Function equal =VGL_NOTEQUAL Function not equal =VGL_NEVER Function never =VGL_ALWAYS Function always =VGL_OP_ZERO Operation set to zero =VGL_OP_KEEP Operation keep =VGL_OP_REPLACE Operation replace =VGL_OP_INCR Operation increment =VGL_OP_DECR Operation decrement =VGL_OP_INVERT Operation invert =VGL_DEPTHPEELLAST Last depth peel.
None
The VGL_BLENDTRANSMODE is used to enable alpha blending for transparent polygon rendering. If disabled transparency is rendered using a "screen door" technique. By default VGL_BLENDTRANSMODE is set to off.
The VGL_DATAINDEXMAXROWS is used to enable data index rendering and set the maximum number of data indices to rendered at any pixel. A value of zero disables data index rendering. By default VGL_DATAINDEXMAXROWS is set to 0.
The VGL_DEPTHPEELMODE is used to enable depth peeling for accurate rendering of transparent objects. A scene is rendered repeatedly, once for each peel. The value of flag starts at one and increments for each peel. A final, specialized peel with a flag of VGL_DEPTHPEELLAST may be rendered if there is a residual of the scene yet to rendered in an approximate way. The user can query for the number of pixels touched by the previous peel using vgl_DrawFunGetInteger to determine if the peeling can be terminated. By default VGL_DEPTHPEELMODE is set to 0.
The VGL_COLORWRITEMODE is used to enable or disable writing to the color buffer. By default VGL_COLORWRITEMODE is set to on.
The VGL_FRONTFACEFLIPMODE is used to enable or disable the flipping of the definition of a front face. If disabled a front face has a right-hand sense, if enabled it has a left-hand sense. By default VGL_FRONTFACEFLIPMODE is set to off.
The VGL_TWOSIDELIGHTMODE is used to enable two sided lighting of polygons. In two sided lighting the normals of back-facing polygons have their normals reversed before lighting is evaluated. By default VGL_TWOSIDELIGHTMODE is set to off.
The VGL_LINECULLMODE is used to enable back "facing" line culling. This mode requires that shaders are enabled. and that normals are defined at the vertices of line primitives using either vgl_DrawFunPolyLineArray or vgl_DrawFunPolyLineBuffer. A line is assumed to be back facing if the first line endpoint normal is back pointing. By default VGL_LINECULLMODE is set to off.
The VGL_LINEDRAWMODE is used with software rendering modules such as RendBuf, DataBuf, GDIDev and X11Dev. If enabled, visible lines are drawn by a native line drawing function rather than being rasterized in software. By default VGL_LINEDRAWMODE is set to off.
The VGL_LINESTYLEFACTOR is used to set an integer line style factor. The current line style is expanded by this factor. By default VGL_LINESTYLEFACTOR is set to 1.
The VGL_LINETRANSMODE is used to apply transparency to line, point and text primitives. If disabled, transparency will effect only polygon primitives, if enabled transparency effects line, point and text primitives as well as polygon primitives. By default VGL_LINETRANSMODE is set to off.
The VGL_LINEARRAYLIGHTMODE is used to apply lighting to line primitives specified by the PolyLineArray drawing function. By default VGL_LINEARRAYLIGHTMODE is set to off.
The VGL_POINTARRAYLIGHTMODE is used to apply lighting to point primitives specified by the PolyPointArray drawing function. By default VGL_POINTARRAYLIGHTMODE is set to off.
The VGL_MULTISAMPLEMODE is used to toggle multi-sampling if a multi-sampled buffer has been selected. By default VGL_MULTISAMPLEMODE is set to on.
The VGL_OITMODE is used to enable a one-pass, order independent transparency feature. By default VGL_OITMODE is set to off.
Use VGL_OITAVERAGELAYERS to set the average number of layers per pixel to be used to allocate the internal OIT data structure. By default =VGL_OITAVERAGELAYERS is set to 16.
The VGL_RASFONTDRAWMODE is used to enable or disable drawing raster fonts explicitly by pixel. If enabled then raster fonts are drawn with pixel level graphics primitives rather than bitmaps. By default VGL_RASFONTDRAWMODE is set to off.
The VGL_SELECTSTACKMODE is used to enable or disable the method used to record hits during selection mode. If disabled then only the data index at the top of the index stack is placed in the hit buffer. If enabled the entire data index stack is placed in the hit buffer. By default VGL_SELECTSTACKMODE is set to off.
The VGL_STENCILMODE is used to enable or disable stencil buffer testing. By default VGL_STENCILMODE is set to off.
The VGL_STENCILWRITEMASK is used to control which planes of the stencil buffer are written to. By default VGL_STENCILWRITEMASK is set to all 1's.
The VGL_STENCILFUNCMODE specifies the stencil test function. Possible values are VGL_NEVER, VGL_ALWAYS, VGL_EQUAL, VGL_NOTEQUAL, VGL_LESS, VGL_LEQUAL, VGL_GREATER, VGL_GEQUAL, By default VGL_STENCILFUNCMODE is set to VGL_ALWAYS.
The VGL_STENCILFUNCREF specifies the stencil test function reference value. By default VGL_STENCILFUNCREF is set to zero.
The VGL_STENCILFUNCMASK specifies the stencil test function mask. By default VGL_STENCILFUNCMASK is set to all 1's.
The VGL_STENCILOPFAIL specifies the operation when the stencil test fails. Possible values are VGL_OP_KEEP, VGL_OP_ZERO, VGL_OP_REPLACE, VGL_OP_INCR, VGL_OP_DECR and VGL_OP_INVERT. By default VGL_STENCILOPFAIL is set to all VGL_KEEP.
The VGL_STENCILOPZFAIL specifies the operation when the stencil test passes and the z-buffer test fails.. Possible values and default are the same as VGL_STENCILOPFAIL.
The VGL_STENCILOPZPASS specifies the operation when the stencil test passes and the z-buffer test passes.. Possible values and default are the same as VGL_STENCILOPFAIL.
The VGL_TEXTANCHORMODE is used to set the anchor position of all drawn text. By default VGL_TEXTANCHORMODE is set to VGL_BOTTOMLEFT.
The VGL_TEXTDIRECTIONMODE is used to set the direction of text drawn with a non-orientable raster font. By default VGL_TEXTDIRECTIONMODE is set to VGL_RIGHT.
The VGL_TEXTPIXELSIZEMODE is used to enable or disable the text pixel size set by the drawing function vgl_DrawFunTextPixelSize. By default VGL_TEXTPIXELSIZE is set to VGL_OFF.
The VGL_ZBUFFERMODE is used to enable or disable z-buffer testing. By default VGL_ZBUFFERMODE is set to off.
The VGL_ZBUFFERWRITEMODE is used to enable or disable writing to the z buffer. By default VGL_ZBUFFERWRITEMODE is set to on.
The VGL_UPDATEMODE is used to enable or disable the frame buffer and zbuffer update feature. When enabled the current contents of the frame buffer the zbuffer are copied and stored by the device driver. Each time the Clear drawing function is called the saved contents are copied to the frame buffer and zbuffer. Any drawing which then occurs creates a scene which "updates" the scene contained in the saved buffers. The contents of the saved buffers are not changed only the contents of the current frame buffer and zbuffer. This allows for very quick updating of complex scenes. By default VGL_UPDATEMODE is set to off.
The VGL_ZBUFFERFUNCMODE is used to select the comparison function used to compare incoming z-buffer depth values to the current value stored in the z-buffer to test for visibility. Possible modes are VGL_LESS, VGL_LEQUAL, VGL_GREATER, VGL_GEQUAL, By default VGL_ZBUFFERFUNCMODE is set to VGL_LESS.
The VGL_LEFTBUFFERDRAWMODE is used to enable or disable writing to the left front or left back buffer when using a stereoscopic frame buffer. If VGL_LEFTBUFFERDRAWMODE is disabled then drawing will be directed to the right front or right back buffer. Control drawing to the front or back buffer using VGL_FRONTBUFFERDRAWMODE. By default VGL_LEFTBUFFERDRAWMODE is set to on.
Return modes as output arguments using
void vgl_DrawFunGetMode (vgl_DrawFun *drawfun, Vint mode, Vint *flag)
vgl_DrawFunSetSwitch - enable, disable lights, clipping planes
void vgl_DrawFunSetSwitch (vgl_DrawFun *drawfun, Vint type, Vint index, Vint flag)
drawfun Pointer to DrawFun object. type Type of entity to enable/disable =VGL_LIGHT Light =VGL_CLIPPLANE Clipping plane index Index, 0 <= index flag Switch =VGL_OFF Turn off =VGL_ON Turn on
None
vgl_DrawFunSetWindow - set an object as current graphics window or file
void vgl_DrawFunSetWindow (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunSpecularity - set current specularity
void vgl_DrawFunSpecularity (vgl_DrawFun *drawfun, Vfloat intensity, Vfloat shininess)
drawfun Pointer to DrawFun object. intensity Current intensity of specular reflectance. shininess Current specular exponent
None
vgl_DrawFunSwap - swap frame buffers
void vgl_DrawFunSwap (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunText - draw raster text
void vgl_DrawFunText (vgl_DrawFun *drawfun, Vfloat x[3], Vtchar text[])
drawfun Pointer to DrawFun object. x World coordinate anchor point text Text string
None
vgl_DrawFunTextDC - draw raster text with a device oriented offset
void vgl_DrawFunTextDC (vgl_DrawFun *drawfun, Vfloat x[3], Vint dc[3], Vtchar text[])
drawfun Pointer to DrawFun object. x World coordinate anchor point dc Device coordinate offset text Text string
None
vgl_DrawFunTextPlane - specify raster font plane
void vgl_DrawFunTextPlane (vgl_DrawFun *drawfun, Vfloat path[3], Vfloat plane[3])
drawfun Pointer to DrawFun object. path Raster font path plane Raster font plane
None
vgl_DrawFunTextPixelSize - specify raster font pixel size
void vgl_DrawFunTextPixelSize (vgl_DrawFun *drawfun, Vfloat pixelsize)
drawfun Pointer to DrawFun object. pixelsize World coordinate size of a pixel or raster in raster font
None
vgl_DrawFunTextureDefine - define a texture map index
void vgl_DrawFunTextureDefine (vgl_DrawFun *drawfun, Vint index, vgl_Texture *texture)
drawfun Pointer to DrawFun object. index Texture map index, 1 <= index texture Pointer to Texture object.
None
vgl_DrawFunTextureSelect - select current texture map
void vgl_DrawFunTextureSelect (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. index Texture map index, 0 <= index
None
vgl_DrawFunTrans,vgl_DrawFunTransIndex - set current transparency
void vgl_DrawFunTrans (vgl_DrawFun *drawfun, Vfloat t) void vgl_DrawFunTransIndex (vgl_DrawFun *drawfun, Vint index)
drawfun Pointer to DrawFun object. t Current transparency factor index Current transparency index
None
vgl_DrawFunViewport - define viewport transformation
void vgl_DrawFunViewport (vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top)
drawfun Pointer to DrawFun object. left Device coordinate of left plane of viewing volume right Device coordinate of right plane of viewing volume bottom Device coordinate of bottom plane of viewing volume top Device coordinate of top plane of viewing volume
None
vgl_DrawFunVisualWindow - specify a frame buffer visual
void vgl_DrawFunVisualWindow (vgl_DrawFun *drawfun, Vint visflag)
drawfun Pointer to DrawFun object. visflag ORed flags indicating frame buffer configuration =VGL_VISUAL_DEFAULT Set default visual =VGL_VISUAL_MULTISAMPLE Set multi-sampled buffer =VGL_VISUAL_SINGLEBUFFER Set single buffer =VGL_VISUAL_USECONTEXT Use current grapbics context =VGL_VISUAL_STEREO Set stereo pixel format
None
The VGL_VISUAL_DEFAULT option will select the default visual under X windows.
The VGL_VISUAL_MULTISAMPLE option will select a multi-sampled buffer for anti-aliasing effects.
The VGL_VISUAL_USECONTEXT option is used when the application is designed to create the graphics window and graphics context. In this case the "window" argument in the call to vgl_DrawFunConnectWindow is ignored and the current graphics context is queried. In Microsoft Windows this is a HGLRC. In X Windows this is a GLXContext.
Use VGL_VISUAL_STEREO to select a stereoscopic visual.
This function should be called before vgl_DrawFunOpenWindow or vgl_DrawFunConnectWindow.
vgl_DrawFunWarpMouse - move mouse to specified location
void vgl_DrawFunWarpMouse (vgl_DrawFun *drawfun, Vint px, Vint py)
drawfun Pointer to DrawFun object. px,py Pixel coordinates to move mouse
None
vgl_DrawFunXfmLoad,vgl_DrawFunXfmMult - load and multiply the current matrix
void vgl_DrawFunXfmLoad (vgl_DrawFun *drawfun, Vfloat m4x4[4][4]) void vgl_DrawFunXfmMult (vgl_DrawFun *drawfun, Vfloat m4x4[4][4])
drawfun Pointer to DrawFun object. m4x4 A 4 by 4 matrix stored in column major order
None
vgl_DrawFunXfmPop,vgl_DrawFunXfmPush - pop and push transformation stack
void vgl_DrawFunXfmPop (vgl_DrawFun *drawfun) void vgl_DrawFunXfmPush (vgl_DrawFun *drawfun)
drawfun Pointer to DrawFun object.
None
vgl_DrawFunZBufferRead,vgl_DrawFunZBufferWrite - read and write z buffer
void vgl_DrawFunZBufferRead(vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top, vgl_ZBuffer *zbuffer) void vgl_DrawFunZBufferWrite(vgl_DrawFun *drawfun, Vint left, Vint right, Vint bottom, Vint top, vgl_ZBuffer *zbuffer)
drawfun Pointer to DrawFun object. left,right Pixel coordinates of left and right limits of rectangle bottom,top Pixel coordinates of bottom and top limits of rectangle zbuffer Pointer to ZBuffer object to read into or write from.
None
The current z buffers for reading and writing (drawing) are determined by the VGL_FRONTBUFFERREADMODE and VGL_FRONTBUFFERDRAWMODE modes specified with the vgl_DrawFunSetMode function.