当前位置: 首页>>代码示例>>C++>>正文


C++ ISceneManager::drawAll方法代码示例

本文整理汇总了C++中ISceneManager::drawAll方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneManager::drawAll方法的具体用法?C++ ISceneManager::drawAll怎么用?C++ ISceneManager::drawAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISceneManager的用法示例。


在下文中一共展示了ISceneManager::drawAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: irrUpdate

void CIrrWindow::irrUpdate()
{
	// draw document
	IVideoDriver* driver = m_driver;
	ISceneManager* smgr = m_smgr;

	// tick device
	m_device->getTimer()->tick();

	// update particle
	m_particleObject->updateObject();

	// draw 3d scene
	driver->beginScene( true, true, 0, getIView()->getVideoData() );
		
	// draw all scene
	smgr->drawAll();	
	
	int fps = driver->getFPS();
	core::stringw text(L"fps: ");
	text += fps;
	text += L" frame/second";

	irr::gui::IGUIFont* font = smgr->getGUIEnvironment()->getBuiltInFont();
	font->draw( text.c_str(), core::recti( 10, 10, 200, 20), video::SColor(255, 255,0,0) );

	// end scene
	driver->endScene();

}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:30,代码来源:CIrrWindow.cpp

示例2: main

int main(int argc, char** argv) {
  IrrlichtDevice *device=createDevice(EDT_OPENGL,dimension2d<s32>(1024,600),16,false,false,false,0);

  device->setWindowCaption(L"FollowPathAnimator");

  IVideoDriver* driver = device->getVideoDriver();
  ISceneManager* smgr = device->getSceneManager();
  IGUIEnvironment* guienv = device->getGUIEnvironment();

  smgr->loadScene("data/irrOdeMarble_level_.xml");
  ICameraSceneNode *pCam=smgr->addCameraSceneNode(NULL,vector3df(0.0f,0.0f,0.0f),vector3df(1.0f,0.0f,0.0f));

  CFollowPathAnimator *myAnimator=new CFollowPathAnimator(device,"pathToFollow",120,500);
  pCam->addAnimator(myAnimator);
  myAnimator->setCamParameter(pCam);

  while(device->run()) {
    driver->beginScene(true, true, SColor(0,200,200,200));

    smgr->drawAll();
    guienv->drawAll();

    driver->endScene();
  }

  device->drop();
  return 0;
}
开发者ID:tecan,项目名称:IrrlichtDemos,代码行数:28,代码来源:main.cpp

示例3: runTestWithDriver

