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
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);
}