本文整理汇总了C++中IVideoDriver::getCurrentRenderTargetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoDriver::getCurrentRenderTargetSize方法的具体用法?C++ IVideoDriver::getCurrentRenderTargetSize怎么用?C++ IVideoDriver::getCurrentRenderTargetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVideoDriver
的用法示例。
在下文中一共展示了IVideoDriver::getCurrentRenderTargetSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ICameraSceneNode
RTSCamera::RTSCamera(IrrlichtDevice* devicepointer,ISceneNode* parent,ISceneManager* smgr,s32 id,
f32 rs,f32 zs,f32 ts)
: ICameraSceneNode(parent,smgr,id,vector3df(1.0f,1.0f,1.0f),vector3df(0.0f,0.0f,0.0f),
vector3df(1.0f,1.0f,1.0f)),InputReceiverEnabled(true)
{
device = devicepointer;
BBox.reset(0,0,0);
UpVector.set(0.0f, 1.0f, 0.0f);
// set default projection
Fovy = core::PI / 2.5f; // Field of view, in radians.
Aspect = 4.0f / 3.0f; // Aspect ratio.
ZNear = 1.0f; // value of the near view-plane.
ZFar = 100000.0f; // Z-value of the far view-plane.
oldTimeMs = 0;
IVideoDriver* d = smgr->getVideoDriver();
if (d)
Aspect = (f32)d->getCurrentRenderTargetSize().Width / (f32)d->getCurrentRenderTargetSize().Height;
zooming = false;
rotating = false;
moving = false;
translating = false;
zoomSpeed = zs;
rotateSpeed = rs;
translateSpeed = ts;
targetMinDistance = 1.0f;
targetMaxDistance = 900.0f;
Target.set(0.0f,0.0f,0.0f);
rotX = 0;
rotY = 0;
oldTarget = Target;
maxRot = 0;
atMinDistance = false;
atMaxDistance = false;
allKeysUp();
allMouseButtonsUp();
recalculateProjectionMatrix();
recalculateViewArea();
smgr->setActiveCamera(this);
}
示例2:
/**
* ドライバの情報表示
*/
void
IrrlichtBase::showDriverInfo()
{
IVideoDriver *driver = device->getVideoDriver();
if (driver) {
dimension2d<s32> size = driver->getScreenSize();
message_log("デバイス生成後のスクリーンサイズ:%d, %d", size.Width, size.Height);
size = driver->getCurrentRenderTargetSize();
message_log("デバイス生成後のRenderTargetの:%d, %d", size.Width, size.Height);
}
}
示例3: runTestWithDriver
//! Tests projection matrices
static bool runTestWithDriver(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();
stabilizeScreenBackground(driver);
logTestString("Testing driver %ls\n", driver->getName());
bool result = true;
driver->beginScene(true, false, SColor(255,0,0,0));
SMaterial mat;
mat.MaterialType = EMT_SOLID;
mat.Lighting = false;
mat.ZBuffer = false;
mat.ZWriteEnable = false;
mat.Thickness = 1;
driver->setMaterial(mat);
core::dimension2d<f32> dims(driver->getCurrentRenderTargetSize());
//apply custom projection, no offset
core::matrix4 pmtx = matrix4().buildProjectionMatrixOrthoLH(dims.Width, dims.Height, 0, 100);
driver->setTransform(ETS_PROJECTION, pmtx);
driver->setTransform(ETS_VIEW, matrix4());
driver->setTransform(ETS_WORLD, matrix4());
//the red cross appears at center
for (u32 i=0; i<10; ++i)
{
driver->draw3DLine(vector3df(0.f+i,-50.f,1.f), vector3df(0.f+i,50.f,1.f), SColor(255,255,0,0));
driver->draw3DLine(vector3df(-50.f,0.f+i,1.f), vector3df(50.f,0.f+i,1.f), SColor(255,255,0,0));
}
//apply custom projection, offset to right-top
pmtx.setTranslation(vector3df(0.7f, 0.7f, 0.f));
driver->setTransform(ETS_PROJECTION, pmtx);
driver->setTransform(ETS_VIEW, matrix4());
driver->setTransform(ETS_WORLD, matrix4());
//The green cross must be in right-top corner. But for OpenGL driver it is in left-top corner
for (u32 i=0; i<10; ++i)
{
driver->draw3DLine(vector3df(0.f+i,-50,1), vector3df(0.f+i,50,1), SColor(255,0,255,0));
driver->draw3DLine(vector3df(-50,0.f+i,1), vector3df(50,0.f+i,1), SColor(255,0,255,0));
}
driver->endScene();
result = takeScreenshotAndCompareAgainstReference(driver, "-projMat.png", 98.71f);
device->closeDevice();
device->run();
device->drop();
return result;
}