本文整理汇总了C++中BGLView::Bounds方法的典型用法代码示例。如果您正苦于以下问题:C++ BGLView::Bounds方法的具体用法?C++ BGLView::Bounds怎么用?C++ BGLView::Bounds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGLView
的用法示例。
在下文中一共展示了BGLView::Bounds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetBufferSize
void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
GLuint *height)
{
GET_CURRENT_CONTEXT(ctx);
if (!ctx)
return;
MesaDriver * md = (MesaDriver *) ctx->DriverCtx;
BGLView *bglview = md->m_bglview;
assert(bglview);
BRect b = bglview->Bounds();
*width = (GLuint) b.IntegerWidth() + 1; // (b.right - b.left + 1);
*height = (GLuint) b.IntegerHeight() + 1; // (b.bottom - b.top + 1);
md->m_bottom = (GLint) b.bottom;
if (ctx->Visual.doubleBufferMode) {
if (*width != md->m_width || *height != md->m_height) {
// allocate new size of back buffer bitmap
if (md->m_bitmap)
delete md->m_bitmap;
BRect rect(0.0, 0.0, *width - 1, *height - 1);
md->m_bitmap = new BBitmap(rect, B_RGBA32);
}
}
else
{
md->m_bitmap = NULL;
}
md->m_width = *width;
md->m_height = *height;
}
示例2: ClearFront
void MesaDriver::ClearFront(GLcontext *ctx,
GLboolean all, GLint x, GLint y,
GLint width, GLint height)
{
MesaDriver *md = (MesaDriver *) ctx->DriverCtx;
BGLView *bglview = md->m_bglview;
assert(bglview);
bglview->SetHighColor(md->m_clear_color[BE_RCOMP],
md->m_clear_color[BE_GCOMP],
md->m_clear_color[BE_BCOMP],
md->m_clear_color[BE_ACOMP]);
bglview->SetLowColor(md->m_clear_color[BE_RCOMP],
md->m_clear_color[BE_GCOMP],
md->m_clear_color[BE_BCOMP],
md->m_clear_color[BE_ACOMP]);
if (all) {
BRect b = bglview->Bounds();
bglview->FillRect(b);
}
else {
// XXX untested
BRect b;
b.left = x;
b.right = x + width;
b.bottom = md->m_height - y - 1;
b.top = b.bottom - height;
bglview->FillRect(b);
}
// restore drawing color
#if 0
bglview->SetHighColor(md->mColor[BE_RCOMP],
md->mColor[BE_GCOMP],
md->mColor[BE_BCOMP],
md->mColor[BE_ACOMP]);
bglview->SetLowColor(md->mColor[BE_RCOMP],
md->mColor[BE_GCOMP],
md->mColor[BE_BCOMP],
md->mColor[BE_ACOMP]);
#endif
}