3 * A driRenderbuffer is dervied from gl_renderbuffer.
4 * It describes a color buffer (front or back), a depth buffer, or stencil
6 * Specific to DRI drivers are the offset and pitch fields.
10 #ifndef DRIRENDERBUFFER_H
11 #define DRIRENDERBUFFER_H
13 #include "main/mtypes.h"
18 struct gl_renderbuffer Base
;
20 /* Chars or bytes per pixel. If Z and Stencil are stored together this
21 * will typically be 32 whether this a depth or stencil renderbuffer.
25 /* Buffer position and pitch (row stride). Recall that for today's DRI
26 * drivers, we have statically allocated color/depth/stencil buffers.
27 * So this information describes the whole screen, not just a window.
28 * To address pixels in a window, we need to know the window's position
29 * and size with respect to the screen.
31 GLint offset
; /* in bytes */
32 GLint pitch
; /* in pixels */
34 /* If the driver can do page flipping (full-screen double buffering)
35 * the current front/back buffers may get swapped.
36 * If page flipping is disabled, these fields will be identical to
37 * the offset/pitch/Data above.
38 * If page flipping is enabled, and this is the front(back) renderbuffer,
39 * flippedOffset/Pitch/Data will have the back(front) renderbuffer's values.
43 GLvoid
*flippedData
; /* mmap'd address of buffer memory, if used */
45 /* Pointer to corresponding __DRIdrawablePrivate. This is used to compute
46 * the window's position within the framebuffer.
48 __DRIdrawablePrivate
*dPriv
;
50 /* XXX this is for radeon/r200 only. We should really create a new
51 * r200Renderbuffer class, derived from this class... not a huge deal.
53 GLboolean depthHasSurface
;
56 * A handy flag to know if this is the back color buffer.
59 * This is currently only used by s3v and tdfx.
65 extern driRenderbuffer
*
66 driNewRenderbuffer(GLenum format
, GLvoid
*addr
,
67 GLint cpp
, GLint offset
, GLint pitch
,
68 __DRIdrawablePrivate
*dPriv
);
71 driFlipRenderbuffers(struct gl_framebuffer
*fb
, GLboolean flipped
);
75 driUpdateFramebufferSize(GLcontext
*ctx
, const __DRIdrawablePrivate
*dPriv
);
78 #endif /* DRIRENDERBUFFER_H */