00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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"
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