本文整理汇总了C++中GlContext类的典型用法代码示例。如果您正苦于以下问题:C++ GlContext类的具体用法?C++ GlContext怎么用?C++ GlContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GlContext类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ContextType
GlContext* GlContext::create()
{
GlContext* context = new ContextType(sharedContext);
context->initialize();
return context;
}
示例2: ContextType
GlContext* GlContext::New()
{
GlContext* context = new ContextType(sharedContext);
context->Initialize();
return context;
}
示例3: assert
GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
{
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
assert(sharedContext != NULL);
Lock lock(mutex);
GlContext* context = NULL;
// We don't use acquireTransientContext here since we have
// to ensure we have exclusive access to the shared context
// in order to make sure it is not active during context creation
{
sharedContext->setActive(true);
// Create the context
context = new ContextType(sharedContext, settings, width, height);
sharedContext->setActive(false);
}
context->initialize(settings);
context->checkSettings(settings);
return context;
}
示例4: lock
GlContext* GlContext::create()
{
Lock lock(mutex);
// Create the context
GlContext* context = new ContextType(sharedContext);
context->initialize();
return context;
}
示例5: ensureContext
GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
{
// Make sure that there's an active context (context creation may need extensions, and thus a valid context)
ensureContext();
// Create the context
GlContext* context = new ContextType(sharedContext, settings, width, height);
context->initialize();
return context;
}
示例6: LOG_ALL
void
OpenGl::flush() {
LOG_ALL(opengllog) << "attempting to flush current context" << std::endl;
GlContext* context = getInstance()->_context.get();
if (context != 0)
context->flush();
else
LOG_ALL(opengllog) << "there is no current context in this thread" << std::endl;
}
示例7: shared
bool shared(GlContext& a, GlContext& b)
{
std::lock_guard<std::mutex> lock(contextShareMutex());
const auto& shared = a.shared();
for(auto& c : shared) if(c == &b) return true;
return false;
}