1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>GXSetZMode</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXSetZMode</H1> 12<H2>C Specification</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <revolution/gx.h></CODE></PRE> 16 <DD> 17 <PRE><CODE>void GXSetZMode( 18 <A href="../Enumerated_Types/GXBool.html">GXBool</A> compare_enable, 19 <A href="../Enumerated_Types/GXCompare.html">GXCompare</A> func, 20 <A href="../Enumerated_Types/GXBool.html">GXBool</A> update_enable );</CODE></PRE> 21</DL> 22<H2>Arguments</H2> 23<TABLE border="1" cellpadding="3" cellspacing="0.1"> 24 <TBODY> 25 <TR> 26<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>compare_enable</STRONG></EM></TD> 27<TD width="520">When <CODE>GX_TRUE</CODE>, enables the process for comparing the original Z value and the target Z value. Disabled if not <CODE>GX_TRUE</CODE>.</TD> 28 </TR> 29 <TR> 30<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>func</STRONG></EM></TD> 31<TD width="520">Z comparison function. Accepted values are:<BR> 32 <TABLE border="1" cellpadding="3" cellspacing="0.1" width="500"> 33 <TBODY> 34 <TR> 35<TD bgcolor="#C0C0C0" width="150">Name:</TD> 36<TD bgcolor="#C0C0C0" width="350">Z compare operation</TD> 37 </TR> 38 <TR> 39<TD width="150"><CODE>GX_NEVER</CODE></TD> 40<TD width="350">Never passes Z test.</TD> 41 </TR> 42 <TR> 43<TD width="150"><CODE>GX_LESS</CODE></TD> 44<TD width="350">Passes if <CODE>new Z < existing Z.</CODE></TD> 45 </TR> 46 <TR> 47<TD width="150"><CODE>GX_LEQUAL</CODE></TD> 48<TD width="350">Passes if <CODE>new Z <= existing Z</CODE>.</TD> 49 </TR> 50 <TR> 51<TD height="25" width="150"><CODE>GX_EQUAL</CODE></TD> 52<TD height="25" width="350">Passes if <CODE>new Z == existing Z</CODE>.</TD> 53 </TR> 54 <TR> 55<TD width="150"><CODE>GX_NEQUAL</CODE></TD> 56<TD width="350">Passes if <CODE>new Z != existing Z</CODE>.</TD> 57 </TR> 58 <TR> 59<TD width="150"><CODE>GX_GEQUAL</CODE></TD> 60<TD width="350">Passes if <CODE>new Z >= existing Z</CODE>.</TD> 61 </TR> 62 <TR> 63<TD width="150"><CODE>GX_GREATER</CODE></TD> 64<TD width="350">Passes if <CODE>new Z > existing Z</CODE>.</TD> 65 </TR> 66 <TR> 67<TD width="150"><CODE>GX_ALWAYS</CODE></TD> 68<TD width="350">Always passes Z test.</TD> 69 </TR> 70 </TBODY> 71 </TABLE> 72 </TD> 73 </TR> 74 <TR> 75<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>update_enable</STRONG></EM></TD> 76<TD width="520">When <CODE>GX_TRUE</CODE>, allows a Z buffer update.<br>Although a Z buffer update is only possible when <CODE>GX_TRUE</CODE>, the comparison process will continue.</TD> 77 </TR> 78 </TBODY> 79</TABLE> 80<H2>Return Values</H2> 81<P>None.</P> 82<H2>Description</H2> 83<P>This function sets the Z-buffer compare mode. The result of the Z compare is used to conditionally write color values to the Embedded Frame Buffer (EFB).</P> 84<P>When <em><strong><code>compare_enable</code></strong></em> is set to <code>GX_DISABLE</code>, Z buffering is disabled and the Z buffer is not updated.</P> 85<P>The <em><strong><code>func</code></strong></em> parameter determines the comparison that is performed. In the comparison function, the newly rasterized Z value is on the left while the Z value from the Z buffer is on the right. If the result of the comparison is false, the newly rasterized pixel is discarded.</P> 86<P>The parameter <code><em><strong>update_enable</strong></em></code> determines whether or not the Z buffer is updated with the new Z value after a comparison is performed. This parameter also affects whether the Z buffer is cleared during copy operations. See <a href="../Framebuffer/GXCopyDisp.html"><code>GXCopyDisp</code></a> and <a href="../Framebuffer/GXCopyTex.html"><code>GXCopyTex</code></a>.</P> 87 88 89<H2>See Also</H2> 90<P><a href="../Culling/GXSetCoPlanar.html">GXSetCoPlanar</a><br> <a href="GXSetBlendMode.html">GXSetBlendMode</a><br> <a href="GXSetZCompLoc.html">GXSetZCompLoc</a></P> 91<H2>Revision History</H2> 92<P>2006/03/01 Initial version.</P> 93<hr> 94<P>CONFIDENTIAL</p> 95</BODY> 96</HTML>