/**
* Allocate a new XMesaBuffer object which corresponds to the given drawable.
- * Note that XMesaBuffer is derived from GLframebuffer.
+ * Note that XMesaBuffer is derived from struct gl_framebuffer.
* The new XMesaBuffer will not have any size (Width=Height=0).
*
* \param d the corresponding X drawable (window or pixmap)
MesaDriver();
~MesaDriver();
- void Init(BGLView * bglview, GLcontext * c, struct gl_config * v, GLframebuffer * b);
+ void Init(BGLView * bglview, GLcontext * c, struct gl_config * v, struct gl_framebuffer * b);
void LockGL();
void UnlockGL();
GLcontext * m_glcontext;
struct gl_config * m_glvisual;
- GLframebuffer * m_glframebuffer;
+ struct gl_framebuffer * m_glframebuffer;
BGLView * m_bglview;
BBitmap * m_bitmap;
static void Index(GLcontext *ctx, GLuint index);
static void Color(GLcontext *ctx, GLubyte r, GLubyte g,
GLubyte b, GLubyte a);
- static void SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
+ static void SetBuffer(GLcontext *ctx, struct gl_framebuffer *colorBuffer,
GLenum mode);
- static void GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
+ static void GetBufferSize(struct gl_framebuffer * framebuffer, GLuint *width,
GLuint *height);
static void Error(GLcontext *ctx);
static const GLubyte * GetString(GLcontext *ctx, GLenum name);
// create core framebuffer
- GLframebuffer * buffer = _mesa_create_framebuffer(visual,
+ struct gl_framebuffer * buffer = _mesa_create_framebuffer(visual,
depth > 0 ? GL_TRUE : GL_FALSE,
stencil > 0 ? GL_TRUE: GL_FALSE,
accum > 0 ? GL_TRUE : GL_FALSE,
}
-void MesaDriver::Init(BGLView * bglview, GLcontext * ctx, struct gl_config * visual, GLframebuffer * framebuffer)
+void MesaDriver::Init(BGLView * bglview, GLcontext * ctx, struct gl_config * visual, struct gl_framebuffer * framebuffer)
{
m_bglview = bglview;
m_glcontext = ctx;
}
-void MesaDriver::SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
+void MesaDriver::SetBuffer(GLcontext *ctx, struct gl_framebuffer *buffer,
GLenum mode)
{
/* TODO */
(void) mode;
}
-void MesaDriver::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
+void MesaDriver::GetBufferSize(struct gl_framebuffer * framebuffer, GLuint *width,
GLuint *height)
{
GET_CURRENT_CONTEXT(ctx);
drmActual, drmExpected);
}
-GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer,
+GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer,
GLint *x, GLint *y,
GLsizei *width, GLsizei *height )
{
const __DRIversion * ddxActual, const __DRIutilversion2 * ddxExpected,
const __DRIversion * drmActual, const __DRIversion * drmExpected);
-extern GLboolean driClipRectToFramebuffer( const GLframebuffer *buffer,
+extern GLboolean driClipRectToFramebuffer( const struct gl_framebuffer *buffer,
GLint *x, GLint *y,
GLsizei *width, GLsizei *height );
}
}
-static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
+static void i810BufferSize(struct gl_framebuffer *buffer, GLuint *width, GLuint *height)
{
GET_CURRENT_CONTEXT(ctx);
i810ContextPtr imesa = I810_CONTEXT(ctx);
imesa->driDrawable = driDrawPriv;
_mesa_make_current(imesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate);
/* Are these necessary?
*/
/* DRI stuff
*/
GLuint needClip;
- GLframebuffer *glBuffer;
+ struct gl_framebuffer *glBuffer;
GLboolean doPageFlip;
/* These refer to the current draw (front vs. back) buffer:
static void
i810DestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
const struct __DriverAPIRec driDriverAPI = {
}
_mesa_make_current( newMach64Ctx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate );
newMach64Ctx->new_state |= MACH64_NEW_CLIP;
/* Return the current color buffer size.
*/
-static void mach64DDGetBufferSize( GLframebuffer *buffer,
+static void mach64DDGetBufferSize( struct gl_framebuffer *buffer,
GLuint *width, GLuint *height )
{
GET_CURRENT_CONTEXT(ctx);
static void
mach64DestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
static void
mgaDestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
static void
mmesa->driReadable = driReadPriv;
_mesa_make_current(mmesa->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate);
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate);
}
else {
_mesa_make_current(NULL, NULL, NULL);
static GLboolean
clip_pixelrect( const GLcontext *ctx,
- const GLframebuffer *buffer,
+ const struct gl_framebuffer *buffer,
GLint *x, GLint *y,
GLsizei *width, GLsizei *height,
GLint *skipPixels, GLint *skipRows,
newR128Ctx->driDrawable = driDrawPriv;
_mesa_make_current( newR128Ctx->glCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate );
newR128Ctx->new_state |= R128_NEW_WINDOW | R128_NEW_CLIP;
} else {
/* Return the width and height of the current color buffer.
*/
-static void r128GetBufferSize( GLframebuffer *buffer,
+static void r128GetBufferSize( struct gl_framebuffer *buffer,
GLuint *width, GLuint *height )
{
GET_CURRENT_CONTEXT(ctx);
static void
r128DestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
if (!rfb)
return;
radeon_cleanup_renderbuffers(rfb);
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
static void
savageDestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
#if 0
savageContextPtr imesa
= (savageContextPtr) driContextPriv->driverPrivate;
struct gl_framebuffer *drawBuffer
- = (GLframebuffer *) driDrawPriv->driverPrivate;
+ = (struct gl_framebuffer *) driDrawPriv->driverPrivate;
struct gl_framebuffer *readBuffer
- = (GLframebuffer *) driReadPriv->driverPrivate;
+ = (struct gl_framebuffer *) driReadPriv->driverPrivate;
driRenderbuffer *frontRb = (driRenderbuffer *)
drawBuffer->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
driRenderbuffer *backRb = (driRenderbuffer *)
/* DRI stuff */
GLuint bufferSize;
- GLframebuffer *glBuffer;
+ struct gl_framebuffer *glBuffer;
/* Two flags to keep track of fallbacks. */
GLuint Fallback;
}
}
-void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+void sisReAllocateBuffers(GLcontext *ctx, struct gl_framebuffer *drawbuffer,
GLuint width, GLuint height)
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
newSisCtx->driDrawable = driDrawPriv;
- drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
- readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
+ drawBuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate;
+ readBuffer = (struct gl_framebuffer *)driReadPriv->driverPrivate;
_mesa_make_current( newSisCtx->glCtx, drawBuffer, readBuffer );
void *sharedContextPrivate );
extern void sisDestroyContext( __DRIcontext * );
-void sisReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+void sisReAllocateBuffers(GLcontext *ctx, struct gl_framebuffer *drawbuffer,
GLuint width, GLuint height);
extern GLboolean sisMakeCurrent( __DRIcontext *driContextPriv,
/* Return the width and height of the given buffer.
*/
static void
-sisGetBufferSize( GLframebuffer *buffer,
+sisGetBufferSize( struct gl_framebuffer *buffer,
GLuint *width, GLuint *height )
{
GET_CURRENT_CONTEXT(ctx);
static void
sisDestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
static void sisCopyBuffer( __DRIdrawable *dPriv )
const struct gl_config * visual, GLboolean isPixmap)
{
struct dri_drawable *drawable = NULL;
- GLframebuffer *fb;
+ struct gl_framebuffer *fb;
struct swrast_renderbuffer *frontrb, *backrb;
TRACE;
if (dPriv) {
struct dri_drawable *drawable = dri_drawable(dPriv);
- GLframebuffer *fb;
+ struct gl_framebuffer *fb;
free(drawable->row);
GET_CURRENT_CONTEXT(ctx);
struct dri_drawable *drawable = dri_drawable(dPriv);
- GLframebuffer *fb;
+ struct gl_framebuffer *fb;
struct swrast_renderbuffer *frontrb, *backrb;
TRACE;
*/
static void
-get_window_size( GLframebuffer *fb, GLsizei *w, GLsizei *h )
+get_window_size( struct gl_framebuffer *fb, GLsizei *w, GLsizei *h )
{
__DRIdrawable *dPriv = swrast_drawable(fb)->dPriv;
__DRIscreen *sPriv = dPriv->driScreenPriv;
}
static void
-swrast_check_and_update_window_size( GLcontext *ctx, GLframebuffer *fb )
+swrast_check_and_update_window_size( GLcontext *ctx, struct gl_framebuffer *fb )
{
GLsizei width, height;
static void
viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
- GLframebuffer *draw = ctx->WinSysDrawBuffer;
- GLframebuffer *read = ctx->WinSysReadBuffer;
+ struct gl_framebuffer *draw = ctx->WinSysDrawBuffer;
+ struct gl_framebuffer *read = ctx->WinSysReadBuffer;
swrast_check_and_update_window_size(ctx, draw);
swrast_check_and_update_window_size(ctx, read);
__DRIdrawable * driReadPriv)
{
GLcontext *mesaCtx;
- GLframebuffer *mesaDraw;
- GLframebuffer *mesaRead;
+ struct gl_framebuffer *mesaDraw;
+ struct gl_framebuffer *mesaRead;
TRACE;
if (cPriv) {
struct dri_drawable
{
/* mesa, base class, must be first */
- GLframebuffer Base;
+ struct gl_framebuffer Base;
/* dri */
__DRIdrawable *dPriv;
}
static INLINE struct dri_drawable *
-swrast_drawable(GLframebuffer *fb)
+swrast_drawable(struct gl_framebuffer *fb)
{
return (struct dri_drawable *) fb;
}
* dispatch is set correctly.
*/
_mesa_make_current( newCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate );
return GL_TRUE;
}
/* [dBorca] tunnel2 requires this */
}
_mesa_make_current( newCtx,
- (GLframebuffer *) driDrawPriv->driverPrivate,
- (GLframebuffer *) driReadPriv->driverPrivate );
+ (struct gl_framebuffer *) driDrawPriv->driverPrivate,
+ (struct gl_framebuffer *) driReadPriv->driverPrivate );
} else {
_mesa_make_current( NULL, NULL, NULL );
}
static void
tdfxDestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
{
GET_CURRENT_CONTEXT(ctx);
tdfxContextPtr fxMesa = 0;
- GLframebuffer *mesaBuffer;
+ struct gl_framebuffer *mesaBuffer;
if ( TDFX_DEBUG & DEBUG_VERBOSE_DRI ) {
fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *)driDrawPriv );
}
- mesaBuffer = (GLframebuffer *) driDrawPriv->driverPrivate;
+ mesaBuffer = (struct gl_framebuffer *) driDrawPriv->driverPrivate;
if ( !mesaBuffer->Visual.doubleBufferMode )
return; /* can't swap a single-buffered window */
}
-void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer,
+void viaReAllocateBuffers(GLcontext *ctx, struct gl_framebuffer *drawbuffer,
GLuint width, GLuint height)
{
struct via_context *vmesa = VIA_CONTEXT(ctx);
GLcontext *ctx = vmesa->glCtx;
struct gl_framebuffer *drawBuffer, *readBuffer;
- drawBuffer = (GLframebuffer *)driDrawPriv->driverPrivate;
- readBuffer = (GLframebuffer *)driReadPriv->driverPrivate;
+ drawBuffer = (struct gl_framebuffer *)driDrawPriv->driverPrivate;
+ readBuffer = (struct gl_framebuffer *)driReadPriv->driverPrivate;
if ((vmesa->driDrawable != driDrawPriv)
|| (vmesa->driReadable != driReadPriv)) {
extern void viaEmitScissorValues(struct via_context *vmesa, int box_nr, int emit);
extern void viaXMesaSetBackClipRects(struct via_context *vmesa);
extern void viaXMesaSetFrontClipRects(struct via_context *vmesa);
-extern void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, GLuint width, GLuint height);
+extern void viaReAllocateBuffers(GLcontext *ctx, struct gl_framebuffer *drawbuffer, GLuint width, GLuint height);
extern void viaXMesaWindowMoved(struct via_context *vmesa);
extern GLboolean viaTexCombineState(struct via_context *vmesa,
static void
viaDestroyBuffer(__DRIdrawable *driDrawPriv)
{
- _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
+ _mesa_reference_framebuffer((struct gl_framebuffer **)(&(driDrawPriv->driverPrivate)), NULL);
}
static const __DRIconfig **
};
/**
- * Derived from Mesa's GLframebuffer class.
+ * Derived from Mesa's struct gl_framebuffer class.
*/
struct GLFBDevBufferRec {
- GLframebuffer glframebuffer; /* base class */
+ struct gl_framebuffer glframebuffer; /* base class */
GLFBDevVisualPtr visual;
struct fb_fix_screeninfo fix;
struct fb_var_screeninfo var;
static void
-get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
+get_buffer_size( struct gl_framebuffer *buffer, GLuint *width, GLuint *height )
{
const GLFBDevBufferPtr fbdevbuffer = (GLFBDevBufferPtr) buffer;
*width = fbdevbuffer->var.xres;
viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
GLuint newWidth, newHeight;
- GLframebuffer *buffer;
+ struct gl_framebuffer *buffer;
buffer = ctx->WinSysDrawBuffer;
get_buffer_size( buffer, &newWidth, &newHeight );
GLcontext mesa; /*< Base class - this must be first */
struct gl_config *gl_visual; /*< Describes the buffers */
struct gl_renderbuffer *rb; /*< The user's colorbuffer */
- GLframebuffer *gl_buffer; /*< The framebuffer, containing user's rb */
+ struct gl_framebuffer *gl_buffer; /*< The framebuffer, containing user's rb */
GLenum format; /*< User-specified context format */
GLint userRowLength; /*< user-specified number of pixels per row */
GLint rInd, gInd, bInd, aInd;/*< index offsets for RGBA formats */
/**
- * Given a GLframebuffer, return the corresponding WMesaFramebuffer.
+ * Given a struct gl_framebuffer, return the corresponding WMesaFramebuffer.
*/
-static WMesaFramebuffer wmesa_framebuffer(GLframebuffer *fb)
+static WMesaFramebuffer wmesa_framebuffer(struct gl_framebuffer *fb)
{
return (WMesaFramebuffer) fb;
}
static void
-wmesa_get_buffer_size(GLframebuffer *buffer, GLuint *width, GLuint *height)
+wmesa_get_buffer_size(struct gl_framebuffer *buffer, GLuint *width, GLuint *height)
{
WMesaFramebuffer pwfb = wmesa_framebuffer(buffer);
get_window_size(pwfb->hDC, width, height);
* Resize the front/back colorbuffers to match the latest window size.
*/
static void
-wmesa_resize_buffers(GLcontext *ctx, GLframebuffer *buffer,
+wmesa_resize_buffers(GLcontext *ctx, struct gl_framebuffer *buffer,
GLuint width, GLuint height)
{
WMesaContext pwc = wmesa_context(ctx);
// Mesa vars:
GLcontext *glCtx; // The core Mesa context
struct gl_config *glVis; // Describes the color buffer
- GLframebuffer *glBuffer; // Ancillary buffers
+ struct gl_framebuffer *glBuffer; // Ancillary buffers
GLuint ClearIndex;
GLuint CurrentIndex;
//
GLcontext *glCtx; // The core Mesa context
struct gl_config *glVis; // Describes the color buffer
- GLframebuffer *glBuffer; // Ancillary buffers
+ struct gl_framebuffer *glBuffer; // Ancillary buffers
GLuint ClearIndex;
GLuint CurrentIndex;
static void gld_set_read_buffer_DX7(
GLcontext *ctx,
- GLframebuffer *buffer,
+ struct gl_framebuffer *buffer,
GLenum mode)
{
/* separate read buffer not supported */
// Mesa 5: Parameter change
static void gld_buffer_size_DX7(
// GLcontext *ctx,
- GLframebuffer *fb,
+ struct gl_framebuffer *fb,
GLuint *width,
GLuint *height)
{
// Mesa 5: Parameter change
void gldResizeBuffers_DX7(
// GLcontext *ctx)
- GLframebuffer *fb)
+ struct gl_framebuffer *fb)
{
GET_CURRENT_CONTEXT(ctx);
dglWglResizeBuffers(ctx, TRUE);
void gldEnableExtensions_DX7(GLcontext *ctx);
void gldInstallPipeline_DX7(GLcontext *ctx);
void gldSetupDriverPointers_DX7(GLcontext *ctx);
-void gldResizeBuffers_DX7(GLframebuffer *fb);
+void gldResizeBuffers_DX7(struct gl_framebuffer *fb);
// Texture functions
static void gld_set_read_buffer_DX8(
GLcontext *ctx,
- GLframebuffer *buffer,
+ struct gl_framebuffer *buffer,
GLenum mode)
{
/* separate read buffer not supported */
// Mesa 5: Parameter change
static void gld_buffer_size_DX8(
// GLcontext *ctx,
- GLframebuffer *fb,
+ struct gl_framebuffer *fb,
GLuint *width,
GLuint *height)
{
// Mesa 5: Parameter change
void gldResizeBuffers_DX8(
// GLcontext *ctx)
- GLframebuffer *fb)
+ struct gl_framebuffer *fb)
{
GET_CURRENT_CONTEXT(ctx);
dglWglResizeBuffers(ctx, TRUE);
void gldInstallPipeline_DX8(GLcontext *ctx);
void gldSetupDriverPointers_DX8(GLcontext *ctx);
//void gldResizeBuffers_DX8(GLcontext *ctx);
-void gldResizeBuffers_DX8(GLframebuffer *fb);
+void gldResizeBuffers_DX8(struct gl_framebuffer *fb);
// Texture functions
static void gld_set_read_buffer_DX9(
GLcontext *ctx,
- GLframebuffer *buffer,
+ struct gl_framebuffer *buffer,
GLenum mode)
{
/* separate read buffer not supported */
// Mesa 5: Parameter change
static void gld_buffer_size_DX9(
// GLcontext *ctx,
- GLframebuffer *fb,
+ struct gl_framebuffer *fb,
GLuint *width,
GLuint *height)
{
// Mesa 5: Parameter change
void gldResizeBuffers_DX9(
// GLcontext *ctx)
- GLframebuffer *fb)
+ struct gl_framebuffer *fb)
{
GET_CURRENT_CONTEXT(ctx);
dglWglResizeBuffers(ctx, TRUE);
void gldInstallPipeline_DX9(GLcontext *ctx);
void gldSetupDriverPointers_DX9(GLcontext *ctx);
//void gldResizeBuffers_DX9(GLcontext *ctx);
-void gldResizeBuffers_DX9(GLframebuffer *fb);
+void gldResizeBuffers_DX9(struct gl_framebuffer *fb);
// Texture functions
//---------------------------------------------------------------------------
-static void set_read_buffer(GLcontext *ctx, GLframebuffer *colorBuffer,
+static void set_read_buffer(GLcontext *ctx, struct gl_framebuffer *colorBuffer,
GLenum buffer )
{
/* XXX todo */
//static void buffer_size( GLcontext* ctx, GLuint *width, GLuint *height )
// Altered for Mesa 5.x. KeithH
static void buffer_size(
- GLframebuffer *buffer,
+ struct gl_framebuffer *buffer,
GLuint *width,
GLuint *height)
{
/**
* Allocate a new XMesaBuffer object which corresponds to the given drawable.
- * Note that XMesaBuffer is derived from GLframebuffer.
+ * Note that XMesaBuffer is derived from struct gl_framebuffer.
* The new XMesaBuffer will not have any size (Width=Height=0).
*
* \param d the corresponding X drawable (window or pixmap)
/**
- * Query the current window size and update the corresponding GLframebuffer
+ * Query the current window size and update the corresponding struct gl_framebuffer
* and all attached renderbuffers.
* Called when:
* 1. the first time a buffer is bound to a context.
* Basically corresponds to a GLXDrawable.
*/
struct xmesa_buffer {
- GLframebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
+ struct gl_framebuffer mesa_buffer; /* depth, stencil, accum, etc buffers */
/* This MUST BE FIRST! */
GLboolean wasCurrent; /* was ever the current buffer? */
XMesaVisual xm_visual; /* the X/Mesa visual */
/**
- * Return pointer to XMesaBuffer corresponding to a Mesa GLframebuffer.
+ * Return pointer to XMesaBuffer corresponding to a Mesa struct gl_framebuffer.
* Since we're using structure containment, it's just a cast!.
*/
static INLINE XMesaBuffer
-XMESA_BUFFER(GLframebuffer *b)
+XMESA_BUFFER(struct gl_framebuffer *b)
{
return (XMesaBuffer) b;
}
* \return GL_TRUE if compatible, GL_FALSE otherwise.
*/
static GLboolean
-check_compatible(const GLcontext *ctx, const GLframebuffer *buffer)
+check_compatible(const GLcontext *ctx, const struct gl_framebuffer *buffer)
{
const struct gl_config *ctxvis = &ctx->Visual;
const struct gl_config *bufvis = &buffer->Visual;
* Really, the device driver should totally take care of this.
*/
static void
-initialize_framebuffer_size(GLcontext *ctx, GLframebuffer *fb)
+initialize_framebuffer_size(GLcontext *ctx, struct gl_framebuffer *fb)
{
GLuint width, height;
if (ctx->Driver.GetBufferSize) {
* \param readBuffer the reading framebuffer
*/
GLboolean
-_mesa_make_current( GLcontext *newCtx, GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer )
+_mesa_make_current( GLcontext *newCtx, struct gl_framebuffer *drawBuffer,
+ struct gl_framebuffer *readBuffer )
{
if (MESA_VERBOSE & VERBOSE_API)
_mesa_debug(newCtx, "_mesa_make_current()\n");
* - GLcontext: this contains the Mesa rendering state
* - struct gl_config: this describes the color buffer (RGB vs. ci), whether or not
* there's a depth buffer, stencil buffer, etc.
- * - GLframebuffer: contains pointers to the depth buffer, stencil buffer,
+ * - struct gl_framebuffer: contains pointers to the depth buffer, stencil buffer,
* accum buffer and alpha buffers.
*
* These types should be encapsulated by corresponding device driver
* data types. See xmesa.h and xmesaP.h for an example.
*
- * In OOP terms, GLcontext, struct gl_config, and GLframebuffer are base classes
+ * In OOP terms, GLcontext, struct gl_config, and struct gl_framebuffer are base classes
* which the device driver must derive from.
*
* The following functions create and destroy these data types.
_mesa_check_init_viewport(GLcontext *ctx, GLuint width, GLuint height);
extern GLboolean
-_mesa_make_current( GLcontext *ctx, GLframebuffer *drawBuffer,
- GLframebuffer *readBuffer );
+_mesa_make_current( GLcontext *ctx, struct gl_framebuffer *drawBuffer,
+ struct gl_framebuffer *readBuffer );
extern GLboolean
_mesa_share_state(GLcontext *ctx, GLcontext *ctxToShare);
* Mesa uses this to determine when the driver's window size has changed.
* XXX OBSOLETE: this function will be removed in the future.
*/
- void (*GetBufferSize)( GLframebuffer *buffer,
+ void (*GetBufferSize)( struct gl_framebuffer *buffer,
GLuint *width, GLuint *height );
/**
* Resize the given framebuffer to the given size.
* XXX OBSOLETE: this function will be removed in the future.
*/
- void (*ResizeBuffers)( GLcontext *ctx, GLframebuffer *fb,
+ void (*ResizeBuffers)( GLcontext *ctx, struct gl_framebuffer *fb,
GLuint width, GLuint height);
/**
if (ctx->WinSysDrawBuffer) {
GLuint newWidth, newHeight;
- GLframebuffer *buffer = ctx->WinSysDrawBuffer;
+ struct gl_framebuffer *buffer = ctx->WinSysDrawBuffer;
assert(buffer->Name == 0);
if (ctx->WinSysReadBuffer
&& ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
GLuint newWidth, newHeight;
- GLframebuffer *buffer = ctx->WinSysReadBuffer;
+ struct gl_framebuffer *buffer = ctx->WinSysReadBuffer;
assert(buffer->Name == 0);
GLsizei *width, GLsizei *height,
struct gl_pixelstore_attrib *unpack)
{
- const GLframebuffer *buffer = ctx->DrawBuffer;
+ const struct gl_framebuffer *buffer = ctx->DrawBuffer;
if (unpack->RowLength == 0) {
unpack->RowLength = *width;
GLsizei *width, GLsizei *height,
struct gl_pixelstore_attrib *pack)
{
- const GLframebuffer *buffer = ctx->ReadBuffer;
+ const struct gl_framebuffer *buffer = ctx->ReadBuffer;
if (pack->RowLength == 0) {
pack->RowLength = *width;
struct gl_texture_object;
struct st_context;
typedef struct __GLcontextRec GLcontext;
-typedef struct gl_framebuffer GLframebuffer;
/*@}*/
/*@}*/
struct gl_config Visual;
- GLframebuffer *DrawBuffer; /**< buffer for writing */
- GLframebuffer *ReadBuffer; /**< buffer for reading */
- GLframebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */
- GLframebuffer *WinSysReadBuffer; /**< set with MakeCurrent */
+ struct gl_framebuffer *DrawBuffer; /**< buffer for writing */
+ struct gl_framebuffer *ReadBuffer; /**< buffer for reading */
+ struct gl_framebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */
+ struct gl_framebuffer *WinSysReadBuffer; /**< set with MakeCurrent */
/**
* Device driver function pointer table
st_DrawBuffers(GLcontext *ctx, GLsizei count, const GLenum *buffers)
{
struct st_context *st = st_context(ctx);
- GLframebuffer *fb = ctx->DrawBuffer;
+ struct gl_framebuffer *fb = ctx->DrawBuffer;
GLuint i;
(void) count;
st_ReadBuffer(GLcontext *ctx, GLenum buffer)
{
struct st_context *st = st_context(ctx);
- GLframebuffer *fb = ctx->ReadBuffer;
+ struct gl_framebuffer *fb = ctx->ReadBuffer;
(void) buffer;
static INLINE GLboolean
is_front_buffer_dirty(struct st_context *st)
{
- GLframebuffer *fb = st->ctx->DrawBuffer;
+ struct gl_framebuffer *fb = st->ctx->DrawBuffer;
struct st_renderbuffer *strb
= st_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
return strb && strb->defined;
static void
display_front_buffer(struct st_context *st)
{
- GLframebuffer *fb = st->ctx->DrawBuffer;
+ struct gl_framebuffer *fb = st->ctx->DrawBuffer;
struct st_renderbuffer *strb
= st_renderbuffer(fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer);
#include "util/u_atomic.h"
/**
- * Cast wrapper to convert a GLframebuffer to an st_framebuffer.
- * Return NULL if the GLframebuffer is a user-created framebuffer.
+ * Cast wrapper to convert a struct gl_framebuffer to an st_framebuffer.
+ * Return NULL if the struct gl_framebuffer is a user-created framebuffer.
* We'll only return non-null for window system framebuffers.
* Note that this function may fail.
*/
static INLINE struct st_framebuffer *
-st_ws_framebuffer(GLframebuffer *fb)
+st_ws_framebuffer(struct gl_framebuffer *fb)
{
/* FBO cannot be casted. See st_new_framebuffer */
return (struct st_framebuffer *) ((fb && !fb->Name) ? fb : NULL);
/**
- * Wrapper for GLframebuffer.
+ * Wrapper for struct gl_framebuffer.
* This is an opaque type to the outside world.
*/
struct st_framebuffer
{
- GLframebuffer Base;
+ struct gl_framebuffer Base;
void *Private;
struct st_framebuffer_iface *iface;
#include "st_manager.h"
/**
- * Cast wrapper to convert a GLframebuffer to an st_framebuffer.
- * Return NULL if the GLframebuffer is a user-created framebuffer.
+ * Cast wrapper to convert a struct gl_framebuffer to an st_framebuffer.
+ * Return NULL if the struct gl_framebuffer is a user-created framebuffer.
* We'll only return non-null for window system framebuffers.
* Note that this function may fail.
*/
static INLINE struct st_framebuffer *
-st_ws_framebuffer(GLframebuffer *fb)
+st_ws_framebuffer(struct gl_framebuffer *fb)
{
/* FBO cannot be casted. See st_new_framebuffer */
return (struct st_framebuffer *) ((fb && !fb->Name) ? fb : NULL);
/* for FBO-only context */
if (!stfbi) {
- GLframebuffer *base = _mesa_get_incomplete_framebuffer();
+ struct gl_framebuffer *base = _mesa_get_incomplete_framebuffer();
stfb->Base = *base;
st_framebuffer_reference(struct st_framebuffer **ptr,
struct st_framebuffer *stfb)
{
- GLframebuffer *fb = &stfb->Base;
- _mesa_reference_framebuffer((GLframebuffer **) ptr, fb);
+ struct gl_framebuffer *fb = &stfb->Base;
+ _mesa_reference_framebuffer((struct gl_framebuffer **) ptr, fb);
}
static void
* Add a color renderbuffer on demand.
*/
boolean
-st_manager_add_color_renderbuffer(struct st_context *st, GLframebuffer *fb,
+st_manager_add_color_renderbuffer(struct st_context *st, struct gl_framebuffer *fb,
gl_buffer_index idx)
{
struct st_framebuffer *stfb = st_ws_framebuffer(fb);
st_manager_validate_framebuffers(struct st_context *st);
boolean
-st_manager_add_color_renderbuffer(struct st_context *st, GLframebuffer *fb,
+st_manager_add_color_renderbuffer(struct st_context *st, struct gl_framebuffer *fb,
gl_buffer_index idx);
#endif /* ST_MANAGER_H */