Пример #1
0
JNIEXPORT void JNICALL Java_com_jeffboody_a3d_A3DNativeRenderer_NativeDestroy(JNIEnv* env)
{
	assert(env);
	LOGD("debug");

	if(gears_renderer)
	{
		gears_renderer_delete(&gears_renderer);
		a3d_GL_unload();
	}
}
Пример #2
0
void Quit()
{
	if(gears_renderer)
	{
		gears_renderer_delete(&gears_renderer);
	}
	if(Surface && (Surface->flags & SDL_FULLSCREEN))
	{
		SDL_WM_ToggleFullScreen(Surface);
	}
	SDL_Quit();
}
Пример #3
0
int main(int argc, char** argv)
{
	int w = 0;
	int h = 0;
	loax_client_t* c = loax_client_new();
	if(c == NULL)
	{
		return EXIT_FAILURE;
	}

	// Initialize gears renderer
	gears_renderer = gears_renderer_new("whitrabt.texgz");
	if(gears_renderer == NULL)
	{
		return EXIT_FAILURE;
	}

	do
	{
		loax_event_t e;
		while(loax_client_poll(c, &e))
		{
			if((e.type == LOAX_EVENT_TOUCHDOWN) ||
			   (e.type == LOAX_EVENT_TOUCHUP)   ||
			   (e.type == LOAX_EVENT_TOUCHMOVE))
			{
				touch_event(gears_renderer, &e);
			}
			else if(e.type == LOAX_EVENT_AXISMOVE)
			{
				int   axis  = e.event_axis.axis;
				float value = e.event_axis.value;
				if(axis == LOAX_AXIS_X1)
				{
					g_axis_x1 = value;
				}
				else if(axis == LOAX_AXIS_Y1)
				{
					g_axis_y1 = value;
				}
				else if(axis == LOAX_AXIS_X2)
				{
					g_axis_x2 = value;
				}
				else if(axis == LOAX_AXIS_Y2)
				{
					g_axis_y2 = value;
				}
			}
		}

		loax_client_size(c, &w, &h);
		axis_update(gears_renderer, w, h);
		gears_renderer_resize(gears_renderer, w, h);
		gears_renderer_draw(gears_renderer);
	} while(loax_client_swapbuffers(c));

	gears_renderer_delete(&gears_renderer);
	loax_client_delete(&c);

	return EXIT_SUCCESS;
}