goto cleanup;
}
- wgl_dpy->screen = stw_get_device()->screen;
+ struct stw_device *stw_dev = stw_get_device();
+ wgl_dpy->screen = stw_dev->screen;
+ wgl_dpy->smapi = stw_dev->smapi;
disp->ClientAPIs = 0;
if (_eglIsApiValid(EGL_OPENGL_API))
if (wgl_ctx->base.ResetNotificationStrategy != EGL_NO_RESET_NOTIFICATION)
resetStrategy = WGL_LOSE_CONTEXT_ON_RESET_ARB;
wgl_ctx->ctx = stw_create_context_attribs(disp->PlatformDisplay, 0, shared,
+ wgl_dpy->smapi,
wgl_ctx->base.ClientMajorVersion,
wgl_ctx->base.ClientMinorVersion,
flags,
{
int ref_count;
struct pipe_screen *screen;
+ struct st_manager *smapi;
};
struct wgl_egl_config
DHGLRC APIENTRY
DrvCreateLayerContext(HDC hdc, INT iLayerPlane)
{
- struct stw_context *ctx = stw_create_context_attribs(hdc, iLayerPlane, 0, 1, 0, 0,
+ if (!stw_dev)
+ return 0;
+
+ struct stw_context *ctx = stw_create_context_attribs(hdc, iLayerPlane, NULL, stw_dev->smapi, 1, 0, 0,
WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
0, WGL_NO_RESET_NOTIFICATION_ARB);
if (!ctx)
*/
struct stw_context *
stw_create_context_attribs(HDC hdc, INT iLayerPlane, struct stw_context *shareCtx,
+ struct st_manager *smapi,
int majorVersion, int minorVersion,
int contextFlags, int profileMask,
int iPixelFormat, int resetStrategy)
attribs.options = stw_dev->st_options;
ctx->st = stw_dev->stapi->create_context(stw_dev->stapi,
- stw_dev->smapi, &attribs, &ctx_err, shareCtx ? shareCtx->st : NULL);
+ smapi, &attribs, &ctx_err, shareCtx ? shareCtx->st : NULL);
if (ctx->st == NULL)
goto no_st_ctx;
struct hud_context;
struct stw_framebuffer;
struct st_context_iface;
+struct st_manager;
struct stw_context
{
struct stw_context *stw_create_context_attribs(HDC hdc, INT iLayerPlane,
struct stw_context *shareCtx,
+ struct st_manager *smapi,
int majorVersion, int minorVersion,
int contextFlags, int profileMask,
int iPixelFormat, int resetStrategy);
WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB |
WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB);
+ if (!stw_dev)
+ return NULL;
+
/* parse attrib_list */
if (attribList) {
for (i = 0; !done && attribList[i]; i++) {
struct stw_context *share_stw = stw_lookup_context(share_dhglrc);
struct stw_context *stw_ctx = stw_create_context_attribs(hDC, layerPlane, share_stw,
+ stw_dev->smapi,
majorVersion, minorVersion,
contextFlags, profileMask, 0,
resetStrategy);