diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-01-28 16:11:46 +0000 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-01-28 16:11:46 +0000 |
commit | 67b6e5b907096ce9eee32c36c164acd38574cf14 (patch) | |
tree | 3820b57003653a806b988eac932d36ba8238fe32 /src/gallium/state_trackers/wgl/shared/stw_framebuffer.c | |
parent | 507498af1077390c684ca24e6ce6e0ee6ddcc479 (diff) |
wgl: split device structs, move swapbuffers to shared
Each of icd, shared and wgl now have the opportunity to maintain their
own per-device structs, which should reduce the need for these
modules to be looking into each others structures.
Diffstat (limited to 'src/gallium/state_trackers/wgl/shared/stw_framebuffer.c')
-rw-r--r-- | src/gallium/state_trackers/wgl/shared/stw_framebuffer.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c index 1ecafa451e..50edf7306d 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c @@ -29,9 +29,14 @@ #include "main/context.h" #include "pipe/p_format.h" +#include "pipe/p_screen.h" #include "state_tracker/st_context.h" #include "state_tracker/st_public.h" #include "stw_framebuffer.h" +#include "stw_device.h" +#include "stw_public.h" +#include "stw_winsys.h" + void framebuffer_resize( @@ -179,3 +184,29 @@ framebuffer_from_hdc( return fb; return NULL; } + + +BOOL +stw_swap_buffers( + HDC hdc ) +{ + struct stw_framebuffer *fb; + struct pipe_surface *surf; + + fb = framebuffer_from_hdc( hdc ); + if (fb == NULL) + return FALSE; + + /* If we're swapping the buffer associated with the current context + * we have to flush any pending rendering commands first. + */ + st_notify_swapbuffers( fb->stfb ); + + st_get_framebuffer_surface( fb->stfb, ST_SURFACE_BACK_LEFT, &surf ); + + stw_dev->stw_winsys->flush_frontbuffer(stw_dev->screen->winsys, + surf, + hdc ); + + return TRUE; +} |