Ejemplo n.º 1
0
Archivo: s_imaging.c Proyecto: aosm/X11
void
_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start,
			   GLint x, GLint y, GLsizei width)
{
   GLchan data[MAX_WIDTH][4];

   /* Select buffer to read from */
   _swrast_use_read_buffer(ctx);

   if (width > MAX_WIDTH)
      width = MAX_WIDTH;

   /* read the data from framebuffer */
   _mesa_read_rgba_span( ctx, ctx->ReadBuffer, width, x, y, data );

   /* Restore reading from draw buffer (the default) */
   _swrast_use_draw_buffer(ctx);

   glColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBImaging_nglColorSubTableBO(JNIEnv *env, jclass clazz, jint target, jint start, jint count, jint format, jint type, jlong data_buffer_offset, jlong function_pointer) {
    const GLvoid *data_address = (const GLvoid *)(intptr_t)offsetToPointer(data_buffer_offset);
    glColorSubTablePROC glColorSubTable = (glColorSubTablePROC)((intptr_t)function_pointer);
    glColorSubTable(target, start, count, format, type, data_address);
}