本文整理汇总了C++中ContextFormat::setForwardCompatible方法的典型用法代码示例。如果您正苦于以下问题:C++ ContextFormat::setForwardCompatible方法的具体用法?C++ ContextFormat::setForwardCompatible怎么用?C++ ContextFormat::setForwardCompatible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContextFormat
的用法示例。
在下文中一共展示了ContextFormat::setForwardCompatible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int /*argc*/, char * /*argv*/[])
{
info() << "Usage:";
info() << "\t" << "ESC" << "\t\t" << "Close example";
info() << "\t" << "ALT + Enter" << "\t" << "Toggle fullscreen";
info() << "\t" << "F11" << "\t\t" << "Toggle fullscreen";
info() << "\t" << "F10" << "\t\t" << "Toggle vertical sync";
info() << "\t" << "F5" << "\t\t" << "Reload shaders";
info() << "\t" << "Space" << "\t\t" << "Reset camera";
info() << "\t" << "Left Mouse" << "\t" << "Pan scene";
info() << "\t" << "Right Mouse" << "\t" << "Rotate scene";
info() << "\t" << "Mouse Wheel" << "\t" << "Zoom scene";
ContextFormat format;
format.setVersion(3, 1);
format.setForwardCompatible(true);
Window::init();
Window window;
window.setEventHandler(new EventHandler());
if (!window.create(format, "Bindless Texture Example"))
return 1;
window.show();
return MainLoop::run();
}
示例2: main
/** This example shows how to create multiple windows with each having its own
OpenGL context. Further, the events of all windows are handled within a
single event handler. This allows, e.g., reuse of painting functionality
with minor, windows specific variations (e.g., different views).
*/
int main(int /*argc*/, char * /*argv*/[])
{
info() << "Usage:";
info() << "\t" << "ESC" << "\t\t" << "Close example";
info() << "\t" << "ALT + Enter" << "\t" << "Toggle fullscreen";
info() << "\t" << "F11" << "\t\t" << "Toggle fullscreen";
info() << "\t" << "F10" << "\t\t" << "Toggle vertical sync";
ContextFormat format;
format.setVersion(3, 1);
format.setForwardCompatible(true);
Window::init();
Window windows[8];
for (int i = 0; i < 8; ++i)
{
windows[i].setEventHandler(new EventHandler());
if (!windows[i].create(format, "Multiple Contexts Example", 320, 240))
return 1;
windows[i].setQuitOnDestroy(i == 0 || rand() % 4 == 0);
windows[i].show();
}
return MainLoop::run();
}