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"
14
#include "main/formats.h"
19
struct gl_renderbuffer Base;
21
/* Chars or bytes per pixel. If Z and Stencil are stored together this
22
* will typically be 32 whether this a depth or stencil renderbuffer.
26
/* Buffer position and pitch (row stride). Recall that for today's DRI
27
* drivers, we have statically allocated color/depth/stencil buffers.
28
* So this information describes the whole screen, not just a window.
29
* To address pixels in a window, we need to know the window's position
30
* and size with respect to the screen.
32
GLint offset; /* in bytes */
33
GLint pitch; /* in pixels */
35
/* If the driver can do page flipping (full-screen double buffering)
36
* the current front/back buffers may get swapped.
37
* If page flipping is disabled, these fields will be identical to
38
* the offset/pitch/Data above.
39
* If page flipping is enabled, and this is the front(back) renderbuffer,
40
* flippedOffset/Pitch/Data will have the back(front) renderbuffer's values.
44
GLvoid *flippedData; /* mmap'd address of buffer memory, if used */
46
/* Pointer to corresponding __DRIdrawable. This is used to compute
47
* the window's position within the framebuffer.
51
/* XXX this is for radeon/r200 only. We should really create a new
52
* r200Renderbuffer class, derived from this class... not a huge deal.
54
GLboolean depthHasSurface;
57
* A handy flag to know if this is the back color buffer.
60
* This is currently only used by tdfx.
66
extern driRenderbuffer *
67
driNewRenderbuffer(gl_format format, GLvoid *addr,
68
GLint cpp, GLint offset, GLint pitch,
69
__DRIdrawable *dPriv);
72
driFlipRenderbuffers(struct gl_framebuffer *fb, GLboolean flipped);
76
driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv);
79
#endif /* DRIRENDERBUFFER_H */