#include "xm_image.h"
#endif
#include "state_tracker/st_cb_fbo.h"
+#include "state_tracker/st_context.h"
+#include "state_tracker/st_public.h"
#include "pipe/softpipe/sp_context.h"
#include "pipe/softpipe/sp_surface.h"
* Basically corresponds to a GLXContext.
*/
struct xmesa_context {
- GLcontext mesa; /* the core library context (containment) */
+ struct st_context *st;
+
XMesaVisual xm_visual; /* Describes the buffers */
XMesaBuffer xm_buffer; /* current span/point/line/triangle buffer */
* Basically corresponds to a GLXDrawable.
*/
struct xmesa_buffer {
- GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
- /* This MUST BE FIRST! */
+ struct st_framebuffer *stfb;
+
GLboolean wasCurrent; /* was ever the current buffer? */
XMesaVisual xm_visual; /* the X/Mesa visual */
xmesa_find_buffer(XMesaDisplay *dpy, XMesaColormap cmap, XMesaBuffer notThis);
extern unsigned long
-xmesa_color_to_pixel( GLcontext *ctx,
+xmesa_color_to_pixel( XMesaContext xmesa,
GLubyte r, GLubyte g, GLubyte b, GLubyte a,
GLuint pixelFormat );
static INLINE XMesaContext
XMESA_CONTEXT(GLcontext *ctx)
{
- return (XMesaContext) ctx;
+ return (XMesaContext) ctx->DriverCtx;
}
* XXX should use inlined function for better type safety.
*/
static INLINE XMesaBuffer
-XMESA_BUFFER(GLframebuffer *b)
+XMESA_BUFFER(GLframebuffer *fb)
{
- return (XMesaBuffer) b;
+ struct st_framebuffer *stfb = (struct st_framebuffer *) fb;
+ return (XMesaBuffer) st_framebuffer_private(stfb);
}
xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, uint value);
extern struct pipe_context *
-xmesa_create_softpipe(XMesaContext xm);
+xmesa_create_context(XMesaContext xm);
extern struct pipe_surface *
xmesa_surface_alloc(struct pipe_context *pipe, GLuint format);
extern struct pipe_surface *
xmesa_create_front_surface(XMesaVisual vis, Window win);
+static INLINE GLuint
+xmesa_buffer_width(XMesaBuffer b)
+{
+ return b->stfb->Base.Width;
+}
+
+static INLINE GLuint
+xmesa_buffer_height(XMesaBuffer b)
+{
+ return b->stfb->Base.Height;
+}
+
+
#endif