|
||||||||||
| 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 | |
|---|---|
static interface |
Renderer.Observer
An interface for objects interested in renderer state changes. |
| Constructor Summary | |
|---|---|
Renderer()
|
|
| Method Summary | |
|---|---|
void |
addObserver(Renderer.Observer observer)
Adds an observer to the list of objects interested in state changes. |
void |
cleanup()
Gives the renderer a chance to perform any periodic cleanup necessary. |
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. |
org.lwjgl.opengl.Drawable |
getDrawable()
Returns a reference to the drawable target of this renderer. |
float |
getFar()
Returns the far projection parameter. |
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. |
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(). |
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(org.lwjgl.opengl.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. |
void |
removeObserver(Renderer.Observer observer)
Removes an observer from the list. |
void |
render(List<Batch> batches)
Renders the provided list of batches. |
void |
resetStats()
Resets the per-frame stats. |
void |
setAlphaState(int alphaTestFunc,
float alphaTestRef,
int srcBlendFactor,
int destBlendFactor)
Sets the alpha testing and blending state. |
void |
setArrayState(int firstVertexAttribIndex,
ClientArray[] vertexAttribArrays,
ClientArray[] texCoordArrays,
ClientArray colorArray,
ClientArray normalArray,
ClientArray vertexArray,
BufferObject elementArrayBuffer)
Sets the client array state. |
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. |
void |
setClipPlanes(Plane[] planes)
Sets the user clip planes. |
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. |
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. |
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. |
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. |
void |
setTextureState(TextureUnit[] units)
Sets the texture state. |
void |
setTransformState(Transform3D modelview)
Sets the transform state. |
void |
setViewport(int x,
int y,
int width,
int height)
Sets the viewport state. |
void |
setViewport(Rectangle viewport)
Sets the viewport state. |
void |
startQuery(Query query)
Starts a query. |
void |
stopQuery(Query query)
Stops a query. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Renderer()
| Method Detail |
|---|
public void init(org.lwjgl.opengl.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 org.lwjgl.opengl.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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||