|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.renderer.Renderer
public class Renderer
Provides access to state associated with the renderer. Any state changes made should be done through this object so that its internal state is synchronized with the OpenGL state.
| Nested Class Summary | |
|---|---|
protected static class |
Renderer.ClientArrayRecord
Represents the state of a single client array. |
protected static class |
Renderer.ClipPlaneRecord
Represents the state of a single clip plane. |
protected static class |
Renderer.LightRecord
Represents the current state of a single light. |
static interface |
Renderer.Observer
An interface for objects interested in renderer state changes. |
protected static class |
Renderer.TextureUnitRecord
Represents the current state of a single texture unit. |
| Field Summary | |
|---|---|
protected int |
_activeUnit
The active texture unit. |
protected int |
_alphaBits
The number of alpha bit planes in the frame buffer. |
protected Boolean |
_alphaMask
The current color mask state. |
protected Boolean |
_alphaTestEnabled
Whether or not alpha testing is enabled. |
protected int |
_alphaTestFunc
The alpha test function. |
protected float |
_alphaTestRef
The reference alpha value for testing. |
protected BufferObject |
_arrayBuffer
The currently bound array buffer object. |
protected boolean |
_ati
Vendor flags for special casery. |
protected Color4f |
_backAmbient
The current material's back ambient color. |
protected Color4f |
_backDiffuse
The current material's back diffuse color. |
protected Color4f |
_backEmission
The current material's back emissive color. |
protected int |
_backPolygonMode
The polygon mode for back-facing polygons. |
protected float |
_backShininess
The current material's back shininess. |
protected Color4f |
_backSpecular
The current material's back specular color. |
protected int |
_batchCount
The number of batches rendered in the current frame. |
protected Boolean |
_blendEnabled
Whether or not blending is enabled. |
protected Boolean |
_blueMask
The current color mask state. |
protected float |
_bottom
The projection parameters. |
protected int |
_bufferObjectBytes
The total number of bytes in buffer objects. |
protected int |
_bufferObjectCount
The number of active buffer objects. |
protected Color4f |
_clearColor
The clear color. |
protected float |
_clearDepth
The clear depth. |
protected int |
_clearStencil
The clear stencil. |
protected int |
_clientActiveUnit
The active client texture unit. |
protected int |
_clipPlaneEnd
One greater than the index of the last clipping plane possibly enabled. |
protected Renderer.ClipPlaneRecord[] |
_clipPlanes
The user clip plane records. |
protected Color4f |
_color
The current render color. |
protected Renderer.ClientArrayRecord |
_colorArray
The state of the color array. |
protected Boolean |
_colorMaterialEnabled
Whether or not color material tracking is enabled. |
protected int |
_colorMaterialFace
The color material face. |
protected int |
_colorMaterialMode
The color material mode. |
protected int |
_cullFace
The cull face. |
protected Boolean |
_cullFaceEnabled
Whether or not face culling is enabled. |
protected DoubleBuffer |
_dbuf
A buffer for double values. |
protected Boolean |
_depthMask
Whether or not depth writing is currently enabled. |
protected Boolean |
_depthTestEnabled
Whether or not depth testing is enabled. |
protected int |
_depthTestFunc
The depth test function. |
protected int |
_destBlendFactor
The destination blend factor. |
protected int |
_displayListCount
The number of active display lists. |
protected Drawable |
_drawable
The drawable with which this renderer is being used. |
protected int |
_drawBuffer
The active buffers for drawing and reading. |
protected BufferObject |
_elementArrayBuffer
The currently bound element array buffer object. |
protected float |
_far
The projection parameters. |
protected int |
_finalizedBufferObjectBytes
The total number of bytes in the buffer objects to be deleted. |
protected int[] |
_finalizedBufferObjects
The list of buffer objects to be deleted. |
protected int[] |
_finalizedDisplayLists
The list of display lists to be deleted. |
protected int[] |
_finalizedFramebuffers
The list of frame buffers to be deleted. |
protected Object[] |
_finalizedPbuffers
The list of pbuffers to be destroyed. |
protected int[] |
_finalizedQueries
The list of queries to be deleted. |
protected int[] |
_finalizedRenderbuffers
The list of render buffers to be deleted. |
protected int[] |
_finalizedShaderObjects
The list of shader objects to be deleted. |
protected int |
_finalizedTextureBytes
The total number of bytes in the textures to be deleted. |
protected int[] |
_finalizedTextures
The list of textures to be deleted. |
protected Boolean |
_flatShading
Whether or not we are using flat shading. |
protected Color4f |
_fogColor
The current fog color. |
protected float |
_fogDensity
The current fog density. |
protected Boolean |
_fogEnabled
Whether or not fog is enabled. |
protected float |
_fogEnd
The current fog end distance. |
protected int |
_fogMode
The current fog mode. |
protected float |
_fogStart
The current fog start distance. |
protected Framebuffer |
_framebuffer
The currently bound frame buffer. |
protected Color4f |
_frontAmbient
The current material's front ambient color. |
protected Color4f |
_frontDiffuse
The current material's front diffuse color. |
protected Color4f |
_frontEmission
The current material's front emissive color. |
protected int |
_frontFace
The front face. |
protected int |
_frontPolygonMode
The polygon mode for front-facing polygons. |
protected float |
_frontShininess
The current material's front shininess. |
protected Color4f |
_frontSpecular
The current material's front specular color. |
protected Color4f |
_globalAmbient
The current global ambient intensity. |
protected Boolean |
_greenMask
The current color mask state. |
protected int |
_height
The width and height of the drawable surface. |
protected boolean |
_intel
Vendor flags for special casery. |
protected float |
_left
The projection parameters. |
protected int |
_lightEnd
One greater than the index of the last light possibly enabled. |
protected Boolean |
_lightingEnabled
Whether or not lighting is currently enabled. |
protected Renderer.LightRecord[] |
_lights
The state of the lights. |
protected float |
_lineWidth
The current line width. |
protected Boolean |
_localViewer
Whether or not specular colors are calculated using a local viewer model. |
protected Matrix4f |
_mat
Temporary matrix. |
protected int |
_matrixMode
The current matrix mode. |
protected int |
_maxClipPlanes
The maximum number of clip planes supported. |
protected int |
_maxLights
The maximum number of lights supported. |
protected int |
_maxTextureImageUnits
The maximum number of textures available in the programmable pipeline. |
protected int |
_maxTextureUnits
The maximum number of textures available in the fixed function pipeline. |
protected int |
_maxVertexAttribs
The maximum number of vertex attributes available to vertex shaders. |
protected Transform3D |
_modelview
The current modelview transform. |
protected boolean |
_modelviewMatrixValid
Whether or not the modelview matrix is valid. |
protected float |
_near
The projection parameters. |
protected Vector3f |
_nearFarNormal
The normal of the near/far clip planes. |
protected Renderer.ClientArrayRecord |
_normalArray
The state of the normal array. |
protected Boolean |
_normalize
Whether or not to normalize normals after transformation. |
protected boolean |
_nvidia
Vendor flags for special casery. |
protected WeakObserverList<Renderer.Observer> |
_observers
The list of renderer observers. |
protected boolean |
_ortho
Whether or not we're using orthographic projection. |
protected float |
_pointSize
The point size. |
protected float |
_polygonOffsetFactor
The proportional polygon offset. |
protected Boolean |
_polygonOffsetFillEnabled
Whether or not offsets are enabled for filled polygons. |
protected Boolean |
_polygonOffsetLineEnabled
Whether or not offsets are enabled for line polygons. |
protected Boolean |
_polygonOffsetPointEnabled
Whether or not offsets are enabled for point polygons. |
protected float |
_polygonOffsetUnits
The constant polygon offset. |
protected int |
_primitiveCount
The number of primitives rendered in the current frame. |
protected Program |
_program
The currently bound shader program. |
protected int |
_readBuffer
The active buffers for drawing and reading. |
protected Boolean |
_redMask
The current color mask state. |
protected Renderbuffer |
_renderbuffer
The currently bound render buffer. |
protected Boolean |
_rescaleNormal
Whether or not to rescale normals according to the modelview matrix scale. |
protected float |
_right
The projection parameters. |
protected Query |
_samplesPassed
The current query for the samples-passed target, if any. |
protected Rectangle |
_scissor
The scissor box. |
protected Boolean |
_scissorTestEnabled
Whether or not scissor testing is enabled (where null means "unknown"). |
protected Boolean |
_separateSpecular
Whether or not specular highlights are applied as a separate pass. |
protected int |
_shaderObjectCount
The number of active shader objects. |
protected int |
_srcBlendFactor
The source blend factor. |
protected RenderState[] |
_states
References to the last states applied. |
protected int |
_stencilBits
The number of stencil bit planes in the frame buffer. |
protected int |
_stencilDepthFailOp
The current stencil test depth failure op. |
protected int |
_stencilFailOp
The current stencil test failure op. |
protected int |
_stencilPassOp
The current stencil test pass op. |
protected Boolean |
_stencilTestEnabled
Whether or not stencil testing is enabled. |
protected int |
_stencilTestFunc
The current stencil test function. |
protected int |
_stencilTestMask
The current stencil test mask. |
protected int |
_stencilTestRef
The current stencil test reference value. |
protected int |
_stencilWriteMask
The current stencil write mask. |
protected int |
_texCoordArrayEnd
One greater than the index of the last texture coordinate array possibly enabled. |
protected Renderer.ClientArrayRecord[] |
_texCoordArrays
The state of the texture coordinate arrays. |
protected int |
_textureBytes
The total number of bytes in textures. |
protected int |
_textureChangeCount
The number of texture changes in the current frame. |
protected int |
_textureCount
The number of active textures. |
protected float |
_top
The projection parameters. |
protected Boolean |
_twoSide
Whether or not two-sided lighting is enabled. |
protected int |
_unitEnd
One greater than the index of the last texture unit possibly enabled. |
protected Renderer.TextureUnitRecord[] |
_units
The state of the texture units. |
protected FloatBuffer |
_vbuf
A buffer for floating point values. |
protected Renderer.ClientArrayRecord |
_vertexArray
The state of the vertex array. |
protected int |
_vertexAttribArrayEnd
One greater than the index of the last vertex attribute array possibly enabled. |
protected Renderer.ClientArrayRecord[] |
_vertexAttribArrays
The state of the vertex attribute arrays. |
protected int |
_vertexAttribArrayStart
The index of the first vertex attribute array possibly enabled. |
protected Boolean |
_vertexProgramTwoSide
Whether or not two-sided vertex program mode is enabled. |
protected Rectangle |
_viewport
The active viewport. |
protected int |
_width
The width and height of the drawable surface. |
protected boolean |
_wouldEnableFog
Whether or not we would enable fog if not for the shader state. |
protected static BufferObject |
INVALID_BUFFER
An invalid buffer to force reapplication. |
protected static Program |
INVALID_PROGRAM
An invalid program to force reapplication. |
protected static Texture |
INVALID_TEXTURE
An invalid texture to force reapplication. |
| Constructor Summary | |
|---|---|
Renderer()
|
|
| Method Summary | |
|---|---|
void |
addObserver(Renderer.Observer observer)
Adds an observer to the list of objects interested in state changes. |
protected void |
bufferObjectCreated()
Notes that a buffer object has been created. |
protected void |
bufferObjectDeleted(int bytes)
Notes that a buffer object has been deleted. |
protected void |
bufferObjectFinalized(int id,
int bytes)
Called when a buffer object has been finalized. |
protected void |
bufferObjectResized(int delta)
Notes that a buffer object's size has changed. |
void |
cleanup()
Gives the renderer a chance to perform any periodic cleanup necessary. |
protected boolean |
clearModelviewOrTransposeTransform(boolean cleared,
Vector4f vector,
FloatBuffer result)
On Intel cards, this clears the modelview matrix and loads the plane coefficients into the supplied buffer. |
protected void |
deleteFinalizedObjects()
Deletes all finalized objects. |
protected void |
displayListCreated()
Notes that a display list has been created. |
protected void |
displayListDeleted()
Notes that a display list has been deleted. |
protected void |
displayListFinalized(int id)
Called when a display list has been finalized. |
protected void |
framebufferFinalized(int id)
Called when a frame buffer has been finalized. |
int |
getAlphaBits()
Returns the number of alpha bit planes in the frame buffer. |
int |
getBatchCount()
Returns the number of batches rendered since the last call to resetStats(). |
float |
getBottom()
Returns the bottom projection parameter. |
int |
getBufferObjectBytes()
Returns the total number of bytes in buffer objects. |
int |
getBufferObjectCount()
Returns the number of active buffer objects. |
Color4f |
getClearColor()
Returns a reference to the clear color. |
float |
getClearDepth()
Returns the clear depth. |
int |
getClearStencil()
Returns the clear stencil value. |
int |
getDisplayListCount()
Returns the number of active display lists. |
Drawable |
getDrawable()
Returns a reference to the drawable target of this renderer. |
protected int |
getDrawBuffer()
Returns the active draw buffer. |
float |
getFar()
Returns the far projection parameter. |
protected Framebuffer |
getFramebuffer()
Returns a reference to the currently bound frame buffer. |
int |
getFrontFace()
Returns the current front face. |
int |
getHeight()
Returns the height of the renderer's drawable surface. |
float |
getLeft()
Returns the left projection parameter. |
int |
getMaxClipPlanes()
Returns the maximum number of user clip planes supported. |
int |
getMaxLights()
Returns the maximum number of lights supported. |
int |
getMaxTextureImageUnits()
Returns the maximum number of texture units usable with the programmable pipeline. |
int |
getMaxTextureUnits()
Returns the maximum number of texture units usable with the fixed-function pipeline. |
int |
getMaxVertexAttribs()
Returns the maximum number of vertex attributes available to vertex shaders. |
protected Matrix4f |
getModelviewMatrix()
Returns a reference to the modelview matrix, ensuring that it is up-to-date. |
float |
getNear()
Returns the near projection parameter. |
Vector3f |
getNearFarNormal()
Returns a reference to the near/far normal projection parameter. |
int |
getPrimitiveCount()
Returns the number of primitives rendered since the last call to resetStats(). |
protected int |
getReadBuffer()
Returns the active read buffer. |
float |
getRight()
Returns the right projection parameter. |
Rectangle |
getScissor()
Returns a reference to the scissor box, or null if scissor testing is
disabled. |
int |
getShaderObjectCount()
Returns the number of active shader objects. |
int |
getStencilBits()
Returns the number of stencil bit planes in the frame buffer. |
int |
getTextureBytes()
Returns the total number of bytes in textures. |
int |
getTextureChangeCount()
Returns the number of texture changes since the last call to resetStats(). |
int |
getTextureCount()
Returns the number of active textures. |
float |
getTop()
Returns the top projection parameter. |
Rectangle |
getViewport()
Returns the current viewport state. |
int |
getWidth()
Returns the width of the renderer's drawable surface. |
void |
init(Drawable drawable,
int width,
int height)
Initializes the renderer. |
void |
invalidateAlphaState()
Invalidates the alpha state, forcing it to be reapplied. |
void |
invalidateArrayState()
Invalidates the array state, forcing it to be reapplied. |
void |
invalidateColorMaskState()
Invalidates the color mask state, forcing it to be reapplied. |
void |
invalidateColorState()
Invalidates the color state, forcing it to be reapplied. |
void |
invalidateCullState()
Invalidates the back-face culling state, forcing it to be reapplied. |
void |
invalidateDepthState()
Invalidates the depth state, forcing it to be reapplied. |
void |
invalidateFogState()
Invalidates the fog state, forcing it to be reapplied. |
void |
invalidateLightState()
Invalidates the light state, forcing it to be reapplied. |
void |
invalidateLineState()
Invalidates the line state, forcing it to be reapplied. |
void |
invalidateMaterialState()
Invalidates the material state, forcing it to be reapplied. |
void |
invalidatePointState()
Invalidates the point state, forcing it to be reapplied. |
void |
invalidatePolygonState()
Invalidates the polygon state, forcing it to be reapplied. |
void |
invalidateShaderState()
Invalidates the shader state, forcing it to be reapplied. |
void |
invalidateStencilState()
Invalidates the stencil state, forcing it to be reapplied. |
void |
invalidateTextureState()
Invalidates the texture state, forcing it to be reapplied. |
void |
invalidateTransformState()
Invalidates the transform state, forcing it to be reapplied. |
boolean |
isOrtho()
Returns the ortho projection parameter. |
protected void |
loadTransformMatrix(Transform3D transform)
Loads the specified transform into the current matrix slot. |
protected boolean |
maybeClearModelview(boolean cleared)
Clears the modelview matrix if it hasn't already been. |
protected void |
maybeRestoreModelview(boolean cleared)
Restores the stored modelview matrix if it was previously cleared. |
protected void |
pbufferFinalized(Pbuffer pbuffer)
Called when a pbuffer has been finalized. |
protected void |
queryFinalized(int id)
Called when a query has been finalized. |
void |
removeObserver(Renderer.Observer observer)
Removes an observer from the list. |
void |
render(List<Batch> batches)
Renders the provided list of batches. |
protected void |
renderbufferFinalized(int id)
Called when a render buffer has been finalized. |
void |
resetStats()
Resets the per-frame stats. |
protected void |
setActiveUnit(int unit)
Sets the active texture unit. |
void |
setAlphaState(int alphaTestFunc,
float alphaTestRef,
int srcBlendFactor,
int destBlendFactor)
Sets the alpha testing and blending state. |
protected void |
setArrayBuffer(BufferObject arrayBuffer)
Binds the specified array buffer. |
void |
setArrayState(int firstVertexAttribIndex,
ClientArray[] vertexAttribArrays,
ClientArray[] texCoordArrays,
ClientArray colorArray,
ClientArray normalArray,
ClientArray vertexArray,
BufferObject elementArrayBuffer)
Sets the client array state. |
protected void |
setBuffers(int drawBuffer,
int readBuffer)
Sets the active buffers for drawing and reading. |
protected static void |
setCapability(int capability,
boolean enable)
Enables or disables an OpenGL capability. |
void |
setClearColor(Color4f color)
Sets the clear color. |
void |
setClearDepth(float depth)
Sets the clear depth. |
void |
setClearStencil(int stencil)
Sets the clear stencil value. |
protected void |
setClientActiveUnit(int unit)
Sets the active client texture unit. |
protected static void |
setClientCapability(int capability,
boolean enable)
Enables or disables an OpenGL client capability. |
void |
setClipPlanes(Plane[] planes)
Sets the user clip planes. |
protected void |
setColorArray(ClientArray array)
Sets the color array to the one supplied. |
void |
setColorMaskState(boolean red,
boolean green,
boolean blue,
boolean alpha)
Sets the color mask state. |
void |
setColorState(Color4f color)
Sets the draw color state. |
void |
setColorState(float r,
float g,
float b,
float a)
Sets the draw color state. |
void |
setCullState(int cullFace)
Sets the back-face culling state. |
void |
setDepthState(int depthTestFunc,
boolean depthMask)
Sets the depth buffer testing/writing state. |
void |
setFogState(int fogMode,
float fogDensity,
Color4f fogColor)
Sets the fog state. |
void |
setFogState(int fogMode,
float fogStart,
float fogEnd,
Color4f fogColor)
Sets the linear fog state. |
protected void |
setFramebuffer(Framebuffer framebuffer)
Binds the specified frame buffer. |
void |
setFrontFace(int face)
Sets the front face. |
void |
setLightState(Light[] lights,
Color4f globalAmbient)
Sets the light state. |
void |
setLineState(float lineWidth)
Sets the line state. |
void |
setMaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
Sets the material state. |
void |
setMatrixMode(int matrixMode)
Sets the matrix mode. |
protected void |
setNormalArray(ClientArray array)
Sets the normal array to the one supplied. |
void |
setNormalize(boolean normalize,
boolean rescaleNormal)
Sets the normalization parameters. |
void |
setPointState(float pointSize)
Sets the point state. |
void |
setPolygonState(int frontPolygonMode,
int backPolygonMode,
float polygonOffsetFactor,
float polygonOffsetUnits)
Sets the polygon state. |
void |
setProjection(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal,
boolean ortho)
Sets the projection matrix. |
protected void |
setRenderbuffer(Renderbuffer renderbuffer)
Binds the specified render buffer. |
void |
setScissor(Rectangle box)
Sets the scissor box. |
void |
setShaderState(Program program,
boolean vertexProgramTwoSide)
Sets the GLSL shader state. |
void |
setSize(int width,
int height)
Notes that the size of the renderer's drawable surface has changed. |
void |
setState(RenderState state)
Sets a single render state. |
void |
setStates(RenderState[] states)
Sets an entire group of states at once. |
void |
setStencilState(int stencilTestFunc,
int stencilTestRef,
int stencilTestMask,
int stencilFailOp,
int stencilDepthFailOp,
int stencilPassOp,
int stencilWriteMask)
Sets the stencil state. |
protected void |
setTexCoordArray(ClientArray array)
Sets the texture coordinate array to the one supplied. |
protected void |
setTexture(Texture texture)
Binds the specified texture in the active unit. |
void |
setTextureState(TextureUnit[] units)
Sets the texture state. |
void |
setTransformState(Transform3D modelview)
Sets the transform state. |
protected void |
setVertexArray(ClientArray array)
Sets the vertex array to the one supplied. |
protected void |
setVertexAttribArray(int idx,
ClientArray array)
Sets one of the vertex attribute arrays to the one supplied. |
void |
setViewport(int x,
int y,
int width,
int height)
Sets the viewport state. |
void |
setViewport(Rectangle viewport)
Sets the viewport state. |
protected void |
shaderObjectCreated()
Notes that a shader object has been created. |
protected void |
shaderObjectDeleted()
Notes that a shader object has been deleted. |
protected void |
shaderObjectFinalized(int id)
Called when a shader object has been finalized. |
void |
startQuery(Query query)
Starts a query. |
void |
stopQuery(Query query)
Stops a query. |
protected void |
textureCreated()
Notes that a texture has been created. |
protected void |
textureDeleted(int bytes)
Notes that a texture has been deleted. |
protected void |
textureFinalized(int id,
int bytes)
Called when a texture has been finalized. |
protected void |
textureResized(int delta)
Notes that a texture's size has changed. |
protected void |
transposeTransform(Vector4f vector,
FloatBuffer result)
Transforms a vector by the transpose of the modelview matrix and stores it in the supplied buffer. |
protected void |
updateFogEnabled()
Updates the fog enabled state, which depends on the fog state and the shader state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Drawable _drawable
protected int _width
protected int _height
protected WeakObserverList<Renderer.Observer> _observers
protected int _alphaBits
protected int _stencilBits
protected int _maxClipPlanes
protected int _maxLights
protected int _maxTextureUnits
protected int _maxTextureImageUnits
protected int _maxVertexAttribs
protected boolean _nvidia
protected boolean _ati
protected boolean _intel
protected int _textureChangeCount
protected int _batchCount
protected int _primitiveCount
protected RenderState[] _states
protected Color4f _clearColor
protected float _clearDepth
protected int _clearStencil
protected Rectangle _viewport
protected float _left
protected float _right
protected float _bottom
protected float _top
protected float _near
protected float _far
protected Vector3f _nearFarNormal
protected boolean _ortho
protected Renderer.ClipPlaneRecord[] _clipPlanes
protected int _clipPlaneEnd
protected Boolean _scissorTestEnabled
protected Rectangle _scissor
protected Query _samplesPassed
protected Boolean _alphaTestEnabled
protected int _alphaTestFunc
protected float _alphaTestRef
protected Boolean _blendEnabled
protected int _srcBlendFactor
protected int _destBlendFactor
protected BufferObject _arrayBuffer
protected BufferObject _elementArrayBuffer
protected int _clientActiveUnit
protected Renderer.ClientArrayRecord[] _vertexAttribArrays
protected int _vertexAttribArrayStart
protected int _vertexAttribArrayEnd
protected Renderer.ClientArrayRecord[] _texCoordArrays
protected int _texCoordArrayEnd
protected Renderer.ClientArrayRecord _colorArray
protected Renderer.ClientArrayRecord _normalArray
protected Renderer.ClientArrayRecord _vertexArray
protected Color4f _color
protected Boolean _redMask
protected Boolean _greenMask
protected Boolean _blueMask
protected Boolean _alphaMask
protected Boolean _cullFaceEnabled
protected int _cullFace
protected int _frontFace
protected Boolean _normalize
protected Boolean _rescaleNormal
protected Boolean _depthTestEnabled
protected int _depthTestFunc
protected Boolean _depthMask
protected Boolean _fogEnabled
protected boolean _wouldEnableFog
protected int _fogMode
protected float _fogDensity
protected float _fogStart
protected float _fogEnd
protected Color4f _fogColor
protected Boolean _lightingEnabled
protected Renderer.LightRecord[] _lights
protected int _lightEnd
protected float _lineWidth
protected Color4f _globalAmbient
protected Color4f _frontAmbient
protected Color4f _frontDiffuse
protected Color4f _frontSpecular
protected Color4f _frontEmission
protected float _frontShininess
protected Color4f _backAmbient
protected Color4f _backDiffuse
protected Color4f _backSpecular
protected Color4f _backEmission
protected float _backShininess
protected Boolean _colorMaterialEnabled
protected int _colorMaterialFace
protected int _colorMaterialMode
protected Boolean _twoSide
protected Boolean _localViewer
protected Boolean _separateSpecular
protected Boolean _flatShading
protected float _pointSize
protected int _frontPolygonMode
protected int _backPolygonMode
protected Boolean _polygonOffsetFillEnabled
protected Boolean _polygonOffsetLineEnabled
protected Boolean _polygonOffsetPointEnabled
protected float _polygonOffsetFactor
protected float _polygonOffsetUnits
protected Program _program
protected Boolean _vertexProgramTwoSide
protected Boolean _stencilTestEnabled
protected int _stencilTestFunc
protected int _stencilTestRef
protected int _stencilTestMask
protected int _stencilFailOp
protected int _stencilDepthFailOp
protected int _stencilPassOp
protected int _stencilWriteMask
protected Renderer.TextureUnitRecord[] _units
protected int _unitEnd
protected int _activeUnit
protected int _matrixMode
protected Transform3D _modelview
protected boolean _modelviewMatrixValid
protected Framebuffer _framebuffer
protected Renderbuffer _renderbuffer
protected int _drawBuffer
protected int _readBuffer
protected int _bufferObjectCount
protected int _bufferObjectBytes
protected int _displayListCount
protected int _shaderObjectCount
protected int _textureCount
protected int _textureBytes
protected int[] _finalizedBufferObjects
protected int _finalizedBufferObjectBytes
protected int[] _finalizedDisplayLists
protected int[] _finalizedFramebuffers
protected Object[] _finalizedPbuffers
protected int[] _finalizedQueries
protected int[] _finalizedRenderbuffers
protected int[] _finalizedShaderObjects
protected int[] _finalizedTextures
protected int _finalizedTextureBytes
protected Matrix4f _mat
protected FloatBuffer _vbuf
protected DoubleBuffer _dbuf
protected static final BufferObject INVALID_BUFFER
protected static final Program INVALID_PROGRAM
protected static final Texture INVALID_TEXTURE
| Constructor Detail |
|---|
public Renderer()
| Method Detail |
|---|
public void init(Drawable drawable,
int width,
int height)
drawable - the drawable surface with which this renderer will be used.width - the initial viewport width.height - the initial viewport height.public Drawable getDrawable()
public void setSize(int width,
int height)
public int getWidth()
public int getHeight()
public void addObserver(Renderer.Observer observer)
public void removeObserver(Renderer.Observer observer)
public int getAlphaBits()
public int getStencilBits()
public int getMaxClipPlanes()
public int getMaxLights()
public int getMaxTextureUnits()
public int getMaxTextureImageUnits()
public int getMaxVertexAttribs()
public int getTextureChangeCount()
resetStats().
public int getBatchCount()
resetStats().
public int getPrimitiveCount()
resetStats().
public void resetStats()
public int getBufferObjectCount()
public int getBufferObjectBytes()
public int getDisplayListCount()
public int getShaderObjectCount()
public int getTextureCount()
public int getTextureBytes()
public void cleanup()
public void setClearColor(Color4f color)
public Color4f getClearColor()
public void setClearDepth(float depth)
public float getClearDepth()
public void setClearStencil(int stencil)
public int getClearStencil()
public void setViewport(Rectangle viewport)
public void setViewport(int x,
int y,
int width,
int height)
public Rectangle getViewport()
public void setProjection(float left,
float right,
float bottom,
float top,
float near,
float far,
Vector3f nearFarNormal,
boolean ortho)
public float getLeft()
public float getRight()
public float getBottom()
public float getTop()
public float getNear()
public float getFar()
public Vector3f getNearFarNormal()
public boolean isOrtho()
public void setClipPlanes(Plane[] planes)
planes - the array of clip planes to set, or null to disable all planes.public void setScissor(Rectangle box)
box - the scissor box, or null to disable the scissor test.public Rectangle getScissor()
null if scissor testing is
disabled.
public void setFrontFace(int face)
public int getFrontFace()
public void setNormalize(boolean normalize,
boolean rescaleNormal)
public void startQuery(Query query)
public void stopQuery(Query query)
public void setStates(RenderState[] states)
public void setState(RenderState state)
public void setAlphaState(int alphaTestFunc,
float alphaTestRef,
int srcBlendFactor,
int destBlendFactor)
alphaTestFunc is
GL11.GL_ALWAYS, alpha testing will be disabled. If srcBlendFactor
is GL11.GL_ONE and destBlendFactor is GL11.GL_ZERO, blending
will be disabled.
public void invalidateAlphaState()
public void setArrayState(int firstVertexAttribIndex,
ClientArray[] vertexAttribArrays,
ClientArray[] texCoordArrays,
ClientArray colorArray,
ClientArray normalArray,
ClientArray vertexArray,
BufferObject elementArrayBuffer)
public void invalidateArrayState()
public void setColorState(Color4f color)
public void setColorState(float r,
float g,
float b,
float a)
public void invalidateColorState()
public void setColorMaskState(boolean red,
boolean green,
boolean blue,
boolean alpha)
public void invalidateColorMaskState()
public void setCullState(int cullFace)
public void invalidateCullState()
public void setDepthState(int depthTestFunc,
boolean depthMask)
depthTestFunc is
GL11.GL_ALWAYS and depthMask is false,
depth testing will be disabled.
public void invalidateDepthState()
public void setFogState(int fogMode,
float fogDensity,
Color4f fogColor)
fogMode is -1, fog will be disabled.
public void setFogState(int fogMode,
float fogStart,
float fogEnd,
Color4f fogColor)
fogMode is -1, fog will be disabled.
public void invalidateFogState()
public void setLightState(Light[] lights,
Color4f globalAmbient)
lights is null, lighting will be disabled.
public void invalidateLightState()
public void setLineState(float lineWidth)
public void invalidateLineState()
public void setMaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public void invalidateMaterialState()
public void setPointState(float pointSize)
public void invalidatePointState()
public void setPolygonState(int frontPolygonMode,
int backPolygonMode,
float polygonOffsetFactor,
float polygonOffsetUnits)
public void invalidatePolygonState()
public void setShaderState(Program program,
boolean vertexProgramTwoSide)
public void invalidateShaderState()
public void setStencilState(int stencilTestFunc,
int stencilTestRef,
int stencilTestMask,
int stencilFailOp,
int stencilDepthFailOp,
int stencilPassOp,
int stencilWriteMask)
public void invalidateStencilState()
public void setTextureState(TextureUnit[] units)
public void invalidateTextureState()
public void setTransformState(Transform3D modelview)
public void invalidateTransformState()
public void setMatrixMode(int matrixMode)
public void render(List<Batch> batches)
protected void setVertexAttribArray(int idx,
ClientArray array)
protected void setTexCoordArray(ClientArray array)
protected void setColorArray(ClientArray array)
protected void setNormalArray(ClientArray array)
protected void setVertexArray(ClientArray array)
protected void setArrayBuffer(BufferObject arrayBuffer)
protected void updateFogEnabled()
protected void loadTransformMatrix(Transform3D transform)
protected boolean clearModelviewOrTransposeTransform(boolean cleared,
Vector4f vector,
FloatBuffer result)
protected boolean maybeClearModelview(boolean cleared)
protected void maybeRestoreModelview(boolean cleared)
protected void transposeTransform(Vector4f vector,
FloatBuffer result)
protected Matrix4f getModelviewMatrix()
protected void setClientActiveUnit(int unit)
protected void setActiveUnit(int unit)
protected void setTexture(Texture texture)
protected void setBuffers(int drawBuffer,
int readBuffer)
protected int getDrawBuffer()
protected int getReadBuffer()
protected void setFramebuffer(Framebuffer framebuffer)
protected Framebuffer getFramebuffer()
protected void setRenderbuffer(Renderbuffer renderbuffer)
protected void bufferObjectCreated()
protected void bufferObjectResized(int delta)
delta - the difference in bytes between the new and old sizes.protected void bufferObjectDeleted(int bytes)
protected void displayListCreated()
protected void displayListDeleted()
protected void shaderObjectCreated()
protected void shaderObjectDeleted()
protected void textureCreated()
protected void textureResized(int delta)
delta - the difference in bytes between the new and old sizes.protected void textureDeleted(int bytes)
protected void bufferObjectFinalized(int id,
int bytes)
protected void displayListFinalized(int id)
protected void framebufferFinalized(int id)
protected void pbufferFinalized(Pbuffer pbuffer)
protected void queryFinalized(int id)
protected void renderbufferFinalized(int id)
protected void shaderObjectFinalized(int id)
protected void textureFinalized(int id,
int bytes)
protected void deleteFinalizedObjects()
protected static void setCapability(int capability,
boolean enable)
protected static void setClientCapability(int capability,
boolean enable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||