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 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void 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 ); 21</pre></dd></dl> 22 23<H2>Arguments</H2> 24<TABLE class="arguments" border="1" > 25 <TBODY> 26 <TR> 27<TH>compare_enable</TH> 28<TD>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> 29 </TR> 30 <TR> 31<TH>func</TH> 32<TD>Z comparison function. Accepted values are:<BR> 33 <TABLE class="arguments" border="1" > 34 <TBODY> 35 <TR> 36 <TD bgcolor="#C0C0C0">Name</TD> 37 <TD bgcolor="#C0C0C0">Z compare operation</TD> 38 </TR> 39 <TR> 40 <TH>GX_NEVER</TH> 41 <TD>Never passes Z test.</TD> 42 </TR> 43 <TR> 44 <TH>GX_LESS</TH> 45 <TD>Passes if <CODE>new Z < existing Z</CODE>.</TD> 46 </TR> 47 <TR> 48 <TH>GX_LEQUAL</TH> 49 <TD>Passes if <CODE>new Z <= existing Z</CODE>.</TD> 50 </TR> 51 <TR> 52 <TH>GX_EQUAL</TH> 53 <TD>Passes if <CODE>new Z == existing Z</CODE>.</TD> 54 </TR> 55 <TR> 56 <TH>GX_NEQUAL</TH> 57 <TD>Passes if <CODE>new Z != existing Z</CODE>.</TD> 58 </TR> 59 <TR> 60 <TH>GX_GEQUAL</TH> 61 <TD>Passes if <CODE>new Z >= existing Z</CODE>.</TD> 62 </TR> 63 <TR> 64 <TH>GX_GREATER</TH> 65 <TD>Passes if <CODE>new Z > existing Z</CODE>.</TD> 66 </TR> 67 <TR> 68 <TH>GX_ALWAYS</TH> 69 <TD>Always passes Z test.</TD> 70 </TR> 71 </TBODY> 72 </TABLE> 73 </TD> 74 </TR> 75 <TR> 76<TH>update_enable</TH> 77<TD>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> 78 </TR> 79 </TBODY> 80</TABLE> 81 82<H2>Return Values</H2> 83<P>None.</P> 84 85<H2>Description</H2> 86<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> 87<P>When <SPAN class="argument">compare_enable</SPAN> is set to <CODE>GX_DISABLE</CODE>, Z buffering is disabled and the Z buffer will not be updated.</P> 88<P>The <SPAN class="argument">func</SPAN> argument determines the comparison that is performed. In the comparison function, the newly rasterized Z value is on the left, and 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> 89<P>The <SPAN class="argument">update_enable</SPAN> parameter determines whether or not the Z buffer will be updated with the new Z value after the comparison. This parameter also affects whether the Z buffer is cleared during copy operations. See the <A href="../Framebuffer/GXCopyDisp.html"><CODE>GXCopyDisp</CODE></A> and <A href="../Framebuffer/GXCopyTex.html"><CODE>GXCopyTex</CODE></A> functions.</P> 90 91<H2>See Also</H2> 92<P class="reference"> 93<A href="../Culling/GXSetCoPlanar.html">GXSetCoPlanar</A>, 94<A href="GXSetBlendMode.html">GXSetBlendMode</A>, 95<A href="GXSetZCompLoc.html">GXSetZCompLoc</A> 96</P> 97 98<H2>Revision History</H2> 99<P> 1002006/03/01 Initial version.<br> 101</P> 102 103<hr><p>CONFIDENTIAL</p></body> 104</HTML>