<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../docs.xsl"?>

<docs type="symbol" project="SIEGE" version="0.8.2" rpath="../..">
	<file root="siege/core" name="core.DONE.h">
		<group key="Core" name="Core">
			<symbol id="11" kind="function" internal="false" cname="sgLoop">
				<index>
					<entry key="Loop">sgLoop</entry>
				</index>
				<section name="Name">
					<names>
						<name>sgLoop</name>
						<descr>Run a single SIEGE iteration</descr>
					</names>
				</section>
				<section name="Synopsis">
					<code-block lang="C"><ref local="false" path=".." file="common" group="Common" name="SGbool" id="1">SGbool</ref> <ref local="true" path="." file="core.DONE" group="Core" name="sgLoop" id="11">sgLoop</ref>(<ref local="false" path=".." file="common" group="Common" name="SGbyte" id="3">SGint</ref>* code);</code-block>
				</section>
				<section name="Parameters">
					<params>
						<name>code</name>
						<descr>return code, which can be passed to the `return` from main()</descr>
					</params>
				</section>
				<section name="Description">
					<p>
						A single SIEGE iteration is executed; events are processed and event handlers called.
					</p>
					<p>
						Please note that, unlike <ref local="false" path="." file="core.DONE" group="Core" name="sgRun" id="10">sgRun</ref>(), this function does not call sgDrawClear() or <ref local="false" path="." file="window.DONE" group="Window" name="sgWindowSwapBuffers" id="21">sgWindowSwapBuffers</ref>() -- these calls need to be done manually by the user; see the example below.
					</p>
					<p>
						<ref local="false" path="." file="window.DONE" group="Window" name="sgWindowHandleEvents" id="20">sgWindowHandleEvents</ref>() *is* however called by this function on every iteration.
					</p>
				</section>
				<section name="Return Values">
					<p>
						`SG_TRUE` if the game is to continue running; `SG_FALSE` if an exit has been requested (either via <ref local="false" path="." file="core.DONE" group="Core" name="sgStop" id="12">sgStop</ref>() or the window closed).
					</p>
				</section>
				<section name="Examples">
					<code-block lang="C">int main(void)
{
    <ref local="false" path="." file="core.DONE" group="Core" name="sgInit" id="8">sgInit</ref>(0);
    <ref local="false" path="." file="window.DONE" group="Window" name="sgWindow*Open" id="14">sgWindowOpen</ref>(...);
    ...
    <ref local="false" path=".." file="common" group="Common" name="SGbyte" id="3">SGint</ref> ret;
    for(;;)
    {
        sgDrawClear();
        if(!<ref local="true" path="." file="core.DONE" group="Core" name="sgLoop" id="11">sgLoop</ref>(&amp;ret))
            break;
        <ref local="false" path="." file="window.DONE" group="Window" name="sgWindowSwapBuffers" id="21">sgWindowSwapBuffers</ref>();
    }
    <ref local="false" path="." file="core.DONE" group="Core" name="sgDeinit" id="9">sgDeinit</ref>();
    return ret;
}</code-block>
				</section>
				<section name="See Also">
					<sees>
						<see><ref local="false" path="." file="core.DONE" group="Core" name="sgRun" id="10">sgRun</ref></see>
						<see><ref local="false" path="." file="core.DONE" group="Core" name="sgStop" id="12">sgStop</ref></see>
					</sees>
					<sees>
						<see><ref local="false" path="." file="core.DONE" group="Core" name="sgGetTick" id="13">sgGetTick</ref></see>
					</sees>
					<sees>
						<see><ref local="false" path="." file="window.DONE" group="Window" name="sgWindowHandleEvents" id="20">sgWindowHandleEvents</ref></see>
					</sees>
				</section>
				<section name="TODO">
						<ul>
							<li>
								<p>
									(?) Rename this to sgIter or sg{,Perform}Tick or similar?
								</p>
							</li>
						</ul>
				</section>
			</symbol>
		</group>
	</file>
</docs>
