added st_get_framebuffer_surface() and ST_SURFACE_x tokens

This commit is contained in:
Brian
2007-11-05 09:52:14 -07:00
parent f221ea658b
commit 616bf35569
2 changed files with 30 additions and 0 deletions
+20
View File
@@ -112,3 +112,23 @@ void st_unreference_framebuffer( struct st_framebuffer **stfb )
}
/**
* Return the pipe_surface for the given renderbuffer.
*/
struct pipe_surface *
st_get_framebuffer_surface(struct st_framebuffer *stfb, uint surfIndex)
{
struct st_renderbuffer *strb;
assert(surfIndex <= ST_SURFACE_BACK_RIGHT);
/* sanity checks, ST tokens should match Mesa tokens */
assert(ST_SURFACE_FRONT_LEFT == BUFFER_FRONT_LEFT);
assert(ST_SURFACE_BACK_RIGHT == BUFFER_BACK_RIGHT);
strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer);
if (strb)
return strb->surface;
return NULL;
}
+10
View File
@@ -30,6 +30,13 @@
#include "mtypes.h"
#define ST_SURFACE_FRONT_LEFT 0
#define ST_SURFACE_BACK_LEFT 1
#define ST_SURFACE_FRONT_RIGHT 2
#define ST_SURFACE_BACK_RIGHT 3
struct st_context;
struct st_framebuffer;
@@ -51,6 +58,9 @@ struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual );
void st_resize_framebuffer( struct st_framebuffer *stfb,
GLuint width, GLuint height );
struct pipe_surface *st_get_framebuffer_surface(struct st_framebuffer *stfb,
uint surfIndex);
void st_unreference_framebuffer( struct st_framebuffer **stfb );
void st_make_current(struct st_context *st,