From: Brian Date: Fri, 2 Nov 2007 19:22:22 +0000 (-0600) Subject: Introduce st_framebuffer type and st_create_framebuffer(), st_make_current() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=794e03d3926614036d285f2033d8708c7667814a;p=mesa.git Introduce st_framebuffer type and st_create_framebuffer(), st_make_current() --- diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 1d129ad077d..db933b86e41 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -155,6 +155,29 @@ void st_destroy_context( struct st_context *st ) } +struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual ) +{ + struct st_framebuffer *stfb + = CALLOC_STRUCT(st_framebuffer); + if (stfb) { + } + return stfb; +} + + +void st_make_current(struct st_context *st, + struct st_framebuffer *draw, + struct st_framebuffer *read) +{ + if (st) { + _mesa_make_current(st->ctx, &draw->Base, &read->Base); + } + else { + _mesa_make_current(NULL, NULL, NULL); + } +} + + void st_init_driver_functions(struct dd_function_table *functions) { diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 7ab69df7c7b..9b232827f4a 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -167,6 +167,16 @@ static INLINE struct st_context *st_context(GLcontext *ctx) } +/** + * Wrapper for GLframebuffer, nothing extra for now. + * This is an opaque type to the outside world. + */ +struct st_framebuffer +{ + GLframebuffer Base; +}; + + extern void st_init_driver_functions(struct dd_function_table *functions); diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 1cc6e6e40e2..94d1cdfde45 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -31,6 +31,8 @@ #include "mtypes.h" struct st_context; +struct st_framebuffer; + struct pipe_context; struct st_context *st_create_context( GLcontext *ctx, @@ -44,6 +46,12 @@ void st_destroy_context( struct st_context *st ); void st_destroy_context2( struct st_context *st ); +struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual ); + +void st_make_current(struct st_context *st, + struct st_framebuffer *draw, + struct st_framebuffer *read); + void st_invalidate_state(GLcontext * ctx, GLuint new_state); void st_flush( struct st_context *st );