static bool runTestWithDriver(E_DRIVER_TYPE driverType)
{
	IrrlichtDevice *device = createDevice( driverType, dimension2d<s32>(640, 480));
	if (!device)
		return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs
	
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager * smgr = device->getSceneManager();
	
	// Draw a cube to check that the pixels' alpha is working.
	ISceneNode * cube = smgr->addCubeSceneNode(50.f, 0, -1, vector3df(0, 0, 60));
	cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp"));
	cube->setMaterialFlag(video::EMF_LIGHTING, false);
	(void)smgr->addCameraSceneNode();

	driver->beginScene(true, true, SColor(255,100,101,140));
	smgr->drawAll();

	// Test for offscreen values as well as onscreen.
	for(s32 x = -10; x < 650; ++x)
	{
		s32 y = 480 * x / 640;
		driver->drawPixel((u32)x, (u32)y, SColor(255, 255 * x / 640, 255 * (640 - x) / 640, 0));
		y = 480 - y;
		driver->drawPixel((u32)x, (u32)y, SColor(255 * x / 640, 0, 255, 255));
	}

	driver->endScene();

	bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawPixel.jpg");

	device->drop();

	return result;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:35,代码来源:drawPixel.cpp

示例4: drawDocument

// drawDocument
// draw documen by frame
void CDocument::drawDocument()
{
	// draw document
	IVideoDriver* driver = getIView()->getDriver();
	ISceneManager* smgr = getIView()->getSceneMgr();

	// draw 3d scene
	driver->beginScene( true, true, SColor(255,30,30,30), getIView()->getVideoData() );
		
	// draw all scene
	smgr->drawAll();

	// controller draw imp
	CControllerManager::getInstance()->getCurrentController()->render();
	
	int fps = driver->getFPS();
	core::stringw text(L"fps: ");
	text += fps;
	text += L" frame/second \n";

	int primitiveDraw =	driver->getPrimitiveCountDrawn();
	text += L"primitive: ";
	text += primitiveDraw;

	irr::gui::IGUIFont* font = smgr->getGUIEnvironment()->getBuiltInFont();
	font->draw( text.c_str(), core::recti( 10, 10, 200, 20), video::SColor(255, 255,0,0) );

	// end scene
	driver->endScene();
}
开发者ID:codeman001,项目名称:gsleveleditor,代码行数:32,代码来源:CDocument.cpp

示例5: burningsVideo

/** Tests the Burning Video driver */
bool burningsVideo(void)
{
    IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO,
										core::dimension2di(160,120), 32);
    if (!device)
        return false;

    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();

    smgr->addCubeSceneNode(10.f, 0, -1, core::vector3df(0.f, 0.f, 20.f));
    smgr->addCameraSceneNode();
    // Test that ambient lighting works when there are no other lights in the scene
    smgr->setAmbientLight(video::SColorf(.7f, .1f, .1f, 1.f));

    bool result = false;
    device->run();
	if (driver->beginScene(true, true, video::SColor(0, 80, 80, 80)))
	{
		smgr->drawAll();
		driver->endScene();
		result = takeScreenshotAndCompareAgainstReference(driver, "-ambient-lighting.png", 100);
	}

    device->drop();

    return result;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:29,代码来源:burningsVideo.cpp

示例6: main

 int main()
 {
    IrrlichtDevice* irrDevice   = createDevice(EDT_OPENGL,dimension2d<s32>(800,600),32,false,false,false,0);
    IVideoDriver*   irrVideo    = irrDevice->getVideoDriver();
    ISceneManager*  irrSceneMgr = irrDevice->getSceneManager();
    TMovie* movie = new TMovie(irrDevice->getTimer());
    movie->LoadMovie("Mymovie.avi");
    irrVideo->setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false);
    u32 w = movie->getMovieWidth();
    u32 h = movie->getMovieHeight();
    ITexture* movTxtr = irrVideo->addTexture(dimension2d<s32>(w<513?512:1024,h<513?512:1024),"imovie"); 
    irrSceneMgr->addCameraSceneNode(0, vector3df(0,0,-20), vector3df(0,0,0));
    CSampleSceneNode* myNode = new CSampleSceneNode(irrSceneMgr->getRootSceneNode(), irrSceneMgr, 666);
    myNode->setMaterialTexture( 0, movTxtr);
    myNode->drop();
    ISceneNodeAnimator* anim = irrSceneMgr->createRotationAnimator(vector3df(0,0.1f,0));
    myNode->addAnimator(anim);
    anim->drop();
 
    while(irrDevice->run())
     {
        irrVideo->beginScene(true, true, SColor(0,200,200,200));
                  if (movie->NextMovieFrame())
                    movie->DrawMovie(0,0,movTxtr);
                  irrSceneMgr->drawAll();
        irrVideo->endScene();
     }       
    irrDevice->drop();

    return 0;
}
开发者ID:tecan,项目名称:IrrlichtDemos,代码行数:31,代码来源:hybridVideoTexture.cpp

示例7: Show

void Menu::Show()
{
    using namespace gui;
    using namespace scene;

    // draw overlay menu
    IrrlichtDevice* device = Device::Instance().IrrlichtDevice();
    gui::IGUIEnvironment* guiEnvironment = device->getGUIEnvironment();

    // change event receiver
    irr::IEventReceiver* eventReceiverBackup = device->getEventReceiver();
    device->setEventReceiver(this);

    guiEnvironment->addButton(core::recti(10,10,100,30), 0, GUI_ID_CONTINUE, L"Continue");
    guiEnvironment->addButton(core::recti(10,40,100,60), 0, GUI_ID_EXIT, L"Exit");

    video::IVideoDriver* driver = Device::Instance().Driver();
    ISceneManager* sceneManager = Device::Instance().SceneManager();
    isShowing_ = true;
    do
    {
        driver->beginScene(true, true, video::SColor(255,0,0,0));
        sceneManager->drawAll();
        guiEnvironment->drawAll();
        driver->endScene();
    }while(device->run() && isShowing_);

    // return event receiver
    device->setEventReceiver(eventReceiverBackup);
}
开发者ID:iHateInventNames,项目名称:Cars,代码行数:30,代码来源:Menu.cpp

示例8: main

