Java Code Examples for com.badlogic.gdx.utils.BufferUtils#disposeUnsafeByteBuffer()
The following examples show how to use
com.badlogic.gdx.utils.BufferUtils#disposeUnsafeByteBuffer() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FreeType.java From gdx-texture-packer-gui with Apache License 2.0 | 5 votes |
@Override public void dispose () { doneFreeType(address); for(ByteBuffer buffer: fontData.values()) { if (BufferUtils.isUnsafeByteBuffer(buffer)) BufferUtils.disposeUnsafeByteBuffer(buffer); } }
Example 2
Source File: FreeType.java From gdx-texture-packer-gui with Apache License 2.0 | 5 votes |
public Face newMemoryFace(ByteBuffer buffer, int faceIndex) { long face = newMemoryFace(address, buffer, buffer.remaining(), faceIndex); if(face == 0) { if (BufferUtils.isUnsafeByteBuffer(buffer)) BufferUtils.disposeUnsafeByteBuffer(buffer); throw new GdxRuntimeException("Couldn't load font, FreeType error code: " + getLastErrorCode()); } else { fontData.put(face, buffer); return new Face(face, this); } }
Example 3
Source File: FreeType.java From gdx-texture-packer-gui with Apache License 2.0 | 5 votes |
@Override public void dispose() { doneFace(address); ByteBuffer buffer = library.fontData.get(address); if(buffer != null) { library.fontData.remove(address); if (BufferUtils.isUnsafeByteBuffer(buffer)) BufferUtils.disposeUnsafeByteBuffer(buffer); } }
Example 4
Source File: GLBufferObject.java From libgdx-snippets with MIT License | 4 votes |
@Override public void dispose() { gl20.glDeleteBuffer(handle); BufferUtils.disposeUnsafeByteBuffer(byteBuffer); }