本文整理汇总了C++中Drawable::cancelMove方法的典型用法代码示例。如果您正苦于以下问题:C++ Drawable::cancelMove方法的具体用法?C++ Drawable::cancelMove怎么用?C++ Drawable::cancelMove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawable
的用法示例。
在下文中一共展示了Drawable::cancelMove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFromDrawable
void Buffer::createFromDrawable(Drawable &obj) {
shouldDelete = true;
if (obj.getW() > 512 || obj.getH() > 512)
throw RubyException(rb_eRuntimeError, "Drawable too big for a buffer.");
int width = obj.getW();
int height = obj.getH();
img = oslCreateImage(width, height, OSL_IN_VRAM, OSL_PF_8888);
if (!img) {
img = oslCreateImage(width, height, OSL_IN_RAM, OSL_PF_8888);
if (!img)
throw RubyException(rb_eRuntimeError, "Buffer could not be created");
}
else {
Buffer::registerInVram(img);
}
OSL_IMAGE *old = oslGetDrawBuffer();
setActual();
obj.clearMove();
obj.setPos(0, 0);
obj.draw();
obj.cancelMove();
oslSetDrawBuffer(old);
}
示例2: RubyException
Buffer::Buffer(Drawable &obj): shouldDelete(true) {
setClass("Buffer");
if (obj.getW() > 512 || obj.getH() > 512)
throw RubyException(rb_eRuntimeError, "Drawable too big for a buffer.");
img = oslCreateImage(obj.getW(), obj.getH(), OSL_IN_VRAM, OSL_PF_8888);
if (!img)
throw RubyException(rb_eRuntimeError, "Buffer could not be created");
OSL_IMAGE *old = oslGetDrawBuffer();
setActual();
obj.clearMove();
obj.setPos(0, 0);
obj.draw();
obj.cancelMove();
oslSetDrawBuffer(old);
}