int main()
{

	IDevice* device = createDevice(EDT_DIRECT3D11, 800, 600);
	IVideoDriver* driver = device->getVideoDriver();
	IResourceGroupManager* resourceGroupManager = driver->getResourceGroupManager();
	resourceGroupManager->init("Resources.cfg");

	IInputDriver* input = device->getInputDriver();

	ISceneManager* smgr = setupScene(device);
	driver->setDeferredShading(true);
	ITimer* timer = device->getTimer();
	timer->reset();

	const f32 color[] = { 0, 0, 0, 1.0f };
	while (device->run()) {
		float dt = timer->tick();
		if (input->keyDown(GVK_ESCAPE))
			break;

		smgr->update(dt);
		driver->beginScene(true, true, color);
		smgr->drawAll();
		driver->endScene();
	}

	smgr->destroy();
	device->drop();

	return 0;
}
开发者ID:whztt07,项目名称:GameFinal,代码行数:32,代码来源:main.cpp

示例9: main

int main(int argc, char** argv)
{
    IrrlichtDevice* device = createDevice(video::EDT_OPENGL, dimension2d<u32>(800, 600), 16, false, false, false, 0);
    
    if (!device) {
        return 1;
    }
    
    
    device->setWindowCaption(L"boxes");
    
    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
    
    IMeshSceneNode* cube = smgr->addCubeSceneNode();
    
    smgr->addCameraSceneNode(0);
    
    while (device->run()) {
        driver->beginScene();
        
        smgr->drawAll();
        
        driver->endScene();
    }
    
    return 0;
}
开发者ID:angelleecash,项目名称:products,代码行数:28,代码来源:main.cpp

示例10: main

int main()
{
	IDevice* device = createDevice(EDT_DIRECT3D11, 800, 600);
	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->createSceneManager();

	ITimer* timer = device->getTimer();
	timer->reset();

	// test
	XMFLOAT4 plane(0, 1.0f, 0, 0);
	XMFLOAT3 p(1.0f, 3.0f, -2.0f);
	XMFLOAT3 p2 = math::ComputeMirrorPointAboutPlane(plane, p);
	std::cout << p2.x << "," << p2.y << "," << p2.z << std::endl;

	const f32 color[] = { 0, 1.0f, 0, 1.0f };
	while (device->run()) {
		driver->beginScene(true, true, color);

		float dt = timer->tick();
		smgr->update(dt);
		smgr->drawAll();

		driver->endScene();
	}

	smgr->destroy();
	device->drop();
	return 0;
}
开发者ID:whztt07,项目名称:GameFinal,代码行数:30,代码来源:main.cpp

示例11: testTransparentVertexAlphaMore

bool testTransparentVertexAlphaMore(E_DRIVER_TYPE driverType)
{
	IrrlichtDevice *device = createDevice(driverType, dimension2d<u32>(160, 120));
	if (!device)
		return true;

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->getSceneManager();

	if (driver->getColorFormat() != video::ECF_A8R8G8B8)
	{
		device->closeDevice();
		device->run();
		device->drop();
		return true;
	}

	logTestString("Testing driver %ls\n", driver->getName());

	IAnimatedMesh* mesh = smgr->getMesh("../media/sydney.md2");
	IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
	IMeshSceneNode* cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(-5,3,-15));

	if (node)
	{
		node->setMaterialFlag(EMF_LIGHTING, false);
		node->setFrameLoop(0, 310);
		node->setMaterialTexture( 0, driver->getTexture("../media/sydney.bmp") );
	}
	if (cube)
	{
		cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA;
		cube->setMaterialTexture(0, driver->getTexture("../media/wall.bmp"));
		cube->setMaterialFlag(EMF_LIGHTING, false);
		smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128);
	}
	// second cube without texture
	cube = smgr->addCubeSceneNode(10.0f,0,-1,vector3df(5,3,-15));
	if (cube)
	{
		cube->getMaterial(0).MaterialType = EMT_TRANSPARENT_VERTEX_ALPHA;
		cube->setMaterialFlag(EMF_LIGHTING, false);
		smgr->getMeshManipulator()->setVertexColorAlpha(cube->getMesh(),128);
	}

	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

	driver->beginScene(true, true, SColor(0,200,200,200));
	smgr->drawAll();
	driver->endScene();

	bool result = takeScreenshotAndCompareAgainstReference(driver, "-transparentVertexAlphaChannelMore.png", 99.18f);

	device->closeDevice();
	device->run();
	device->drop();

	return result;
}
开发者ID:Badcreature,项目名称:sagcg,代码行数:59,代码来源:transparentMaterials.cpp

示例12: viewPortText

