diff options
author | Brian <[email protected]> | 2007-11-01 17:46:04 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-11-01 18:01:47 -0600 |
commit | 80d2658e129d097f30c84fe57e07daeb81bcc790 (patch) | |
tree | 82cca12dd1c9a9def551511f50352c5e91560fab /src | |
parent | 7cafaff0ebb7c3fb7461573442aa44b354682d81 (diff) |
Sketch out new create/destroy context functions which create/wrap a Mesa context.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 27 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_public.h | 6 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 69942d96854..1d129ad077d 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -26,6 +26,7 @@ **************************************************************************/ #include "main/imports.h" +#include "main/context.h" #include "main/extensions.h" #include "vbo/vbo.h" #include "st_public.h" @@ -67,6 +68,23 @@ void st_invalidate_state(GLcontext * ctx, GLuint new_state) } +struct st_context *st_create_context2(struct pipe_context *pipe, + const GLvisual *visual, + struct st_context *share) +{ + GLcontext *ctx; + GLcontext *shareCtx = share ? share->ctx : NULL; + struct dd_function_table funcs; + + memset(&funcs, 0, sizeof(funcs)); + st_init_driver_functions(&funcs); + + ctx = _mesa_create_context(visual, shareCtx, &funcs, NULL); + + return st_create_context(ctx, pipe); +} + + struct st_context *st_create_context( GLcontext *ctx, struct pipe_context *pipe ) { @@ -111,6 +129,15 @@ struct st_context *st_create_context( GLcontext *ctx, } +void st_destroy_context2( struct st_context *st ) +{ + GLcontext *ctx = st->ctx; + _mesa_free_context_data(ctx); + st_destroy_context(st); + free(ctx); +} + + void st_destroy_context( struct st_context *st ) { draw_destroy(st->draw); diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h index 3191549a2f8..3056b5a3e7d 100644 --- a/src/mesa/state_tracker/st_public.h +++ b/src/mesa/state_tracker/st_public.h @@ -36,8 +36,14 @@ struct pipe_context; struct st_context *st_create_context( GLcontext *ctx, struct pipe_context *pipe); +struct st_context *st_create_context2(struct pipe_context *pipe, + const GLvisual *visual, + struct st_context *share); + void st_destroy_context( struct st_context *st ); +void st_destroy_context2( struct st_context *st ); + void st_invalidate_state(GLcontext * ctx, GLuint new_state); #endif |