<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://inside.digipen.edu/index.php?action=history&amp;feed=atom&amp;title=GSDP%3AGAM100%2FCProcessing%2FCP_Engine_Terminate%28%29</id>
	<title>GSDP:GAM100/CProcessing/CP Engine Terminate() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://inside.digipen.edu/index.php?action=history&amp;feed=atom&amp;title=GSDP%3AGAM100%2FCProcessing%2FCP_Engine_Terminate%28%29"/>
	<link rel="alternate" type="text/html" href="https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/CP_Engine_Terminate()&amp;action=history"/>
	<updated>2026-04-05T19:51:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/CP_Engine_Terminate()&amp;diff=61499&amp;oldid=prev</id>
		<title>&gt;Justin.chambers: New page: {{GSDP:GAM100API.css}} = CP_Engine_Terminate() = == Description == This will end the program after completing the current frame.  == Example Usage == &lt;syntaxhighlight lang='c'&gt; // Horizont...</title>
		<link rel="alternate" type="text/html" href="https://inside.digipen.edu/index.php?title=GSDP:GAM100/CProcessing/CP_Engine_Terminate()&amp;diff=61499&amp;oldid=prev"/>
		<updated>2020-09-20T06:45:32Z</updated>

		<summary type="html">&lt;p&gt;New page: {{GSDP:GAM100API.css}} = CP_Engine_Terminate() = == Description == This will end the program after completing the current frame.  == Example Usage == &amp;lt;syntaxhighlight lang=&amp;#039;c&amp;#039;&amp;gt; // Horizont...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{GSDP:GAM100API.css}}&lt;br /&gt;
= CP_Engine_Terminate() =&lt;br /&gt;
== Description ==&lt;br /&gt;
This will end the program after completing the current frame.&lt;br /&gt;
&lt;br /&gt;
== Example Usage ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang='c'&amp;gt;&lt;br /&gt;
// Horizontal position of the square&lt;br /&gt;
float x_pos;&lt;br /&gt;
void init()&lt;br /&gt;
{&lt;br /&gt;
  // Start the square at the left of the screen&lt;br /&gt;
  x_pos = 0;&lt;br /&gt;
&lt;br /&gt;
  // Set the square to draw yellow&lt;br /&gt;
  CP_Settings_Fill(CP_Color_Create(255, 255, 0, 255));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void update()&lt;br /&gt;
{&lt;br /&gt;
  // Set background to black&lt;br /&gt;
  CP_Settings_Background(CP_Color_Create(0, 0, 0, 255));&lt;br /&gt;
&lt;br /&gt;
  // Draw the square&lt;br /&gt;
  CP_Graphics_DrawRect(x_pos, (float)CP_System_GetWindowHeight()/ 2.0f, 100, 100);&lt;br /&gt;
  x_pos += 2;&lt;br /&gt;
&lt;br /&gt;
  // If space pressed, reset the state &lt;br /&gt;
  if (CP_Input_KeyTriggered(KEY_SPACE))&lt;br /&gt;
  {&lt;br /&gt;
    CP_Engine_SetNextGameStateForced(init, update, NULL);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // If escape is pressed, end the program&lt;br /&gt;
  if (CP_Input_KeyTriggered(KEY_ESCAPE))&lt;br /&gt;
  {&lt;br /&gt;
    CP_Engine_Terminate();&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(void)&lt;br /&gt;
{&lt;br /&gt;
  // Set the initial game state&lt;br /&gt;
  CP_Engine_SetNextGameState(init, update, NULL);&lt;br /&gt;
&lt;br /&gt;
  // Run the program&lt;br /&gt;
  CP_Engine_Run();    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== See Also ===&lt;br /&gt;
* [[GSDP:GAM100/CProcessing                                   |Main Page                         ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Engine_Run()                   |CP_Engine_Run()                   ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Engine_SetNextGameState()      |CP_Engine_SetNextGameState()      ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Engine_SetNextGameStateForced()|CP_Engine_SetNextGameStateForced()]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Engine_GetWindowHandle()       |CP_Engine_GetWindowHandle()       ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Settings_Fill()                |CP_Settings_Fill()                ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Color_Create()                 |CP_Color_Create()                 ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Settings_Background()          |CP_Settings_Background()          ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Graphics_DrawRect()            |CP_Graphics_DrawRect()            ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_System_GetWindowHeight()       |CP_System_GetWindowHeight()       ]]&lt;br /&gt;
* [[GSDP:GAM100/CProcessing/CP_Input_KeyTriggered()           |CP_Input_KeyTriggered()           ]]&lt;/div&gt;</summary>
		<author><name>&gt;Justin.chambers</name></author>
	</entry>
</feed>