aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-10-03 16:11:21 +0000
committerBrian Paul <[email protected]>2005-10-03 16:11:21 +0000
commitb0e7d850d1471fd8e5aa99a67ec7ea9721b692ad (patch)
treebd04d13d30d16f4a6a72b7db43bd8bdbe998b04e /src/mesa
parent8ef0519bbe0318920170e82b6b52853920a897c4 (diff)
finish up some missing code
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texrender.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index f7f3fdb4b0b..ae4a2a5527b 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -27,14 +27,29 @@ static void
texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
GLint x, GLint y, void *values)
{
- /* XXX unfinished */
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLchan *rgbaOut = (GLchan *) values;
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i);
+ }
}
static void
texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
const GLint x[], const GLint y[], void *values)
{
- /* XXX unfinished */
+ const struct texture_renderbuffer *trb
+ = (const struct texture_renderbuffer *) rb;
+ const GLint z = trb->Zoffset;
+ GLchan *rgbaOut = (GLchan *) values;
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i], z,
+ rgbaOut + 4 * i);
+ }
}
static void
@@ -170,6 +185,13 @@ wrap_texture(GLcontext *ctx, struct gl_renderbuffer_attachment *att)
trb->Base.Delete = delete_texture_wrapper;
trb->Base.AllocStorage = NULL; /* illegal! */
+ /* XXX fix these */
+ trb->Base.RedBits = trb->TexImage->TexFormat->RedBits;
+ trb->Base.GreenBits = trb->TexImage->TexFormat->GreenBits;
+ trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits;
+ trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits;
+ trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits;
+
att->Renderbuffer = &(trb->Base);
}