Class OGL15Graphics
- All Implemented Interfaces:
OGLVersioned
- Direct Known Subclasses:
OGL20Graphics
- Author:
- Matthew Tropiano
-
Nested Class Summary
Nested classes/interfaces inherited from class OGL13Graphics
OGL13Graphics.Info13Nested classes/interfaces inherited from class OGL11Graphics
OGL11Graphics.Info11Nested classes/interfaces inherited from class OGLGraphics
OGLGraphics.ErrorHandlingType, OGLGraphics.Info, OGLGraphics.Options -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new buffer object.createGeometryBuilder(int vertices, int... attributeSizes) Creates a new geometry builder.Creates a new query.voiddestroyBuffer(OGLBuffer buffer) Destroys a buffer object.voiddestroyQuery(OGLQuery query) Destroys a query object.protected voidendFrame()Called on frame end - mostly does cleanup of objects that were abandoned in OpenGL.voidendQuery(QueryTarget queryTarget) Ends a query.getBuffer(BufferTargetType type) Gets the currently bound buffer for a binding target.protected OGLBufferGets the current buffer for a binding target.booleangetQueryBooleanResult(OGLQuery query) Gets the result of the query as a boolean.longgetQueryResult(OGLQuery query) Gets the result of the query as a long integer.booleanisQueryReady(OGLQuery query) Checks if a query's results are ready.mapByteBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.mapDoubleBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.mapFloatBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.mapIntBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.mapLongBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.mapShortBuffer(BufferTargetType type, AccessType accessType) Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.voidsetBuffer(BufferTargetType type, OGLBuffer buffer) Binds a buffer to the current context.voidsetBufferCapacity(BufferTargetType type, DataType dataType, CachingHint cachingHint, int elements) Sets the capacity of the current buffer (sends no data).voidsetBufferData(BufferTargetType type, CachingHint cachingHint, ByteBuffer data) Sets the data of the current buffer.voidsetBufferData(BufferTargetType type, CachingHint cachingHint, DoubleBuffer data) Sets the data of the current buffer.voidsetBufferData(BufferTargetType type, CachingHint cachingHint, FloatBuffer data) Sets the data of the current buffer.voidsetBufferData(BufferTargetType type, CachingHint cachingHint, IntBuffer data) Sets the data of the current buffer.voidsetBufferData(BufferTargetType type, CachingHint cachingHint, LongBuffer data) Sets the data of the current buffer.voidsetBufferData(BufferTargetType type, CachingHint cachingHint, ShortBuffer data) Sets the data of the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, ByteBuffer data) Sets a subsection of data to the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, DoubleBuffer data) Sets a subsection of data to the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, FloatBuffer data) Sets a subsection of data to the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, IntBuffer data) Sets a subsection of data to the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, LongBuffer data) Sets a subsection of data to the current buffer.voidsetBufferSubData(BufferTargetType type, int offset, ShortBuffer data) Sets a subsection of data to the current buffer.protected voidsetCurrentBufferState(BufferTargetType type, OGLBuffer buffer) Sets the current texture for a binding target.voidSets the origin of the calculation of the fog coordinate value that dictates "where" in the fog it is.voidstartQuery(QueryTarget queryTarget, OGLQuery query) Starts a new query.booleanunmapBuffer(BufferTargetType type) Unmaps a buffer after it has been mapped and manipulated/read by the calling client application.voidunsetBuffer(BufferTargetType type) Unbinds the current buffer from a target.Methods inherited from class OGL14Graphics
createTextureBuilder, setPointAttenuationFormula, setPointAttenuationMaximum, setPointAttenuationMinimum, setTextureFiltering, setTextureFiltering, setTextureLODBiasMethods inherited from class OGL13Graphics
createInfo, getActiveTextureUnit, getCurrentActiveTextureUnitState, setActiveTextureUnit, setCurrentActiveTextureCoordArray, setCurrentActiveTextureUnitState, setTextureData, setTextureSubDataMethods inherited from class OGL12Graphics
drawGeometryElementRange, setTextureData, setTextureSubData, setTextureWrappingMethods inherited from class OGL11Graphics
accumulate, attribPop, attribPush, checkLightId, clear, clear, clientAttribPop, clientAttribPush, createTexture, destroyTexture, drawBitmap, drawGeometryArray, drawGeometryElements, finish, flush, getCurrentActiveTextureState, getCurrentMatrixId, getCurrentMatrixStack, getCurrentMatrixStack, getPixelPackAlignment, getPixelUnpackAlignment, getTexture, matrixAspectOrtho, matrixFrustum, matrixGet, matrixGet, matrixLookAt, matrixMode, matrixMultiply, matrixMultiply, matrixOrtho, matrixPerspective, matrixPop, matrixPush, matrixReset, matrixRotateX, matrixRotateY, matrixRotateZ, matrixScale, matrixSet, matrixSet, matrixTranslate, readFrameBuffer, resolveCurrentMatrixStack, setAutoNormalGen, setBackFillMode, setBlendingEnabled, setBlendingFunc, setBlendingFunc, setClearAccum, setClearColor, setClearDepth, setClearStencil, setColor, setColor, setColorARGB, setColorArrayEnabled, setColorArrayPointer, setColorMask, setColorMask, setCurrentActiveTextureState, setCurrentMatrixId, setDepthFunc, setDepthMask, setDepthTestEnabled, setFaceCullingEnabled, setFaceCullingSide, setFaceFront, setFillMode, setFogColor, setFogColor, setFogColor, setFogDensity, setFogEnabled, setFogEnd, setFogExponent, setFogExponentSquared, setFogFormula, setFogLinear, setFogStart, setFrameBufferRead, setFrameBufferWrite, setFrontFillMode, setHint, setLight, setLightAmbientColor, setLightAmbientColor, setLightAmbientColor, setLightAttenuation, setLightDiffuseColor, setLightDiffuseColor, setLightDiffuseColor, setLightEnabled, setLightingEnabled, setLightPosition, setLightShadeType, setLightSpecularColor, setLightSpecularColor, setLightSpecularColor, setLineSmoothingEnabled, setLineWidth, setMaterial, setMaterial, setMaterialAmbientColor, setMaterialAmbientColor, setMaterialAmbientColor, setMaterialDiffuseColor, setMaterialDiffuseColor, setMaterialDiffuseColor, setMaterialEmissionColor, setMaterialEmissionColor, setMaterialEmissionColor, setMaterialShininessFactor, setMaterialSpecularColor, setMaterialSpecularColor, setMaterialSpecularColor, setNormalArrayEnabled, setNormalArrayPointer, setPixelPackAlignment, setPixelUnpackAlignment, setPointSize, setPointSmoothingEnabled, setRasterPosition, setScissorBounds, setScissorTestEnabled, setStencilMask, setStencilTestEnabled, setStencilTestFunc, setStencilTestOperations, setTexGenEyePlane, setTexGenMode, setTexGenObjectPlane, setTexGenQEnabled, setTexGenREnabled, setTexGenSEnabled, setTexGenTEnabled, setTexture, setTextureCoordinateArrayEnabled, setTextureCoordinateArrayPointer, setTextureData, setTextureData, setTextureDataFromReadBuffer, setTextureDataFromReadBuffer, setTextureEnabled, setTextureEnvironment, setTextureFiltering, setTextureFiltering, setTextureSubData, setTextureSubData, setTextureSubDataFromReadBuffer, setTextureSubDataFromReadBuffer, setTextureWrapping, setTextureWrapping, setVertexArrayEnabled, setVertexArrayPointer, setViewport, unsetTextureMethods inherited from class OGLGraphics
checkError, clearError, currentBlit, currentFrame, currentNanos, currentTime, currentTimeMillis, currentTimeStepMillis, currentTimeStepNanos, destroyObject, fromGLBool, getCanvasAspect, getCanvasHeight, getCanvasWidth, getFloat, getFloats, getGLErrorName, getInfo, getInt, getInts, handleUndeletedObjects, isCore, setClientFlag, setFlag, supports, toGLBool, verifyFeatureSupport, verifyNonCore
-
Constructor Details
-
OGL15Graphics
-
-
Method Details
-
getVersion
- Specified by:
getVersionin interfaceOGLVersioned- Overrides:
getVersionin classOGL14Graphics- Returns:
- the version that this object or value is available for (and higher).
-
getCurrentBufferState
Gets the current buffer for a binding target.- Parameters:
type- the binding type.- Returns:
- the current buffer, or null if no current.
-
setCurrentBufferState
Sets the current texture for a binding target.- Parameters:
type- the binding type.buffer- the buffer to set.
-
endFrame
protected void endFrame()Description copied from class:OGLGraphicsCalled on frame end - mostly does cleanup of objects that were abandoned in OpenGL.- Overrides:
endFramein classOGL11Graphics
-
setFogCoordinateSource
Sets the origin of the calculation of the fog coordinate value that dictates "where" in the fog it is.- Parameters:
coord- the coordinate type.
-
createQuery
Creates a new query.- Returns:
- a new sample query object.
- Throws:
GraphicsException- if the object could not be created.
-
destroyQuery
Destroys a query object.- Parameters:
query- the query to destroy.
-
startQuery
Starts a new query.- Parameters:
queryTarget- the query target.query- the query object to attach results to.- Throws:
UnsupportedOperationException- if the provided type is unavailable in this version.
-
endQuery
Ends a query. Must be a started query of the same type. The query's results should be fetched after verifying that it is complete, later.- Parameters:
queryTarget- the query target.- Throws:
GraphicsException- if the query type provided waqs not started.
-
isQueryReady
Checks if a query's results are ready.- Parameters:
query- the query to check.- Returns:
- true if this query's results are available, false otherwise.
-
getQueryResult
Gets the result of the query as a long integer. IfisQueryReady(OGLQuery)is not checked beforehand, this will hold the thread until the query is finished. Depending on your OpenGL version, a 64-bit precision value may not be available.- Parameters:
query- the query to get the results for.- Returns:
- the long value of the result.
-
getQueryBooleanResult
Gets the result of the query as a boolean. IfisQueryReady(OGLQuery)is not checked beforehand, this will hold the thread until the query is finished.- Parameters:
query- the query to get the results for.- Returns:
- the boolean value of the result.
-
createGeometryBuilder
Creates a new geometry builder. The internal size of the buffer (number of float elements) isverticestimes the sum of all of the attribute sizes, which would house the whole object.This geometry builder aids in building buffer objects, and its
GeometryBuilder.create()method will bind a new buffer to theBufferTargetType.GEOMETRYtarget, send the data, unbind the target, and return the new object.For example, if this is a builder of a four-vertex mesh with 3D spatial coordinates and an RGBA color, the constructor for this 4-vertex, 2 attribute builder is:
GeometryBuilder.start(4, 3, 4)
...and the resultant buffer capacity is 28 (4 * (3 + 4)).- Parameters:
vertices- the number of individual vertices or attribute sets.attributeSizes- the list of attribute sizes in components.- Returns:
- the new builder.
-
createBuffer
Creates a new buffer object.- Returns:
- a new, uninitialized buffer object.
- Throws:
GraphicsException- if the object could not be created.
-
destroyBuffer
Destroys a buffer object.- Parameters:
buffer- the buffer to destroy.
-
getBuffer
Gets the currently bound buffer for a binding target.- Parameters:
type- the buffer binding target.- Returns:
- the currently bound buffer, or null if no bound buffer to that target.
-
setBuffer
Binds a buffer to the current context.- Parameters:
type- the buffer type to bind.buffer- the buffer to bind. Null unbinds the currently bound buffer type.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferCapacity
public void setBufferCapacity(BufferTargetType type, DataType dataType, CachingHint cachingHint, int elements) Sets the capacity of the current buffer (sends no data).- Parameters:
type- the buffer type binding.dataType- the data type.cachingHint- the caching hint on this buffer's data.elements- the amount of elements of the data type.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferData
Sets the data of the current buffer.- Parameters:
type- the buffer type binding.cachingHint- the caching hint on this buffer's data.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
setBufferSubData
Sets a subsection of data to the current buffer.- Parameters:
type- the buffer type binding.offset- the offset into the buffer to copy.data- the data to send.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapByteBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapShortBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapIntBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapLongBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapFloatBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
mapDoubleBuffer
Maps the internal data of the current OGLBuffer to a local buffer for quick modification/read.Please note that the returned Buffer is special in how it is used by OpenGL according to the AccessType.
- Parameters:
type- the binding target type.accessType- an access hint for the returned buffer.- Returns:
- a buffer suitable for application use.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
unmapBuffer
Unmaps a buffer after it has been mapped and manipulated/read by the calling client application. Please note that the Buffer that was mapped from this OGLBuffer will be completely invalidated upon unmapping it.- Parameters:
type- the binding target type.- Returns:
- true if unmap successful, false if data corruption occurred on unmap.
- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-
unsetBuffer
Unbinds the current buffer from a target.- Parameters:
type- the binding target type.- Throws:
UnsupportedOperationException- if the provided target type is unavailable in this version.
-