/** The result should be as follows: We have three times the same image, a billboard with a cube and the text in front.
They are replicated three times, one centered in the screen without viewport, one in the upper left (qurter screen) and
one on the right (half screen). The latter is stretched due to the changed aspect ratio.
The two viewport scenes get the texture drawn over the center as well, using draw2dimage. This should mark the proper
image position with the top left corner of the texture.
Finally, each scene has a checkbox drawn at the left side, vertically centered. This will show whether GUI elements adhere
to viewports as well. */
static bool viewPortText(E_DRIVER_TYPE driverType)
{
	IrrlichtDevice *device = createDevice( driverType, dimension2d<u32>(160, 120), 32);
	if (!device)
		return true; // Treat a failure to create a driver as benign; this saves a lot of #ifdefs

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager * smgr = device->getSceneManager();
	IGUIEnvironment* env = smgr->getGUIEnvironment();

	stabilizeScreenBackground(driver);

	env->addCheckBox(true, core::recti(10,60,28,82));

	logTestString("Testing driver %ls\n", driver->getName());

	IBillboardSceneNode * bnode = smgr->addBillboardSceneNode(0,dimension2d<f32>(32,32),core::vector3df(0,0,10));
	bnode->setMaterialFlag(video::EMF_LIGHTING, false);
	bnode->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR);
	bnode->setMaterialTexture(0, driver->getTexture("../media/fire.bmp"));

	smgr->addTextSceneNode(device->getGUIEnvironment()->getBuiltInFont(), L"TEST", video::SColor(255,255,255,255), 0);
	smgr->addCubeSceneNode();
	smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));

	driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
	smgr->drawAll();
	env->drawAll();
	driver->setViewPort(rect<s32>(0,0,160/2,120/2));
	smgr->drawAll();
	env->drawAll();
	driver->draw2DImage(driver->getTexture("../media/fire.bmp"), core::vector2di(160/2,120/2));
	driver->setViewPort(rect<s32>(160/2,0,160,120));
	smgr->drawAll();
	env->drawAll();
	driver->draw2DImage(driver->getTexture("../media/fire.bmp"), core::vector2di(160/2,120/2));
	driver->endScene(); 

	bool result = takeScreenshotAndCompareAgainstReference(driver, "-viewPortText.png", 98.71f);

	device->closeDevice();
	device->run();
	device->drop();

	return result;
}
开发者ID:Alberto-Izquierdo,项目名称:irrlicht,代码行数:53,代码来源:viewPort.cpp

示例13: main

