本文整理汇总了C++中vector2d::set方法的典型用法代码示例。如果您正苦于以下问题:C++ vector2d::set方法的具体用法?C++ vector2d::set怎么用?C++ vector2d::set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vector2d
的用法示例。
在下文中一共展示了vector2d::set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
device = createDevice(EDT_OPENGL, dimension2d<u32>(screenWidth, screenHeight), 16,
false, false, false, 0);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
MyEventReceiver receiver;
device->setEventReceiver(&receiver);
image = driver->getTexture("/home/fuyajun/Documents/irrlicht-1.7.2/media/fireball.bmp");
position.set(0,0);
direction.set(1,1);
u32 then = device->getTimer()->getTime();
while (device->run())
{
const u32 now = device->getTimer()->getTime();
const f32 deltaTime = (f32)(now - then);
then = now;
update(deltaTime);
driver->beginScene(true, true, SColor(255,255,255,255));
driver->draw2DImage(image, position2d<s32>((s32)position.X, (s32)position.Y), rect<s32>(0, 0, 32, 32), 0, SColor(255, 255, 255, 255), true);
driver->endScene();
core::stringw str = L"x: ";
str += target.X;
str += ", y: ";
str += target.Y;
str += ", posX: ";
str += position.X;
str += ", posY: ";
str += position.Y;
device->setWindowCaption(str.c_str());
}
device->drop();
return 0;
}