Exemplo n.º 1
0
	void CViewWindow::_create()
	{
		//
		_material = RenderEngineImp::getInstancePtr()->getRenderEngine()->getMaterialManager()->createMaterial(Zen::eMaterialType_Vertex);
		_material->setEffect("shader\\Position.fx");
		//
		Zen::sPosition vertices[3];
		vertices[0].position = Vec3(-1.0f, 0.0f, 0.0f);
		vertices[1].position = Vec3(0.0f, 1.0f, 0.0f);
		vertices[2].position = Vec3(1.0f, 0.0f, 0.0f);
		_vb = RenderEngineImp::getInstancePtr()->getRenderEngine()->getBufferManager()->createVertexBuffer(3 * _material->getStride(), Zen::eUsage_WriteOnly, Zen::ePool_Manager);
		void* data = _vb->lock(0, 0, Zen::eLock_Null);
		memcpy(data, vertices, 3 * _material->getStride());
		_vb->unLock();
		//
		//
		RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->createFont(std::string("freetype\\LuYaHeiMb.TTF"), 16, Zen::eFontProperty_Normal, "freeNormal");
		RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->createFont(std::string("freetype\\LuYaHeiMb.TTF"), 28, Zen::eFontProperty_Offset_1, "freeOffset1");
		RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->createFont(std::string("freetype\\LuYaHeiMb.TTF"), 28, Zen::eFontProperty_BG_1, "freeBG1");
		_font[Zen::eFontProperty_Normal] = RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->getFont(std::string("freeNormal"));
		_font[Zen::eFontProperty_Offset_1] = RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->getFont(std::string("freeOffset1"));
		_font[Zen::eFontProperty_BG_1] = RenderEngineImp::getInstancePtr()->getRenderEngine()->getFontManager()->getFont(std::string("freeBG1"));
		//	
		_sphere.create();
		//
		mSculptor.create();
		//
		EventManager::getInstancePtr()->subscribeEvent(eEvent_SculptorRadiusChanged, SubscriberSlot(&CViewWindow::updateSculptorRadius, this));
		EventManager::getInstancePtr()->subscribeEvent(eEvent_SculptorStrengthChanged, SubscriberSlot(&CViewWindow::updateSculptorStrength, this));
	}
Exemplo n.º 2
0
Window *DFMenuRoot::getItem(const string &parentId)
{
    auto button = DFMenuBase::getItem(parentId);
    button->subscribeEvent(PushButton::EventClicked, SubscriberSlot(&DFMenuRoot::onClick, this));
    createLayout();
    
    return button;
}
Exemplo n.º 3
0
void ButtonMenuLayout::create()
{
    WindowManager &wmgr = WindowManager::getSingleton();
    container = static_cast<VerticalLayoutContainer *>(wmgr.createWindow("VerticalLayoutContainer"));
    parentWindow->addChildWindow(container);

    container->setPosition(UVEC2(static_cast<float>(minX), static_cast<float>(minY)));

    if (hideAnimation)
    {
        instHideAnimation = AnimationManager::getSingleton().instantiateAnimation(hideAnimation);
        instHideAnimation->setTargetWindow(container);
        container->subscribeEvent(AnimationInstance::EventAnimationEnded, 
            SubscriberSlot(&ButtonMenuLayout::onAnimationEnd, this));
    }

    if (showAnimation)
    {
        instShowAnimation = AnimationManager::getSingleton().instantiateAnimation(showAnimation);
        instShowAnimation->setTargetWindow(container);
    }
}
Exemplo n.º 4
0
BoundSlot::BoundSlot(Group group, const SubscriberSlot& subscriber, Event& event) :
    d_group(group),
    d_subscriber(CEGUI_NEW_AO SubscriberSlot(subscriber)),
    d_event(&event)
{}