Example #1
0
/**
 * Notify the binding context to validate the buffer.
 */
void
xmesa_notify_invalid_buffer(XMesaBuffer b)
{
   XMesaContext xmctx = XMesaGetCurrentContext();

   if (xmctx && xmctx->xm_buffer == b)
      xmctx->st->notify_invalid_framebuffer(xmctx->st, b->stfb);
}
Example #2
0
/*
 * Copy sub-region of back buffer to front buffer
 */
void XMesaCopySubBuffer( XMesaBuffer b, int x, int y, int width, int height )
{
   XMesaContext xmctx = XMesaGetCurrentContext();

   xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);

   xmesa_copy_st_framebuffer(b->stfb,
         ST_ATTACHMENT_BACK_LEFT, ST_ATTACHMENT_FRONT_LEFT,
         x, b->height - y - height, width, height);
}
Example #3
0
File: xm_api.c Project: ideak/mesa
/**
 * Swap front and back color buffers and have winsys display front buffer.
 * If there's no front color buffer no swap actually occurs.
 */
PUBLIC
void XMesaSwapBuffers( XMesaBuffer b )
{
   XMesaContext xmctx = XMesaGetCurrentContext();

   if (xmctx && xmctx->xm_buffer == b) {
      xmctx->st->flush( xmctx->st, ST_FLUSH_FRONT, NULL);
   }

   xmesa_swap_st_framebuffer(b->stfb);
}
Example #4
0
/**
 * Swap front and back color buffers and have winsys display front buffer.
 * If there's no front color buffer no swap actually occurs.
 */
PUBLIC
void XMesaSwapBuffers( XMesaBuffer b )
{
   XMesaContext xmctx = XMesaGetCurrentContext();

   if (xmctx && xmctx->xm_buffer == b) {
      xmctx->st->flush( xmctx->st,
            PIPE_FLUSH_RENDER_CACHE | 
            PIPE_FLUSH_SWAPBUFFERS |
            PIPE_FLUSH_FRAME,
            NULL);
   }

   xmesa_swap_st_framebuffer(b->stfb);
}
Example #5
0
/**
 * Swap front and back color buffers and have winsys display front buffer.
 * If there's no front color buffer no swap actually occurs.
 */
PUBLIC
void XMesaSwapBuffers( XMesaBuffer b )
{
   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);
   }

   xmesa_swap_st_framebuffer(b->stfb);
}
Example #6
0
File: xm_api.c Project: ideak/mesa
/*
 * Bind buffer b to context c and make c the current rendering context.
 */
PUBLIC
GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer,
                             XMesaBuffer readBuffer )
{
   XMesaContext old_ctx = XMesaGetCurrentContext();

   if (old_ctx && old_ctx != c) {
      XMesaFlush(old_ctx);
      old_ctx->xm_buffer = NULL;
      old_ctx->xm_read_buffer = NULL;
   }

   if (c) {
      if (!drawBuffer || !readBuffer)
         return GL_FALSE;  /* must specify buffers! */

      if (c == old_ctx &&
	  c->xm_buffer == drawBuffer &&
	  c->xm_read_buffer == readBuffer)
	 return GL_TRUE;

      xmesa_check_buffer_size(drawBuffer);
      if (readBuffer != drawBuffer)
         xmesa_check_buffer_size(readBuffer);

      c->xm_buffer = drawBuffer;
      c->xm_read_buffer = readBuffer;

      stapi->make_current(stapi, c->st, drawBuffer->stfb, readBuffer->stfb);

      /* Solution to Stephane Rehel's problem with glXReleaseBuffersMESA(): */
      drawBuffer->wasCurrent = GL_TRUE;
   }
   else {
      /* Detach */
      stapi->make_current(stapi, NULL, NULL, NULL);

   }
   return GL_TRUE;
}
Example #7
0
GLXContext PUBLIC
glXGetCurrentContext(void)
{
   return (GLXContext) XMesaGetCurrentContext();
}