Welcome to Timothy's Glide 3.x Tutorial number 2

Q:Where do I get Timothy's Glide 3.x Tutorials ?
A:This document and others can be obtained via the web at http://www.icon.co.za/~tsb

Q:Where can I mail any comments/flames/etc ?
A:All mail can be sent to tsb@icon.co.za

Q:Why did you write these tutorials?
A:Because I couldn't find any descent source or textfiles that worked correctly. And this makes everything very confusing for coders new to glide. Even the Glide3.x SDK has code snippets that don't compile :(

Compile and run the code first and then I'll explain a few things.

grSstSelect(0): Selects which 3DFX card to use. (0 is first one.)
grVertexLayout: This defines how your "vertex" structure looks like. I used x,y,r,g,b,a = r=red, g=green, b=blue, a=alpha Alpha spescifies how transparent something is.

grDrawLine: This draws a line, duh ;)
grDrawTriangle: This draws a triangle =)
grColorCombine: Defines how the "lines", "points" and "triangles" are drawn. Some types are ConstantColor, Iterated, Texture, Texture+Fog, etc Iterated is Gourade Shading ofcourse :)

I used Gourade(Iterated) shading for the 3 lines/triangles I did in DrawScene1/2 You need to specify a color for each vertex you use in your triangles.

grBufferSwap( 1 ): flips the "virtual screen" to your monitor.

Mail me if you want me to explain something in more detail.
But remember the trick is to assume everything until you understand the basics.

-Timothy S. Bowers
tsb@icon.co.za
http://www.icon.co.za/~tsb