com.sun.opengl.impl

Class InternalBufferUtils


public class InternalBufferUtils
extends Object

Utility routines available only to the JOGL implementation.

Method Summary

static ByteBuffer
newDirectByteBuffer(long address, int capacity)
Allocates a new direct byte buffer at the given address with the given capacity.

Method Details

newDirectByteBuffer

public static ByteBuffer newDirectByteBuffer(long address,
                                             int capacity)
Allocates a new direct byte buffer at the given address with the given capacity. This is exposed only because of glMapBufferARB and its semantics; it is undesirable to allocate a new buffer every frame because (a) ByteBuffers are finalizable and (b) the application would typically need to re-slice the buffer every frame. Instead we cache these ByteBuffer objects up in Java and look them up in a HashMap by base address and capacity.

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.