当前位置: 首页>>代码示例>>C++>>正文


C++ BGLView::UnlockGL方法代码示例

本文整理汇总了C++中BGLView::UnlockGL方法的典型用法代码示例。如果您正苦于以下问题:C++ BGLView::UnlockGL方法的具体用法?C++ BGLView::UnlockGL怎么用?C++ BGLView::UnlockGL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BGLView的用法示例。


在下文中一共展示了BGLView::UnlockGL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BGLView

OpenGLView::OpenGLView()
	:
	BGroupView("OpenGLView", B_VERTICAL)
{

	BGLView* glView = new BGLView(BRect(0, 0, 1, 1), "gl info", B_FOLLOW_NONE, 0,
		BGL_RGB | BGL_DOUBLE);
	glView->Hide();
	AddChild(glView);

	glView->LockGL();

	float tabViewWidth = this->StringWidth("M") * 42;
	float tabViewHeight = this->StringWidth("M") * 16;

	BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
	tabView->SetExplicitMinSize(BSize(tabViewWidth, tabViewHeight));
	tabView->AddTab(new CapabilitiesView());
	tabView->AddTab(new ExtensionsView());

	glView->UnlockGL();

	GroupLayout()->SetSpacing(0);
	BLayoutBuilder::Group<>(this)
		.AddGroup(B_HORIZONTAL, 0)
			.Add(new GearsView())
			.AddGroup(B_VERTICAL, B_USE_DEFAULT_SPACING)
				.SetInsets(0, B_USE_DEFAULT_SPACING,
					B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
				.Add(new InfoView())
				.Add(tabView)
				.End()
			.AddGlue()
			.End();
}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:35,代码来源:OpenGLView.cpp

示例2: BMessage

OpenGLView::OpenGLView()
	:
	BGroupView("OpenGLView", B_VERTICAL)
{

	BGLView* glView = new BGLView(BRect(0, 0, 1, 1), "gl info", B_FOLLOW_NONE, 0,
		BGL_RGB | BGL_DOUBLE);
	glView->Hide();
	AddChild(glView);

	glView->LockGL();

    BMenu* menu = new BMenu(B_TRANSLATE("Automatic"));
    menu->SetRadioMode(true);
    menu->SetLabelFromMarked(true);
    menu->AddItem(new BMenuItem(B_TRANSLATE("Automatic"),
        new BMessage(MENU_AUTO_MESSAGE)));
    menu->AddSeparatorItem();
    menu->AddItem(new BMenuItem(B_TRANSLATE("Software Rasterizer"),
        new BMessage(MENU_SWRAST_MESSAGE)));
    menu->AddItem(new BMenuItem(B_TRANSLATE("Gallium Software Pipe"),
        new BMessage(MENU_SWPIPE_MESSAGE)));
    menu->AddItem(new BMenuItem(B_TRANSLATE("Gallium LLVM Pipe"),
        new BMessage(MENU_SWLLVM_MESSAGE)));
    BMenuField* menuField = new BMenuField("renderer",
        B_TRANSLATE("3D Rendering Engine:"), menu);
	// TODO:  Set current Renderer
	menuField->SetEnabled(false);

	BTabView *tabView = new BTabView("tab view", B_WIDTH_FROM_LABEL);
	tabView->AddTab(new InfoView());
	tabView->AddTab(new CapabilitiesView());
	tabView->AddTab(new ExtensionsView());

	glView->UnlockGL();

	GroupLayout()->SetSpacing(0);
	BLayoutBuilder::Group<>(this)
		.SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING,
			B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING)
		.Add(menuField)
		.AddGroup(B_HORIZONTAL)
			.Add(tabView)
			.SetInsets(0, B_USE_DEFAULT_SPACING, 0, 0);
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:45,代码来源:OpenGLView.cpp


注:本文中的BGLView::UnlockGL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。