本文整理汇总了C++中boost::intrusive_ptr::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ intrusive_ptr::getName方法的具体用法?C++ intrusive_ptr::getName怎么用?C++ intrusive_ptr::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::intrusive_ptr
的用法示例。
在下文中一共展示了intrusive_ptr::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawTargetToScreen
void drawTargetToScreen()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, double(window_->getWidth() * 2),
0.0, double(window_->getHeight() * 2),
-1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, targetTexture_->getName());
glColor3ub(255, 255, 255);
glBegin(GL_QUADS);
{
glTexCoord2i(0, 0);
glVertex2i(0, 0);
glTexCoord2i(1, 0);
glVertex2i(window_->getWidth() * 2, 0);
glTexCoord2i(1, 1);
glVertex2i(window_->getWidth() * 2, window_->getHeight() * 2);
glTexCoord2i(0, 1);
glVertex2i(0, window_->getHeight() * 2);
}
glEnd();
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
}
示例2: drawSceneToTarget
void drawSceneToTarget()
{
if (!targetTexture_ ||
targetTexture_->getWidth() != 2 * window_->getWidth() ||
targetTexture_->getHeight() != 2 * window_->getHeight())
{
targetTexture_ = window_->getContext()->createTexture();
targetTexture_->setSize(2 * window_->getWidth(),
2 * window_->getHeight());
targetTexture_->setMinFilter(GL_LINEAR);
targetTexture_->setMagFilter(GL_LINEAR);
targetFrameBuffer_ = window_->getContext()->createFrameBuffer();
targetFrameBuffer_->setColorAttachment(targetTexture_);
}
targetFrameBuffer_->create();
glViewport(0, 0, window_->getWidth() * 2,
window_->getHeight() * 2);
glBindFramebuffer(GL_FRAMEBUFFER, targetFrameBuffer_->getName());
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
drawScene();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, window_->getWidth(), window_->getHeight());
}
示例3: drawLogoToTarget
void drawLogoToTarget()
{
logoTexture_->create();
targetFrameBuffer_->create();
glViewport(0, 0, targetTexture_->getWidth(),
targetTexture_->getHeight());
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
float aspectRatio = (float(logoTexture_->getWidth()) /
float(logoTexture_->getHeight()));
float scale = 0.2f;
glBindFramebuffer(GL_FRAMEBUFFER, targetFrameBuffer_->getName());
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, logoTexture_->getName());
glPushMatrix();
glRotatef(angle_, 0.0f, 0.0f, 1.0f);
glColor3f(1.0f, 0.8f, 0.2f);
glBegin(GL_QUADS);
{
glTexCoord2i(0, 0);
glVertex2f(-scale * aspectRatio, -scale);
glTexCoord2i(1, 0);
glVertex2f(scale * aspectRatio, -scale);
glTexCoord2i(1, 1);
glVertex2f(scale * aspectRatio, scale);
glTexCoord2i(0, 1);
glVertex2f(-scale * aspectRatio, scale);
}
glEnd();
glPopMatrix();
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
示例4: drawTargetToScreen
void drawTargetToScreen()
{
float aspectRatio = (float(window_->getWidth()) /
float(window_->getHeight()));
float scale = 1.5f;
glViewport(0, 0, window_->getWidth(), window_->getHeight());
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-aspectRatio, aspectRatio, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, targetTexture_->getName());
glPushMatrix();
glRotatef(-angle_, 0.0f, 0.0f, 1.0f);
glBegin(GL_QUADS);
{
glTexCoord2i(0, 0);
glVertex2f(-scale, -scale);
glTexCoord2i(1, 0);
glVertex2f(scale, -scale);
glTexCoord2i(1, 1);
glVertex2f(scale, scale);
glTexCoord2i(0, 1);
glVertex2f(-scale, scale);
}
glEnd();
glPopMatrix();
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
}