本文整理汇总了C++中Drawable类的典型用法代码示例。如果您正苦于以下问题:C++ Drawable类的具体用法?C++ Drawable怎么用?C++ Drawable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Drawable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Drawable_get_scale
static VALUE Drawable_get_scale(VALUE vSelf) {
// Get C++ object pointer from vSelf
Drawable *pSelf;
Data_Get_Struct(vSelf, Drawable, pSelf);
float x = pSelf->GetScaleX();
float y = pSelf->GetScaleY();
VALUE vArr = rb_ary_new();
rb_ary_push(vArr, rb_float_new(x));
rb_ary_push(vArr, rb_float_new(y));
return vArr;
}
示例2: while
void RenderingEngine::ClearExpired(){
simnode<Drawable>* node = _drawables->head;
while (node != NULL) {
Drawable* d = node->data;
if(d->IsExpired()){
node = _drawables->removeAndGetNext(node, !d->PreserveExpired());
continue;
}
node = node->next;
}
}
示例3: drawMapDrawables
void AiEngine::drawMapDrawables() const
{
MapDrawablesSet::const_iterator it;
for (it = mapDrawables.begin(); it != mapDrawables.end(); it++)
{
mapCanvas.reset();
Drawable *drawable = *it;
drawable->draw(mapCanvas);
}
}
示例4: drawScreenDrawables
void AiEngine::drawScreenDrawables() const
{
ScreenDrawablesSet::const_iterator it;
for (it = screenDrawables.begin(); it != screenDrawables.end(); it++)
{
screenCanvas.reset();
Drawable *drawable = *it;
drawable->draw(screenCanvas);
}
}
示例5: Component
Drawable::Drawable (const Drawable& other)
: Component (other.getName())
{
setInterceptsMouseClicks (false, false);
setPaintingIsUnclipped (true);
setComponentID (other.getComponentID());
setTransform (other.getTransform());
if (auto* clipPath = other.drawableClipPath.get())
setClipPath (clipPath->createCopy());
}
示例6: DoesIntersect
bool Scene::DoesIntersect(const Ray &ray)
{
for (std::vector<Drawable *>::const_iterator i = m_DrawableList.begin(); i != m_DrawableList.end(); i++) {
Drawable *d = *i;
if (d->Intersect(ray)) {
return true;
}
}
return false;
}
示例7: redo
void GraphicsEngine::redo()
{
if (!redoStack.empty())
{
Drawable *obj = redoStack.back();
obj->load();
objects.push_back(obj);
std::stable_sort(objects.begin(), objects.end(), [](const Drawable* a, const Drawable* b) { return a->sortIndex() < b->sortIndex(); });
redoStack.pop_back();
undoStack.push_back(obj);
}
}
示例8: destroy_drawables
/**
* \brief Destroys from Lua all drawable objects created
* by this script.
*/
void LuaContext::destroy_drawables() {
std::set<Drawable*>::iterator it;
for (it = drawables.begin(); it != drawables.end(); ++it) {
Drawable* drawable = *it;
drawable->decrement_refcount();
if (drawable->get_refcount() == 0) {
delete drawable;
}
}
drawables.clear();
drawables_to_remove.clear();
}
示例9: StaticTrace_addTile
void StaticTrace_addTile(StaticTrace* self, Tile* tile, uint32_t x, uint32_t y)
{
//if the position is correct
if(x < self->nbCasesX && y < self->nbCasesY && tile)
{
//Add the tile
self->tiles[x][y] = tile;
//And set its position
Drawable* tileDrawable = (Drawable*)tile;
tileDrawable->setPosition(tileDrawable, self->padX + x*self->sizeX, self->padY + y*self->sizeY);
}
}
示例10: SetText
void TextDraw::SetText(
Drawable & draw,
const Font & font, const std::string & text,
float x, float y, float scalex, float scaley,
float r, float g, float b,
VertexArray & output_array)
{
RenderText(font, text, x, y, scalex, scaley, output_array);
draw.SetTextures(font.GetFontTexture()->GetId());
draw.SetVertArray(&output_array);
draw.SetCull(false, false);
draw.SetColor(r, g, b, 1.0);
}
示例11: while
void BoxOctreeQuery::TestDrawables(Drawable** start, Drawable** end, bool inside)
{
while (start != end)
{
Drawable* drawable = *start++;
if ((drawable->GetDrawableFlags() & drawableFlags_) && (drawable->GetViewMask() & viewMask_))
{
if (inside || box_.IsInsideFast(drawable->GetWorldBoundingBox()))
result_.Push(drawable);
}
}
}
示例12: w_draw
/**
* Draws an Image at the specified coordinates, with rotation and
* scaling along both axes.
* @param x The x-coordinate.
* @param y The y-coordinate.
* @param angle The amount of rotation.
* @param sx The scale factor along the x-axis. (1 = normal).
* @param sy The scale factor along the y-axis. (1 = normal).
* @param ox The offset along the x-axis.
* @param oy The offset along the y-axis.
**/
int w_draw(lua_State * L)
{
Drawable * drawable = luax_checktype<Drawable>(L, 1, "Drawable", GRAPHICS_DRAWABLE_T);
float x = (float)luaL_optnumber(L, 2, 0.0f);
float y = (float)luaL_optnumber(L, 3, 0.0f);
float angle = (float)luaL_optnumber(L, 4, 0.0f);
float sx = (float)luaL_optnumber(L, 5, 1.0f);
float sy = (float)luaL_optnumber(L, 6, sx);
float ox = (float)luaL_optnumber(L, 7, 0);
float oy = (float)luaL_optnumber(L, 8, 0);
drawable->draw(x, y, angle, sx, sy, ox, oy);
return 0;
}
示例13: Draw
void Gameplay::Draw() {
int activeAsteroids = 0;
for(auto it = asteroids.begin(); it != asteroids.end(); ++it) {
if(!(*it)->active)
continue;
activeAsteroids++;
(*it)->fillInstanceData(asteroidDraw->instances);
}
if(activeAsteroids > 0) {
asteroidDraw->setEffectTextures();
asteroidDraw->drawInstanced(activeAsteroids);
}
for(auto it = sceneMgr->Begin(); it != sceneMgr->End(); ++it) {
if(!(*it)->active)
continue;
(*it)->Draw();
}
laserDraw->setShader("laserEffect", "RenderLasers");
laserDraw->draw();
//draw glowy stuff
resourceMgr->md3dImmediateContext->RSSetViewports(1, &resourceMgr->viewports["DScale2"]);
resourceMgr->md3dImmediateContext->OMSetRenderTargets(1, &resourceMgr->renderTargets["DScale"], NULL);
resourceMgr->md3dImmediateContext->ClearRenderTargetView(resourceMgr->renderTargets["DScale"], reinterpret_cast<const float*>(&Colors::Black));
for(auto it = sceneMgr->Begin(); it != sceneMgr->End(); ++it)
{
if(!(*it)->glow || !(*it)->active)
continue;
Drawable* temp = (*it)->GetComponent<Drawable>();
if(temp)
{
temp->setShader("glowDraw", "RenderGlowy");
temp->setEffectVariables();
temp->setEffectTextures();
(*it)->Draw();
temp->setShader("betterPhongBump", "Render");
}
}
laserDraw->setShader("glowDraw", "RenderGlowy");
laserDraw->setEffectVariables();
laserDraw->draw();
laserDraw->points.clear();
glow->setEffectVariables();
glow->draw("DScale", "DScale2", "Pass2", "Original");
closeButton->Draw( );
}
示例14: execSyncV
void DrawableBase::execSyncV( FieldContainer &oFrom,
ConstFieldMaskArg whichField,
AspectOffsetStore &oOffsets,
ConstFieldMaskArg syncMode,
const UInt32 uiSyncInfo)
{
Drawable *pThis = static_cast<Drawable *>(this);
pThis->execSync(static_cast<Drawable *>(&oFrom),
whichField,
oOffsets,
syncMode,
uiSyncInfo);
}
示例15: UpdateDrawablesWork
void UpdateDrawablesWork(const WorkItem* item, unsigned threadIndex)
{
const FrameInfo& frame = *(reinterpret_cast<FrameInfo*>(item->aux_));
Drawable** start = reinterpret_cast<Drawable**>(item->start_);
Drawable** end = reinterpret_cast<Drawable**>(item->end_);
while (start != end)
{
Drawable* drawable = *start;
if (drawable)
drawable->Update(frame);
++start;
}
}