本文整理汇总了C++中ISceneManager::addCubeSceneNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ISceneManager::addCubeSceneNode方法的具体用法?C++ ISceneManager::addCubeSceneNode怎么用?C++ ISceneManager::addCubeSceneNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISceneManager
的用法示例。
在下文中一共展示了ISceneManager::addCubeSceneNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: LoadScene
void Editor::LoadScene()
{
IVideoDriver *driver = device->getVideoDriver();
ISceneManager *smgr = device->getSceneManager();
// Calculate Projection Matrix
matrix4 projMat;
irr::f32 orth_w = (float)(driver->getScreenSize().Width - 256) / (float)driver->getScreenSize().Height;
orth_w = 3 * orth_w;
projMat.buildProjectionMatrixOrthoLH(orth_w, 3, 1, 100);
// Create target
target = smgr->addEmptySceneNode(0, 200);
target->setPosition(vector3df(0, 0, 0));
// Add rotational camera
pivot = smgr->addEmptySceneNode(target, 199);
camera[0] = smgr->addCameraSceneNode(NULL, vector3df(0, 0, -2), vector3df(0, 0, 0));
camera[0]->setParent(pivot);
pivot->setRotation(vector3df(25, -45, 0));
// Add Topdown camera
camera[1] = smgr->addCameraSceneNode(target, vector3df(0, 2, -0.01), vector3df(0, 0, 0));
camera[1]->setProjectionMatrix(projMat, true);
// Add front camera
camera[2] = smgr->addCameraSceneNode(target, vector3df(0, 0, -5), vector3df(0, 0, 0));
camera[2]->setProjectionMatrix(projMat, true);
// Add side camera
camera[3] = smgr->addCameraSceneNode(target, vector3df(5, 0, 0), vector3df(0, 0, 0));
camera[3]->setProjectionMatrix(projMat, true);
// Add Light
ILightSceneNode* light = smgr->addLightSceneNode(target, vector3df(25, 50, 0));
light->setLightType(ELT_POINT);
light->setRadius(2000);
// Add Plane
IMeshSceneNode* plane = smgr->addCubeSceneNode(1, 0, -1,
vector3df(0.5, -5.5, 0.5), vector3df(0, 0, 0),
vector3df(10, 10, 10));
plane->setMaterialTexture(0, driver->getTexture("media/texture_terrain.png"));
plane->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
plane->getMaterial(0).getTextureMatrix(0).setTextureScale(10, 10);
// Add sky box
scene::IMeshSceneNode* skybox = smgr->addCubeSceneNode(50);
skybox->setMaterialTexture(0, driver->getTexture("media/sky.jpg"));
skybox->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
skybox->setMaterialFlag(video::EMF_LIGHTING, false);
smgr->getMeshManipulator()->flipSurfaces(skybox->getMesh());
state->plane_tri = smgr->createOctreeTriangleSelector(skybox->getMesh(), skybox);
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
}
示例7: main
int main()
{
eventReceiver receiver;
IrrlichtDevice *device = createDevice( video::EDT_OPENGL, dimension2d<u32>(1366, 768), 16,true, false, false,&receiver);
device->setWindowCaption(L"(WhizGeek || Mclightning).com");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
scene::ICameraSceneNode* kam= smgr->addCameraSceneNode(NULL,vector3df(0,0,200),vector3df(0,0,0));
//kam->setPosition(vector3df(0,0,200));
ISceneNode* kutu=smgr->addCubeSceneNode(50,0,2,vector3df(50,0,0));
ISceneNode* kutu2=smgr->addCubeSceneNode(50,0,2,vector3df(-50,0,0));
ITexture *duvar=driver->getTexture("wall.jpg");
kutu->setMaterialTexture(0,duvar);
kutu->setMaterialFlag(video::EMF_LIGHTING, false);
kutu2->setMaterialTexture(0,duvar);
kutu2->setMaterialFlag(video::EMF_LIGHTING, false);
IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation(scene::EMAT_STAND);
node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
node->setRotation(vector3df(0,270,0));
irFinder ir("test",true,230,255);
CvPoint in;
while(device->run())
{
if(receiver.IsKeyDown(KEY_ESCAPE))
{
device->drop();
return 0;
}
driver->beginScene(true, true, SColor(255,0,0,255));
in=ir.yenile();
//node->setPosition(vector3df(30*in.x/320,30*(240-in.y)/240,0));
kam->setPosition(vector3df(in.x-160,(240-in.y),200));
smgr->drawAll();
driver->endScene();
}
device->drop();
}
示例8: LoadScene
void Editor::LoadScene()
{
IVideoDriver *driver = device->getVideoDriver();
ISceneManager *smgr = device->getSceneManager();
// Create target
target = smgr->addEmptySceneNode(0, 200);
target->setPosition(vector3df(0, 0, 0));
// Create cameras
pivot = smgr->addEmptySceneNode(target, 199);
pivot->setRotation(vector3df(25, -45, 0));
recreateCameras();
// Add Light
ILightSceneNode* light = smgr->addLightSceneNode(target, vector3df(25, 50, 0));
light->setLightType(ELT_POINT);
light->setRadius(2000);
// Add Plane
plane = smgr->addCubeSceneNode(1, 0, -1,
vector3df(0.5, -5.5, 0.5), vector3df(0, 0, 0),
vector3df(10, 10, 10));
plane->setMaterialTexture(0, driver->getTexture("media/texture_terrain.png"));
plane->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
plane->setMaterialFlag(video::EMF_LIGHTING, false);
plane->setMaterialFlag(video::EMF_BACK_FACE_CULLING, true);
plane->getMaterial(0).getTextureMatrix(0).setTextureScale(10, 10);
// Add sky box
scene::IMeshSceneNode* skybox = smgr->addCubeSceneNode(50);
skybox->setMaterialTexture(0, driver->getTexture("media/sky.jpg"));
skybox->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
skybox->setMaterialFlag(video::EMF_LIGHTING, false);
smgr->getMeshManipulator()->flipSurfaces(skybox->getMesh());
state->plane_tri = smgr->createOctreeTriangleSelector(skybox->getMesh(), skybox);
}
示例9: doTestWith
/** Test the behaviour of makeColorKeyTexture() using both 16 bit (software)
and 32 bit (Burning) textures, with the new behaviour and the legacy
behaviour. */
static bool doTestWith(E_DRIVER_TYPE driverType,
bool zeroTexels)
{
IrrlichtDevice *device = createDevice( driverType,
dimension2d<u32>(160, 120), 32);
if (!device)
return false;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
// Draw a cube background so that we can check that the keying 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);
ITexture * Texture = device->getVideoDriver()->getTexture("../media/portal2.bmp");
device->getVideoDriver()->makeColorKeyTexture(Texture,
position2d<s32>(64,64),
zeroTexels);
device->getVideoDriver()->makeColorKeyTexture(Texture,
position2d<s32>(64,64),
zeroTexels);
(void)smgr->addCameraSceneNode();
driver->beginScene(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
driver->draw2DImage(Texture,
position2di(40, 40),
rect<s32>(0, 0, Texture->getSize().Width, Texture->getSize().Height),
0,
SColor(255,255,255,255),
true);
driver->endScene();
char screenshotName[256];
(void)snprintf_irr(screenshotName, 256, "-makeColorKeyTexture-%s.png",
zeroTexels? "old" : "new");
bool result = takeScreenshotAndCompareAgainstReference(driver, screenshotName);
device->closeDevice();
device->run();
device->drop();
return result;
}
示例10: generateSingleCube
ISceneNode* Background::generateSingleCube(vector3df Size, vector3df Position, bool Transparency, char* TexturePath, irr::f32 SpeedHorizontal, irr::f32 SpeedInwards, IrrlichtDevice* Device, Level Lvl)
{
IVideoDriver* driver = Device->getVideoDriver();
ISceneManager* smgr = Device->getSceneManager();
ISceneNode* cube = smgr->addCubeSceneNode();
cube->setScale(Size);
cube->setPosition(Position);
cube->setMaterialTexture(0,driver->getTexture(TexturePath));
cube->setMaterialFlag(video::EMF_LIGHTING, false);
if(Transparency) cube->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
return cube;
}
示例11:
BgMovableObject::BgMovableObject(Level* L, Point position, Point scale, char* TexturePath, int t, Point mov){
movement=mov;
type = t;
IVideoDriver* driver = L->driver;
ISceneManager* smgr = L->smgr;
graphic_model= smgr->addCubeSceneNode();
graphic_model->setMaterialFlag(video::EMF_LIGHTING, true);
graphic_model->setMaterialTexture(0, driver->getTexture(TexturePath));
graphic_model->setMaterialFlag(video::EMF_LIGHTING, false);
graphic_model->setPosition(core::vector3df(position.position_x, position.position_y, position.layer));
graphic_model->setScale(core::vector3df(scale.position_x, scale.position_y, scale.layer));
graphic_model->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
}
示例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;
}
示例13: Init
void Player::Init(UnitObject* pUnit,ITriangleSelector* pTerrain)
{
Irrdevice* pDevice = Irrdevice::GetInstance();
m_pUnitObject = pUnit;
ISceneManager* pSmgr = pDevice->GetSceneManager();
SKeyMap aKeyMap[5];
aKeyMap[0].Action = EKA_MOVE_FORWARD;
aKeyMap[0].KeyCode = KEY_KEY_W;
aKeyMap[1].Action = EKA_MOVE_BACKWARD;
aKeyMap[1].KeyCode = KEY_KEY_S;
aKeyMap[2].Action = EKA_STRAFE_LEFT;
aKeyMap[2].KeyCode = KEY_KEY_A;
aKeyMap[3].Action = EKA_STRAFE_RIGHT;
aKeyMap[3].KeyCode = KEY_KEY_D;
aKeyMap[4].Action = EKA_JUMP_UP;
aKeyMap[4].KeyCode = KEY_SPACE;
//각 유닛마다 카메라 생성
m_pCamera = pSmgr->addCameraSceneNodeFPS(0,100.0f,0.5f,-1,aKeyMap,9,false,0,false,false);
m_pCollisionAnimator = static_cast<ISceneNodeAnimatorCameraFPS*>(*(m_pCamera->getAnimators().begin())); //카메라가 가지고 있는 FPS 카메라 애니메이션 을 가지온다. 이것은 줌 확대 기능 등!!
//카메라 따라댕기는 유닉 오브젝트... 방향에 대한것도 설정해줘야함... 이것은 일단 나중에 테스트를 위하여
m_pUnitObject->GetAnimatedNode()->setParent(m_pCamera);
IMeshSceneNode* pNode = pSmgr->addCubeSceneNode(10,m_pCamera);
m_pCamera->addChild(pUnit->GetAnimatedNode());
pNode->setVisible(true);
m_pMyTriangle = pSmgr->createTriangleSelector(pNode->getMesh(),pNode);
m_pMetaTriangle = pSmgr->createMetaTriangleSelector();
m_pMetaTriangle->addTriangleSelector(pTerrain);
//역시 스크립트 적용 안할 수가 없다... 파일을 읽어와서 적용하던지.... 아우
ISceneNodeAnimatorCollisionResponse * pani = pSmgr->createCollisionResponseAnimator(m_pMetaTriangle,m_pCamera);
m_pCamera->addAnimator(pani);
pani->drop();
}
示例14: main
int main()
{
MyEventReceiver receiver;
IrrlichtDevice* device = createDevice(video::EDT_OPENGL,
core::dimension2d<u32>(640, 480), 16, false, false, false, &receiver);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
smgr->addLightSceneNode(0,vector3df(50,50,50));
ICameraSceneNode *camera = smgr->addCameraSceneNode();
IMeshSceneNode *node = smgr->addCubeSceneNode();
node->setPosition(vector3df(0,75,0));
camera->setTarget(vector3df(0,1,0));
smgr->getMeshManipulator()->setVertexColors(node->getMesh(), SColor(0,0,255,255));
smgr->addLightSceneNode();
while(device->run()){
if(receiver.IsKeyDown(irr::KEY_LEFT)){
node->setPosition(node->getPosition()+vector3df(0,0,-0.1));
}
else if(receiver.IsKeyDown(irr::KEY_RIGHT)){
node->setPosition(node->getPosition()+vector3df(0,0,0.1));
}
else if(receiver.IsKeyDown(irr::KEY_SPACE)){
}
driver->beginScene(true, true, SColor(123,100,100,100));
smgr->drawAll();
driver->endScene();
}
return 0;
}
示例15: lineRender
/** Expect to see two diagonal lines overlaying a wall texture cube.
One line should run from green at the top left to red at the bottom right.
The other should run from cyan 100% transparent at the bottom left to
cyan 100% opaque at the top right. */
static bool lineRender(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();
stabilizeScreenBackground(driver);
logTestString("Testing driver %ls\n", driver->getName());
// Draw a cube background so that we can 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(video::ECBF_COLOR | video::ECBF_DEPTH, SColor(255,100,101,140));
smgr->drawAll();
// Test for benign handling of offscreen pixel values as well as onscreen ones.
for(s32 x = -10; x < 170; ++x)
{
s32 y = 120 * x / 160;
driver->drawPixel((u32)x, (u32)y, SColor(255, 255 * x / 640, 255 * (640 - x) / 640, 0));
y = 120 - y;
driver->drawPixel((u32)x, (u32)y, SColor(255 * x / 640, 0, 255, 255));
}
driver->endScene();
bool result = takeScreenshotAndCompareAgainstReference(driver, "-drawPixel.png", 98.81f);
device->closeDevice();
device->run();
device->drop();
return result;
}