int main()
{
	int rows = 10, colums = 10;
	printf("Number of stack rows: ");
	cin >> rows;
	printf("\nNumber of stack colums: ");
	cin >> colums;
	CReceiver receiver;
	IrrlichtDevice *device = createDevice(EDT_DIRECT3D9, dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
	IVideoDriver *driver = device->getVideoDriver();
	ISceneManager *smgr = device->getSceneManager();
	IGUIEnvironment *guienv = device->getGUIEnvironment();
	device->setWindowCaption(L"HelloWorld");
	irrBulletWorld * world = createIrrBulletWorld(device, true, true);
	world->setDebugMode(EPDM_DrawAabb | EPDM_DrawContactPoints);
	world->setGravity(core::vector3df(0, -10, 0));
	createWorld(rows, colums, device, world);
	scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
	camera->setPosition(core::vector3df(50, 15, 200));
	u32 then = device->getTimer()->getTime();
	while (device->run())
	{
		const u32 now = device->getTimer()->getTime();
		const f32 frameDeltaTime = (f32)(now - then) / 1000.f; // в секундах
		then = now;
		if (receiver.isMouseDown(EMIE_RMOUSE_PRESSED_DOWN))
		{
			core::vector3df pos(camera->getPosition().X, camera->getPosition().Y, camera->getPosition().Z);
			scene::ISceneNode *Node = smgr->addCubeSceneNode();
			Node->setScale(core::vector3df(0.2, 0.2, 0.2));
			Node->setPosition(pos);
			Node->setMaterialFlag(video::EMF_LIGHTING, false);
			Node->setMaterialTexture(0, driver->getTexture("../rockwall.jpg"));
			ICollisionShape *shape = new IBoxShape(Node, 1, true);
			IRigidBody *body = world->addRigidBody(shape);
			body->setDamping(0.2, 0.2);
			body->setFriction(0.4f);
			body->setGravity(core::vector3df(0, -10, 0));
			core::vector3df rot = camera->getRotation();
			core::matrix4 mat;
			mat.setRotationDegrees(rot);
			core::vector3df forwardDir(core::vector3df(mat[8], mat[9], mat[10]) * 120);
			body->setLinearVelocity(forwardDir);
		}

		driver->beginScene(true, true, video::SColor(255, 100, 101, 140));
		world->stepSimulation(frameDeltaTime, 120);
		world->debugDrawWorld(true);
		world->debugDrawProperties(true);
		smgr->drawAll();
		guienv->drawAll();
		driver->endScene();

		if (world) delete world;
		device->drop();
		return 0;
	}
}
开发者ID:AlecseyUsenco,项目名称:IrrBullet,代码行数:58,代码来源:main.cpp

示例14: b3dAnimation

/** Verify that two skinned animated mesh scene nodes can use different frames of the skinned mesh */
bool b3dAnimation(void)
{
	// Use EDT_BURNINGSVIDEO since it is not dependent on (e.g.) OpenGL driver versions.
	IrrlichtDevice *device = createDevice( EDT_BURNINGSVIDEO, dimension2d<s32>(160, 120), 32);
	assert(device);
	if (!device)
		return false;

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager * smgr = device->getSceneManager();

	IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
	IAnimatedMeshSceneNode* node1;
	IAnimatedMeshSceneNode* node2;
	assert(mesh);

	bool result = false;
	if(mesh)
	{
		node1 = smgr->addAnimatedMeshSceneNode(mesh);
		assert(node1);

		if(node1)
		{
			node1->setPosition(vector3df(-3, -3, 10));
			node1->setMaterialFlag(EMF_LIGHTING, false);
			node1->setAnimationSpeed(0.f);
		}

		node2 = smgr->addAnimatedMeshSceneNode(mesh);
		assert(node2);
		if(node2)
		{
			node2->setPosition(vector3df(3, -3, 10));
			node2->setMaterialFlag(EMF_LIGHTING, false);
			node2->setAnimationSpeed(0.f);
			node2->setCurrentFrame(62.f);
		}

		(void)smgr->addCameraSceneNode();

		// Just jump to the last frame since that's all we're interested in.
		device->run();
		driver->beginScene(true, true, SColor(255, 255, 255, 0));
		smgr->drawAll();
		driver->endScene();

		result = takeScreenshotAndCompareAgainstReference(driver, "-b3dAnimation.png");
	}

	device->drop();

	return result;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:55,代码来源:b3dAnimation.cpp

示例15: main

int main()
{
	SDeviceContextSettings settings;
	settings.MultiSamplingCount = 4;
	settings.MultiSamplingQuality = 32;
	IApplication* device = createDevice(EDT_DIRECT3D11, 800, 600, EWS_NONE, true, settings);

	IVideoDriver* driver = device->getVideoDriver();
	ISceneManager* smgr = device->createSceneManager();
	IMeshManager* meshManager = driver->getMeshManager();

	IResourceGroupManager* resourceGroupManager = driver->getResourceGroupManager();
	resourceGroupManager->init("Resources.cfg");
	//resourceGroupManager->loadResourceGroup("General");

	XMFLOAT3 vertices[4];
	vertices[0] = XMFLOAT3(-10.0f, 0.0f, 10.0f);
	vertices[1] = XMFLOAT3(10.0f, 0.0f, 10.0f);
	vertices[2] = XMFLOAT3(-10.0f, 0.0f, -10.0f);
	vertices[3] = XMFLOAT3(10.0f, 0.0f, -10.0f);

	ISimpleMesh* mesh = meshManager->createSimpleMesh("pointlist", EVF_POSITION, 
		vertices, NULL, 4, sizeof(XMFLOAT3), 0, math::SAxisAlignedBox(), false);
	IMeshNode* meshNode = smgr->addMeshNode(mesh, nullptr, nullptr);
	meshNode->setMaterialName("test/ts_material");
	meshNode->setNeedCulling(false);

	ICameraNode* camera = smgr->addFpsCameraNode(1, nullptr, XMFLOAT3(0, 1.0f, -4.0f), XMFLOAT3(0, 1.0f, 0.0f));
	char caption[200];

	ITimer* timer = device->getTimer();
	timer->reset();

	while (device->run())
	{
		const float clearColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
		driver->beginScene(true, true, clearColor);

		float dt = timer->tick() * 0.001f;
		updateCamera(camera, dt);

		smgr->update(dt);
		smgr->drawAll();

		driver->endScene();

		sprintf(caption, "FPS:%f", getFps(dt));
		device->setWindowCaption(caption);
	}

	device->drop();

	return 0;
}
开发者ID:woyaofacai,项目名称:GameFinal,代码行数:54,代码来源:main.cpp


注:本文中的ISceneManager::drawAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。