Example #1
0
/* Lookup and load web service symbols */
static int map_internals(struct duda_service *ds, struct duda_api_objects *api)
{
    int (*cb_main) (struct duda_service *, struct duda_api_objects *);

    /* Lookup and invoke duda_main() */
    cb_main = (int (*)()) load_symbol(ds->dl_handle, "_duda_bootstrap");
    cb_main(ds, api);


}
Example #2
0
bool App::update()
{
	game_time.update();

	clan::Sizef canvas_size = canvas.get_size();

	// Clear the display in a dark blue nuance
	canvas.clear(clan::Colorf(0.0f,0.0f,0.2f));

	std::string text("ClanLib Benchmark Utility");
	clan::Size text_size = clan::Size(font.measure_text(canvas, text).bbox_size);
	font.draw_text(canvas, ( ( canvas_size.width - text_size.width) / 2), 32, text, clan::Colorf::white);

	int ypos = 96;
	const int ygap = 18;

	if (!priority_class.empty())
	{
		font.draw_text(canvas, 10, ypos, priority_class);
		ypos += ygap;
	}

	if (tests_run_length_microseconds)
	{
		double seconds = (double)tests_run_length_microseconds / 1000000.0;
		font.draw_text(canvas, 10, ypos, clan::string_format("Simulation Test Run Length = %1 seconds", clan::StringHelp::float_to_text(seconds, 2)));
		ypos += ygap;
	}

	if (num_iterations)
	{
		font.draw_text(canvas, 10, ypos, clan::string_format("Using %1 Iterations", num_iterations));
		ypos += ygap;
	}
	font.draw_text(canvas, 10, ypos, "Time");
	font.draw_text(canvas, 80, ypos, ":  Function");
	ypos += ygap;
	for (unsigned int cnt=0; cnt<testlist.size(); cnt++)
	{
		if (testlist[cnt].result != 0.0f)
		{
			clan::Colorf colour = clan::Colorf::white;
			if (testlist_offset == cnt)
				colour = clan::Colorf::green;

			font.draw_text(canvas, 10, ypos, clan::StringHelp::float_to_text(testlist[cnt].result, 1), colour);
			font.draw_text(canvas, 80, ypos, clan::string_format(":  %1", testlist[cnt].name), colour);
			ypos += ygap;
		}
	}

	cb_main();

	return !quit;	
}