Lines Matching refs:ctx
129 struct stw_context *ctx = stw_create_context_attribs(hdc, iLayerPlane, 0, 1, 0, 0,
132 if (!ctx)
135 DHGLRC ret = stw_create_context_handle(ctx, 0);
137 stw_destroy_context(ctx);
174 struct stw_context *ctx = NULL;
212 ctx = CALLOC_STRUCT( stw_context );
213 if (ctx == NULL)
216 ctx->hDrawDC = hdc;
217 ctx->hReadDC = hdc;
218 ctx->iPixelFormat = iPixelFormat;
219 ctx->shared = shareCtx != NULL;
281 ctx->st = stw_dev->stapi->create_context(stw_dev->stapi,
283 if (ctx->st == NULL)
286 ctx->st->st_manager_private = (void *) ctx;
288 if (ctx->st->cso_context) {
289 ctx->hud = hud_create(ctx->st->cso_context, ctx->st, NULL);
292 return ctx;
295 FREE(ctx);
301 stw_create_context_handle(struct stw_context *ctx, DHGLRC handle)
303 assert(ctx->dhglrc == 0);
317 handle_table_set(stw_dev->ctx_table, (unsigned) handle, ctx);
321 handle = (DHGLRC) handle_table_add(stw_dev->ctx_table, ctx);
324 ctx->dhglrc = handle;
328 return ctx->dhglrc;
332 stw_destroy_context(struct stw_context *ctx)
334 if (ctx->hud) {
335 hud_destroy(ctx->hud, NULL);
338 ctx->st->destroy(ctx->st);
339 FREE(ctx);
346 struct stw_context *ctx ;
353 ctx = stw_lookup_context_locked(dhglrc);
357 if (ctx) {
361 if (curctx == ctx)
364 stw_destroy_context(ctx);
372 stw_unbind_context(struct stw_context *ctx)
374 if (!ctx)
377 /* The expectation is that ctx is the same context which is
381 if (ctx != stw_current_context())
393 struct stw_context *ctx;
399 ctx = stw_lookup_context_locked( dhglrc );
402 return stw_unbind_context(ctx);
409 struct stw_context *ctx;
411 ctx = stw_current_context();
412 if (!ctx)
415 return ctx->dhglrc;
422 struct stw_context *ctx;
424 ctx = stw_current_context();
425 if (!ctx)
428 return ctx->hDrawDC;
434 struct stw_context *ctx;
436 ctx = stw_current_context();
437 if (!ctx)
440 return ctx->hReadDC;
462 stw_make_current(struct stw_framebuffer *fb, struct stw_framebuffer *fbRead, struct stw_context *ctx)
472 if (old_ctx == ctx) {
498 if (ctx) {
502 if (fb->iPixelFormat != ctx->iPixelFormat) {
506 if (fbRead->iPixelFormat != ctx->iPixelFormat) {
522 struct stw_framebuffer *old_fb = ctx->current_framebuffer;
523 struct stw_framebuffer *old_fbRead = ctx->current_read_framebuffer;
524 ctx->current_framebuffer = fb;
525 ctx->current_read_framebuffer = fbRead;
527 ret = stw_dev->stapi->make_current(stw_dev->stapi, ctx->st,
531 release_old_framebuffers(old_fb, old_fbRead, ctx);
553 if (old_ctx && old_ctx != ctx) {
590 struct stw_context *ctx = stw_lookup_context(dhglrc);
591 if (dhglrc && !ctx) {
597 if (ctx && !fb) {
604 if (ctx && !fbRead) {
605 release_old_framebuffers(fb, NULL, ctx);
610 BOOL success = stw_make_current(fb, fbRead, ctx);
612 if (ctx) {
614 ctx->hDrawDC = hDrawDC;
615 ctx->hReadDC = hReadDC;
617 ctx->hDrawDC = NULL;
618 ctx->hReadDC = NULL;
627 stw_framebuffer_release_locked(fb, ctx->st);
630 stw_framebuffer_release_locked(fbRead, ctx->st);