#include "util/u_atomic.h"
#include "util/u_inlines.h"
+#include "hud/hud_context.h"
+
#include "xm_public.h"
#include <GL/glx.h>
c->st->st_manager_private = (void *) c;
+ c->hud = hud_create(c->st->pipe, c->st->cso_context);
+
return c;
fail:
PUBLIC
void XMesaDestroyContext( XMesaContext c )
{
+ if (c->hud) {
+ hud_destroy(c->hud);
+ }
+
c->st->destroy(c->st);
/* FIXME: We should destroy the screen here, but if we do so, surfaces may
{
XMesaContext xmctx = XMesaGetCurrentContext();
+ /* Need to draw HUD before flushing */
+ if (xmctx && xmctx->hud) {
+ struct pipe_resource *back =
+ xmesa_get_framebuffer_resource(b->stfb, ST_ATTACHMENT_BACK_LEFT);
+ hud_draw(xmctx->hud, back);
+ }
+
if (xmctx && xmctx->xm_buffer == b) {
xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);
}
# include <X11/Xlibint.h>
# include <X11/Xutil.h>
+struct hud_context;
+
typedef struct xmesa_display *XMesaDisplay;
typedef struct xmesa_buffer *XMesaBuffer;
typedef struct xmesa_context *XMesaContext;
XMesaVisual xm_visual; /** pixel format info */
XMesaBuffer xm_buffer; /** current drawbuffer */
XMesaBuffer xm_read_buffer; /** current readbuffer */
+ struct hud_context *hud;
};
free(stfbi);
}
+/**
+ * Return the pipe_surface which corresponds to the given
+ * framebuffer attachment.
+ */
+struct pipe_resource *
+xmesa_get_framebuffer_resource(struct st_framebuffer_iface *stfbi,
+ enum st_attachment_type att)
+{
+ struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi);
+ return xstfb->textures[att];
+}
+
void
xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi)
{
void
xmesa_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi);
+struct pipe_resource *
+xmesa_get_framebuffer_resource(struct st_framebuffer_iface *stfbi,
+ enum st_attachment_type att);
+
void
xmesa_swap_st_framebuffer(struct st_framebuffer_iface *stfbi);