Example #1
0
GLUSvoid GLUSAPIENTRY glusShutdown(GLUSvoid)
{
	// Terminate Game
	if (glusTerminate)
	{
		glusTerminate();
	}

	// Shutdown
	glusDestroyWindow(); // Destroy The Window
}
Example #2
0
GLUSvoid GLUSAPIENTRY glusWindowShutdown(GLUSvoid)
{
	// Terminate Game
	if (glusTerminate)
	{
		glusTerminate();
	}

	if (glusWindowIsRecording())
	{
		glusWindowStopRecording();
	}

	// Shutdown
	glusWindowDestroy(); // Destroy The Window
}
Example #3
0
GLUSboolean GLUSAPIENTRY glusRun(GLUSvoid)
{
	// Init Engine
	if (glusInit)
	{
		if (!glusInit())
		{
			glusDestroyWindow(); // Destroy The Window

			return GLUS_FALSE; // Exit The Program
		}
	}

	g_initdone = GLUS_TRUE;

	// Do the first reshape
	if (glusReshape)
	{
		glusReshape(g_width, g_height);
	}

	while (!g_done) // Loop That Runs While done=FALSE
	{
		if (glusUpdate)
		{
			g_done = !glusUpdate(glusGetElapsedTime());
		}

		eglSwapBuffers(g_eglDisplay, g_eglSurface); // Swap Buffers (Double Buffering)

		_glusPollEvents();
	}

	// Terminate Game
	if (glusTerminate)
	{
		glusTerminate();
	}

	// Shutdown
	glusDestroyWindow(); // Destroy The Window

	return GLUS_TRUE; // Exit The Program
}
Example #4
0
GLUSboolean GLUSAPIENTRY glusRun(GLUSvoid)
{
	MSG		msg;									// Windows Message Structure

	GLUSboolean done = GLUS_FALSE;						// Bool Variable To Exit Loop

	// Init Engine
	if (glusInit)
	{
		if (!glusInit())
		{
			glusDestroyWindow();						// Destroy The Window

			return GLUS_FALSE;							// Exit The Program
		}
	}

	g_initdone = GLUS_TRUE;

	// Do the first reshape
	if (glusReshape)
	{
		glusReshape(g_width, g_height);
	}

	while(!done)									// Loop That Runs While done=FALSE
	{
		if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))	// Is There A Message Waiting?
		{
			if (msg.message==WM_QUIT)				// Have We Received A Quit Message?
			{
				done = GLUS_TRUE;					// If So done=TRUE
			}
			else									// If Not, Deal With Window Messages
			{
				TranslateMessage(&msg);				// Translate The Message
				DispatchMessage(&msg);				// Dispatch The Message
			}
		}
		else										// If There Are No Messages
		{
			// Draw The Scene.  Watch For ESC Key
			if (g_active)							// Program Active?
			{
				if (glusUpdate)
				{
					done = !glusUpdate(glusGetElapsedTime());
				}

				if (!done)
				{
					SwapBuffers(g_hDC);				// Swap Buffers (Double Buffering)
				}
			}
		}
	}

	// Terminate Game
	if (glusTerminate)
	{
		glusTerminate();
	}

	// Shutdown
	glusDestroyWindow();							// Destroy The Window

	return GLUS_TRUE;								// Exit The Program
}