本文整理汇总了C++中SetGlobalError函数的典型用法代码示例。如果您正苦于以下问题:C++ SetGlobalError函数的具体用法?C++ SetGlobalError怎么用?C++ SetGlobalError使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetGlobalError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CopyBuffers
EGLBoolean EGLAPIENTRY CopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLNativePixmapType target = 0x%0.8p)", dpy, surface, target);
Display *display = static_cast<Display*>(dpy);
Surface *eglSurface = static_cast<Surface*>(surface);
Error error = ValidateSurface(display, eglSurface);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
if (display->isDeviceLost())
{
SetGlobalError(Error(EGL_CONTEXT_LOST));
return EGL_FALSE;
}
UNIMPLEMENTED(); // FIXME
SetGlobalError(Error(EGL_SUCCESS));
return 0;
}
示例2: SwapInterval
EGLBoolean EGLAPIENTRY SwapInterval(EGLDisplay dpy, EGLint interval)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint interval = %d)", dpy, interval);
Display *display = static_cast<Display*>(dpy);
Error error = ValidateDisplay(display);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
Surface *draw_surface = static_cast<Surface*>(GetGlobalDrawSurface());
if (draw_surface == NULL)
{
SetGlobalError(Error(EGL_BAD_SURFACE));
return EGL_FALSE;
}
draw_surface->setSwapInterval(interval);
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例3: Initialize
EGLBoolean EGLAPIENTRY Initialize(EGLDisplay dpy, EGLint *major, EGLint *minor)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint *major = 0x%0.8p, EGLint *minor = 0x%0.8p)",
dpy, major, minor);
if (dpy == EGL_NO_DISPLAY)
{
SetGlobalError(Error(EGL_BAD_DISPLAY));
return EGL_FALSE;
}
Display *display = static_cast<Display*>(dpy);
Error error = display->initialize();
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
if (major) *major = 1;
if (minor) *minor = 4;
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例4: DestroyContext
EGLBoolean EGLAPIENTRY DestroyContext(EGLDisplay dpy, EGLContext ctx)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLContext ctx = 0x%0.8p)", dpy, ctx);
Display *display = static_cast<Display*>(dpy);
gl::Context *context = static_cast<gl::Context*>(ctx);
Error error = ValidateContext(display, context);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
if (ctx == EGL_NO_CONTEXT)
{
SetGlobalError(Error(EGL_BAD_CONTEXT));
return EGL_FALSE;
}
if (context == GetGlobalContext())
{
SetGlobalDisplay(NULL);
SetGlobalContext(NULL);
}
display->destroyContext(context);
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例5: SwapInterval
EGLBoolean EGLAPIENTRY SwapInterval(EGLDisplay dpy, EGLint interval)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLint interval = %d)", dpy, interval);
Display *display = static_cast<Display*>(dpy);
Error error = ValidateDisplay(display);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
Surface *draw_surface = static_cast<Surface*>(GetGlobalDrawSurface());
if (draw_surface == NULL)
{
SetGlobalError(Error(EGL_BAD_SURFACE));
return EGL_FALSE;
}
const egl::Config *surfaceConfig = draw_surface->getConfig();
EGLint clampedInterval = std::min(std::max(interval, surfaceConfig->minSwapInterval), surfaceConfig->maxSwapInterval);
draw_surface->setSwapInterval(clampedInterval);
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例6: 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);
}
示例7: StreamPostD3DTextureNV12ANGLE
EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
EGLStreamKHR stream,
void *texture,
const EGLAttrib *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, void* texture = 0x%0.8p, "
"EGLAttrib attrib_list = 0x%0.8p",
dpy, stream, texture, attrib_list);
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
Error error = ValidateStreamPostD3DTextureNV12ANGLE(display, streamObject, texture, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->postD3D11NV12Texture(texture, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
SetGlobalError(error);
return EGL_TRUE;
}
示例8: StreamConsumerGLTextureExternalAttribsNV
EGLBoolean EGLAPIENTRY StreamConsumerGLTextureExternalAttribsNV(EGLDisplay dpy,
EGLStreamKHR stream,
const EGLAttrib *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLAttrib attrib_list = 0x%0.8p",
dpy, stream, attrib_list);
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
gl::Context *context = gl::GetValidGlobalContext();
AttributeMap attributes = AttributeMap::CreateFromAttribArray(attrib_list);
Error error = ValidateStreamConsumerGLTextureExternalAttribsNV(display, context, streamObject,
attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
error = streamObject->createConsumerGLTextureExternal(attributes, context);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
SetGlobalError(error);
return EGL_TRUE;
}
示例9: QueryStreamu64KHR
EGLBoolean EGLAPIENTRY QueryStreamu64KHR(EGLDisplay dpy,
EGLStreamKHR stream,
EGLenum attribute,
EGLuint64KHR *value)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLStreamKHR stream = 0x%0.8p, EGLenum attribute = 0x%X, "
"EGLuint64KHR value = 0x%0.8p)",
dpy, stream, attribute, value);
Display *display = static_cast<Display *>(dpy);
Stream *streamObject = static_cast<Stream *>(stream);
Error error = ValidateQueryStreamu64KHR(display, streamObject, attribute, value);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
switch (attribute)
{
case EGL_PRODUCER_FRAME_KHR:
*value = streamObject->getProducerFrame();
break;
case EGL_CONSUMER_FRAME_KHR:
*value = streamObject->getConsumerFrame();
break;
default:
UNREACHABLE();
}
SetGlobalError(error);
return EGL_TRUE;
}
示例10: ChooseConfig
EGLBoolean EGLAPIENTRY ChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, const EGLint *attrib_list = 0x%0.8p, "
"EGLConfig *configs = 0x%0.8p, EGLint config_size = %d, EGLint *num_config = 0x%0.8p)",
dpy, attrib_list, configs, config_size, num_config);
Display *display = static_cast<Display*>(dpy);
Error error = ValidateDisplay(display);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
if (!num_config)
{
SetGlobalError(Error(EGL_BAD_PARAMETER));
return EGL_FALSE;
}
std::vector<const Config*> filteredConfigs = display->getConfigs(AttributeMap(attrib_list));
if (configs)
{
filteredConfigs.resize(std::min<size_t>(filteredConfigs.size(), config_size));
for (size_t i = 0; i < filteredConfigs.size(); i++)
{
configs[i] = const_cast<Config*>(filteredConfigs[i]);
}
}
*num_config = static_cast<EGLint>(filteredConfigs.size());
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例11: CreatePbufferSurface
EGLSurface EGLAPIENTRY CreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, const EGLint *attrib_list = 0x%0.8p)",
dpy, config, attrib_list);
Display *display = static_cast<Display*>(dpy);
Config *configuration = static_cast<Config*>(config);
AttributeMap attributes(attrib_list);
Error error = ValidateCreatePbufferSurface(display, configuration, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_SURFACE;
}
egl::Surface *surface = nullptr;
error = display->createPbufferSurface(configuration, attributes, &surface);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_SURFACE;
}
return static_cast<EGLSurface>(surface);
}
示例12: CreateStreamKHR
// EGL_KHR_stream
EGLStreamKHR EGLAPIENTRY CreateStreamKHR(EGLDisplay dpy, const EGLint *attrib_list)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, const EGLAttrib* attrib_list = 0x%0.8p)", dpy, attrib_list);
Display *display = static_cast<Display *>(dpy);
AttributeMap attributes = AttributeMap::CreateFromIntArray(attrib_list);
Error error = ValidateCreateStreamKHR(display, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_STREAM_KHR;
}
Stream *stream;
error = display->createStream(attributes, &stream);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_STREAM_KHR;
}
SetGlobalError(error);
return static_cast<EGLStreamKHR>(stream);
}
示例13: CreateImageKHR
ANGLE_EXPORT EGLImageKHR EGLAPIENTRY CreateImageKHR(EGLDisplay dpy,
EGLContext ctx,
EGLenum target,
EGLClientBuffer buffer,
const EGLint *attrib_list)
{
EVENT(
"(EGLDisplay dpy = 0x%0.8p, EGLContext ctx = 0x%0.8p, EGLenum target = 0x%X, "
"EGLClientBuffer buffer = 0x%0.8p, const EGLAttrib *attrib_list = 0x%0.8p)",
dpy, ctx, target, buffer, attrib_list);
Display *display = static_cast<Display *>(dpy);
gl::Context *context = static_cast<gl::Context *>(ctx);
AttributeMap attributes(attrib_list);
Error error = ValidateCreateImageKHR(display, context, target, buffer, attributes);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_IMAGE;
}
Image *image = nullptr;
error = display->createImage(context, target, buffer, attributes, &image);
if (error.isError())
{
SetGlobalError(error);
return EGL_NO_IMAGE;
}
return static_cast<EGLImage>(image);
}
示例14: DestroySurface
EGLBoolean EGLAPIENTRY DestroySurface(EGLDisplay dpy, EGLSurface surface)
{
EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p)", dpy, surface);
Display *display = static_cast<Display*>(dpy);
Surface *eglSurface = static_cast<Surface*>(surface);
Error error = ValidateSurface(display, eglSurface);
if (error.isError())
{
SetGlobalError(error);
return EGL_FALSE;
}
if (surface == EGL_NO_SURFACE)
{
SetGlobalError(Error(EGL_BAD_SURFACE));
return EGL_FALSE;
}
display->destroySurface((Surface*)surface);
SetGlobalError(Error(EGL_SUCCESS));
return EGL_TRUE;
}
示例15: QueryDeviceStringEXT
// EGL_EXT_device_query
const char * EGLAPIENTRY QueryDeviceStringEXT(EGLDeviceEXT device, EGLint name)
{
EVENT("(EGLDeviceEXT device = 0x%0.8p, EGLint name = %d)",
device, name);
Device *dev = static_cast<Device*>(device);
if (dev == EGL_NO_DEVICE_EXT)
{
SetGlobalError(Error(EGL_BAD_DEVICE_EXT));
return nullptr;
}
const char *result;
switch (name)
{
case EGL_EXTENSIONS:
result = dev->getExtensionString().c_str();
break;
default:
SetGlobalError(Error(EGL_BAD_DEVICE_EXT));
return nullptr;
}
SetGlobalError(Error(EGL_SUCCESS));
return result;
}