Exemplo n.º 1
0
sf::FloatRect World::GetBattlefieldBounds() const
{
	// Return view bounds + some area at top, where enemies spawn
	sf::FloatRect bounds = GetViewBounds();
	bounds.top -= 100.f;
	bounds.height += 100.f;

	return bounds;
}
Exemplo n.º 2
0
int main (int argc, char *argv[])
{
	HDEVICE device;
	HVIEW view;

	if (!(device = OpenDevice(NULL)))
	{
		printf("OpenDevice failed!\n");
	}

	if (!(view = CreateView(NULL, 0, 1000, 800))) {
	
		printf("CreateView failed!\n");
	}

	MoveView(view, 200, 200);

	RECT bounds;
	GetViewBounds(view, &bounds);
	printf("x: %d\n", bounds.x);
	printf("y: %d\n", bounds.y);
	printf("w: %d\n", bounds.width);
	printf("h: %d\n", bounds.height);

//	if (!(device = GetDeviceFromView(view))) {
//		printf("GetDeviceFromView failed!\n");
//	}

	GetViewSurface(device, view);

	printf("getmessage\n");

//	ReleaseDevice(device);

	TASKMSG msg;
	memset(&msg, 0, sizeof(msg));
	while ((msg.type != TASKMSG_EXIT))
	{
		if (TaskWaitMessage(&msg, -1)) {
			continue;
		}

		printf("msg: %d\n", msg.type);
		continue;
	}

	printf("OK\n");

	return 0;
}