st_public.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  * 
00003  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
00004  * All Rights Reserved.
00005  * 
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  * 
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00021  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00022  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00023  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00024  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  * 
00026  **************************************************************************/
00027 
00028 #ifndef ST_PUBLIC_H
00029 #define ST_PUBLIC_H
00030 
00031 #include "GL/gl.h"
00032 #include "GL/internal/glcore.h"  /* for __GLcontextModes */
00033 
00034 #include "pipe/p_compiler.h"
00035 #include "pipe/p_format.h"
00036 
00037 
00038 #define ST_SURFACE_FRONT_LEFT   0
00039 #define ST_SURFACE_BACK_LEFT    1
00040 #define ST_SURFACE_FRONT_RIGHT  2
00041 #define ST_SURFACE_BACK_RIGHT   3
00042 #define ST_SURFACE_DEPTH        8
00043 
00044 #define ST_TEXTURE_2D    0x2
00045 #define ST_TEXTURE_RGB   0x1
00046 #define ST_TEXTURE_RGBA  0x2
00047 
00048 
00049 struct st_context;
00050 struct st_framebuffer;
00051 struct pipe_context;
00052 struct pipe_fence_handle;
00053 struct pipe_surface;
00054 
00055 
00056 struct st_context *st_create_context(struct pipe_context *pipe,
00057                                      const __GLcontextModes *visual,
00058                                      struct st_context *share);
00059 
00060 void st_destroy_context( struct st_context *st );
00061 
00062 void st_copy_context_state(struct st_context *dst, struct st_context *src,
00063                            uint mask);
00064 
00065 struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual,
00066                                               enum pipe_format colorFormat,
00067                                               enum pipe_format depthFormat,
00068                                               enum pipe_format stencilFormat,
00069                                               uint width, uint height,
00070                                               void *privateData);
00071 
00072 void st_resize_framebuffer( struct st_framebuffer *stfb,
00073                             uint width, uint height );
00074 
00075 void st_set_framebuffer_surface(struct st_framebuffer *stfb,
00076                                 uint surfIndex, struct pipe_surface *surf);
00077 
00078 struct pipe_surface *st_get_framebuffer_surface(struct st_framebuffer *stfb,
00079                                                 uint surfIndex);
00080 
00081 struct pipe_texture *st_get_framebuffer_texture(struct st_framebuffer *stfb,
00082                                                 uint surfIndex);
00083 
00084 void *st_framebuffer_private( struct st_framebuffer *stfb );
00085 
00086 void st_unreference_framebuffer( struct st_framebuffer **stfb );
00087 
00088 void st_make_current(struct st_context *st,
00089                      struct st_framebuffer *draw,
00090                      struct st_framebuffer *read);
00091 
00092 void st_flush( struct st_context *st, uint pipeFlushFlags,
00093                struct pipe_fence_handle **fence );
00094 void st_finish( struct st_context *st );
00095 
00096 void st_notify_swapbuffers(struct st_framebuffer *stfb);
00097 void st_notify_swapbuffers_complete(struct st_framebuffer *stfb);
00098 
00099 
00101 int st_bind_teximage(struct st_framebuffer *stfb, uint surfIndex,
00102                      int target, int format, int level);
00103 
00105 int st_release_teximage(struct st_framebuffer *stfb, uint surfIndex,
00106                         int target, int format, int level);
00107 
00108 
00110 typedef void (*st_proc)();
00111 
00112 st_proc st_get_proc_address(const char *procname);
00113 
00114 
00115 #endif

Generated on Tue Sep 29 06:25:18 2009 for Gallium3D by  doxygen 1.5.4