//! runs the device. Returns false if device wants to be deleted
bool CIrrDeviceWinCE::run()
{
	os::Timer::tick();

	MSG msg;

	bool quit = false;

	while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
	{
		TranslateMessage(&msg);

		if (ExternalWindow && msg.hwnd == HWnd)
			WndProc(HWnd, msg.message, msg.wParam, msg.lParam);
		else
			DispatchMessage(&msg);

		if (msg.message == WM_QUIT)
			quit = true;
	}

	if (!quit)
		resizeIfNecessary();

	_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
	return !quit;
}
bool ConcurrentPtrHashSet::resizeAndAdd(void* ptr)
{
    resizeIfNecessary();
    return add(ptr);
}
Esempio n. 3
0
//--------------------------------------------------------------
bool Sprite::processOscMessage(const ofxOscMessage& message) {
	
	// call the base class
	if(DrawableObject::processOscMessage(message)) {
		return true;
	}


	if(message.getAddress() == oscRootAddress + "/position") {
		tryNumber(message, pos.x, 0);
		tryNumber(message, pos.y, 1);
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/position/x") {
		tryNumber(message, pos.x, 0);
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/position/y") {
		tryNumber(message, pos.y, 0);
		return true;
	}
	
	
	else if(message.getAddress() == oscRootAddress + "/size") {
		tryNumber(message, width, 0);
		tryNumber(message, height, 1);
		resizeIfNecessary();
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/size/width") {
		tryNumber(message, width, 0);
		resizeIfNecessary();
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/size/height") {
		tryNumber(message, height, 0);
		resizeIfNecessary();
		return true;
	}

	else if(message.getAddress() == oscRootAddress + "/frame") {
		unsigned int frame = 0;
		tryNumber(message, frame, 0);
		gotoFrame(frame);
		return true;
	}


	else if(message.getAddress() == oscRootAddress + "/animate") {
		tryBool(message, bAnimate, 0);
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/loop") {
		tryBool(message, bLoop, 0);
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/pingpong") {
		tryBool(message, bPingPong, 0);
		return true;
	}
	
	else if(message.getAddress() == oscRootAddress + "/center") {
		bool b = bDrawFromCenter;
		if(tryBool(message, b, 0)) {
			setDrawFromCenter(b);
		}
		return true;
	}
	else if(message.getAddress() == oscRootAddress + "/overlay") {
		tryBool(message, bDrawAllLayers, 0);
		return true;
	}

	return false;
}