本文整理汇总了C++中Display::createContext方法的典型用法代码示例。如果您正苦于以下问题:C++ Display::createContext方法的具体用法?C++ Display::createContext怎么用?C++ Display::createContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Display
的用法示例。
在下文中一共展示了Display::createContext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateContext
EGLContext EGLAPIENTRY CreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, EGLContext share_context = 0x%0.8p, "
"const EGLint *attrib_list = 0x%0.8p)", dpy, config, share_context, attrib_list);
Display *display = static_cast<Display*>(dpy);
Config *configuration = static_cast<Config*>(config);
gl::Context* sharedGLContext = static_cast<gl::Context*>(share_context);
AttributeMap attributes(attrib_list);
Error error = ValidateCreateContext(display, configuration, sharedGLContext, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_CONTEXT;
}
gl::Context *context = nullptr;
error = display->createContext(configuration, sharedGLContext, attributes, &context);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_CONTEXT;
}
SetGlobalError(Error(EGL_SUCCESS));
return static_cast<EGLContext>(context);
}
示例2: CreateContext
EGLContext EGLAPIENTRY CreateContext(EGLDisplay dpy,
EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, EGLContext share_context = "
"0x%0.8p, "
"const EGLint *attrib_list = 0x%0.8p)",
dpy, config, share_context, attrib_list);
Thread *thread = GetCurrentThread();
Display *display = static_cast<Display *>(dpy);
Config *configuration = static_cast<Config *>(config);
gl::Context *sharedGLContext = static_cast<gl::Context *>(share_context);
AttributeMap attributes = AttributeMap::CreateFromIntArray(attrib_list);
Error error = ValidateCreateContext(display, configuration, sharedGLContext, attributes);
if (error.isError())
{
thread->setError(error);
return EGL_NO_CONTEXT;
}
gl::Context *context = nullptr;
error = display->createContext(configuration, sharedGLContext, attributes, &context);
if (error.isError())
{
thread->setError(error);
return EGL_NO_CONTEXT;
}
thread->setError(NoError());
return static_cast<EGLContext>(context);
}