org.ogre4j
Class RenderTexture

java.lang.Object
  extended by org.xbig.base.NativeObject
      extended by org.ogre4j.RenderTexture
All Implemented Interfaces:
IAllocatedObject<IRenderSysAllocPolicy>, IRenderSysAllocatedObject, IRenderTarget, IRenderTexture, INativeObject

public class RenderTexture
extends NativeObject
implements IRenderTexture


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ogre4j.IRenderTarget
IRenderTarget.IFrameStats, IRenderTarget.IImpl, IRenderTarget.IRenderTargetListenerList, IRenderTarget.IViewportList
 
Field Summary
 
Fields inherited from class org.xbig.base.NativeObject
deleted, object, remote
 
Constructor Summary
  RenderTexture(InstancePointer p)
          This constructor is public for internal useage only!
protected RenderTexture(InstancePointer p, boolean remote)
          Creates a Java wrapper object for an existing C++ object.
  RenderTexture(WithoutNativeObject val)
          Allows creation of Java objects without C++ objects.
 
Method Summary
 IRenderTarget.IImpl _getImpl()
          Get rendersystem specific interface for this .
 void _notifyCameraRemoved(ICamera cam)
          Utility method to notify a render target that a camera has been removed, incase it was referring to it as a viewer.
 void addListener(IRenderTargetListener listener)
          Add a listener to this which will be called back before & after rendering.
 IViewport addViewport(ICamera cam, int ZOrder, float left, float top, float width, float height)
          Adds a viewport to the rendering target.
 void copyContentsToMemory(IPixelBox dst, RenderTarget.FrameBuffer buffer)
          Copies the current contents of the render target to a pixelbox.
 void delete()
          Deletes the corresponding C++ object.
 void finalize()
           
 float getAverageFPS()
          Individual stats access - gets the average frames per second (FPS) since call to .
 int getBatchCount()
          Gets the number of batches rendered in the last call.
 float getBestFPS()
          Individual stats access - gets the best frames per second (FPS) since call to .
 float getBestFrameTime()
          Individual stats access - gets the best frame time
 long getColourDepth()
           
 void getCustomAttribute(java.lang.String name, VoidPointer pData)
          Gets a custom (maybe platform-specific) attribute.
 long getFSAA()
          Indicates whether multisampling is performed on rendering and at what level.
 long getHeight()
           
 float getLastFPS()
          Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.
 void getMetrics(LongPointer width, LongPointer height, LongPointer colourDepth)
           
 java.lang.String getName()
           
 int getNumViewports()
          Returns the number of viewports attached to this target.
 short getPriority()
          Gets the priority of a render target.
 IRenderTarget.IFrameStats getStatistics()
           
 void getStatistics(FloatPointer lastFPS, FloatPointer avgFPS, FloatPointer bestFPS, FloatPointer worstFPS)
          Retieves details of current rendering performance.
 int getTriangleCount()
          Gets the number of triangles rendered in the last call.
 IViewport getViewport(int index)
          Retrieves a pointer to the viewport with the given index.
 long getWidth()
           
 float getWorstFPS()
          Individual stats access - gets the worst frames per second (FPS) since call to .
 float getWorstFrameTime()
          Individual stats access - gets the worst frame time
 boolean isActive()
          Used to retrieve or set the active state of the render target.
 boolean isAutoUpdated()
          Gets whether this target is automatically updated if Ogre's rendering loop or is being used.
 boolean isHardwareGammaEnabled()
          Indicates whether on rendering, linear colour space is converted to sRGB gamma colour space.
 boolean isPrimary()
          Indicates whether this target is the primary window.
 void removeAllListeners()
          Removes all listeners from this instance.
 void removeAllViewports()
          Removes all viewports on this target.
 void removeListener(IRenderTargetListener listener)
          Removes a previously registered using addListener.
 void removeViewport(int ZOrder)
          Removes a viewport at a given ZOrder.
 boolean requiresTextureFlipping()
           
 void resetStatistics()
          Resets saved frame-rate statistices.
 void setActive(boolean state)
          Used to set the active state of the render target.
 void setAutoUpdated(boolean autoupdate)
          Sets whether this target should be automatically updated if Ogre's rendering loop or is being used.
 void setPriority(short priority)
          Sets the priority of this render target in relation to the others.
 PixelFormat suggestPixelFormat()
          Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMemory.
 void swapBuffers(boolean waitForVSync)
          Swaps the frame buffers to display the next frame.
 void update(boolean swapBuffers)
          Tells the target to update it's contents.
 void writeContentsToFile(java.lang.String filename)
          Writes the current contents of the render target to the named file.
 java.lang.String writeContentsToTimestampedFile(java.lang.String filenamePrefix, java.lang.String filenameSuffix)
          Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.
 
Methods inherited from class org.xbig.base.NativeObject
disconnectFromNativeObject, equals, getInstancePointer, hashCode, setInstancePointer, setInstancePointer, setInstancePointer, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xbig.base.INativeObject
disconnectFromNativeObject, getInstancePointer, setInstancePointer, setInstancePointer, setInstancePointer
 

Constructor Detail

RenderTexture

public RenderTexture(InstancePointer p)
This constructor is public for internal useage only! Do not use it!


RenderTexture

protected RenderTexture(InstancePointer p,
                        boolean remote)
Creates a Java wrapper object for an existing C++ object. If remote is set to 'true' this object cannot be deleted in Java.


RenderTexture

public RenderTexture(WithoutNativeObject val)
Allows creation of Java objects without C++ objects.

See Also:
WithoutNativeObject, INativeObject.disconnectFromNativeObject()
Method Detail

delete

public void delete()
Description copied from interface: INativeObject
Deletes the corresponding C++ object.

Subclasses must implement this but if the native instance was created by the underlying library the native call to dispose must not happen!

Specified by:
delete in interface INativeObject
Specified by:
delete in class NativeObject
See Also:
#remote

finalize

public void finalize()
Overrides:
finalize in class NativeObject

copyContentsToMemory

public void copyContentsToMemory(IPixelBox dst,
                                 RenderTarget.FrameBuffer buffer)
Description copied from interface: IRenderTarget
Copies the current contents of the render target to a pixelbox.

Specified by:
copyContentsToMemory in interface IRenderTarget
Specified by:
copyContentsToMemory in interface IRenderTexture

suggestPixelFormat

public PixelFormat suggestPixelFormat()
Description copied from interface: IRenderTarget
Suggests a pixel format to use for extracting the data in this target, when calling copyContentsToMemory.

Specified by:
suggestPixelFormat in interface IRenderTarget
Specified by:
suggestPixelFormat in interface IRenderTexture

getName

public java.lang.String getName()
Specified by:
getName in interface IRenderTarget

getMetrics

public void getMetrics(LongPointer width,
                       LongPointer height,
                       LongPointer colourDepth)
Specified by:
getMetrics in interface IRenderTarget

getWidth

public long getWidth()
Specified by:
getWidth in interface IRenderTarget

getHeight

public long getHeight()
Specified by:
getHeight in interface IRenderTarget

getColourDepth

public long getColourDepth()
Specified by:
getColourDepth in interface IRenderTarget

update

public void update(boolean swapBuffers)
Tells the target to update it's contents.

Specified by:
update in interface IRenderTarget

swapBuffers

public void swapBuffers(boolean waitForVSync)
Swaps the frame buffers to display the next frame.

Specified by:
swapBuffers in interface IRenderTarget

addViewport

public IViewport addViewport(ICamera cam,
                             int ZOrder,
                             float left,
                             float top,
                             float width,
                             float height)
Adds a viewport to the rendering target.

Specified by:
addViewport in interface IRenderTarget

getNumViewports

public int getNumViewports()
Returns the number of viewports attached to this target.

Specified by:
getNumViewports in interface IRenderTarget

getViewport

public IViewport getViewport(int index)
Retrieves a pointer to the viewport with the given index.

Specified by:
getViewport in interface IRenderTarget

removeViewport

public void removeViewport(int ZOrder)
Removes a viewport at a given ZOrder.

Specified by:
removeViewport in interface IRenderTarget

removeAllViewports

public void removeAllViewports()
Removes all viewports on this target.

Specified by:
removeAllViewports in interface IRenderTarget

getStatistics

public void getStatistics(FloatPointer lastFPS,
                          FloatPointer avgFPS,
                          FloatPointer bestFPS,
                          FloatPointer worstFPS)
Retieves details of current rendering performance.

Specified by:
getStatistics in interface IRenderTarget

getStatistics

public IRenderTarget.IFrameStats getStatistics()
Specified by:
getStatistics in interface IRenderTarget

getLastFPS

public float getLastFPS()
Individual stats access - gets the number of frames per second (FPS) based on the last frame rendered.

Specified by:
getLastFPS in interface IRenderTarget

getAverageFPS

public float getAverageFPS()
Individual stats access - gets the average frames per second (FPS) since call to .

Specified by:
getAverageFPS in interface IRenderTarget

getBestFPS

public float getBestFPS()
Individual stats access - gets the best frames per second (FPS) since call to .

Specified by:
getBestFPS in interface IRenderTarget

getWorstFPS

public float getWorstFPS()
Individual stats access - gets the worst frames per second (FPS) since call to .

Specified by:
getWorstFPS in interface IRenderTarget

getBestFrameTime

public float getBestFrameTime()
Individual stats access - gets the best frame time

Specified by:
getBestFrameTime in interface IRenderTarget

getWorstFrameTime

public float getWorstFrameTime()
Individual stats access - gets the worst frame time

Specified by:
getWorstFrameTime in interface IRenderTarget

resetStatistics

public void resetStatistics()
Resets saved frame-rate statistices.

Specified by:
resetStatistics in interface IRenderTarget

getCustomAttribute

public void getCustomAttribute(java.lang.String name,
                               VoidPointer pData)
Gets a custom (maybe platform-specific) attribute.

Specified by:
getCustomAttribute in interface IRenderTarget

addListener

public void addListener(IRenderTargetListener listener)
Add a listener to this which will be called back before & after rendering.

Specified by:
addListener in interface IRenderTarget

removeListener

public void removeListener(IRenderTargetListener listener)
Removes a previously registered using addListener.

Specified by:
removeListener in interface IRenderTarget

removeAllListeners

public void removeAllListeners()
Removes all listeners from this instance.

Specified by:
removeAllListeners in interface IRenderTarget

setPriority

public void setPriority(short priority)
Sets the priority of this render target in relation to the others.

Specified by:
setPriority in interface IRenderTarget

getPriority

public short getPriority()
Gets the priority of a render target.

Specified by:
getPriority in interface IRenderTarget

isActive

public boolean isActive()
Used to retrieve or set the active state of the render target.

Specified by:
isActive in interface IRenderTarget

setActive

public void setActive(boolean state)
Used to set the active state of the render target.

Specified by:
setActive in interface IRenderTarget

setAutoUpdated

public void setAutoUpdated(boolean autoupdate)
Sets whether this target should be automatically updated if Ogre's rendering loop or is being used.

Specified by:
setAutoUpdated in interface IRenderTarget

isAutoUpdated

public boolean isAutoUpdated()
Gets whether this target is automatically updated if Ogre's rendering loop or is being used.

Specified by:
isAutoUpdated in interface IRenderTarget

writeContentsToFile

public void writeContentsToFile(java.lang.String filename)
Writes the current contents of the render target to the named file.

Specified by:
writeContentsToFile in interface IRenderTarget

writeContentsToTimestampedFile

public java.lang.String writeContentsToTimestampedFile(java.lang.String filenamePrefix,
                                                       java.lang.String filenameSuffix)
Writes the current contents of the render target to the (PREFIX)(time-stamp)(SUFFIX) file.

Specified by:
writeContentsToTimestampedFile in interface IRenderTarget

requiresTextureFlipping

public boolean requiresTextureFlipping()
Specified by:
requiresTextureFlipping in interface IRenderTarget

getTriangleCount

public int getTriangleCount()
Gets the number of triangles rendered in the last call.

Specified by:
getTriangleCount in interface IRenderTarget

getBatchCount

public int getBatchCount()
Gets the number of batches rendered in the last call.

Specified by:
getBatchCount in interface IRenderTarget

_notifyCameraRemoved

public void _notifyCameraRemoved(ICamera cam)
Utility method to notify a render target that a camera has been removed, incase it was referring to it as a viewer.

Specified by:
_notifyCameraRemoved in interface IRenderTarget

isPrimary

public boolean isPrimary()
Indicates whether this target is the primary window. The primary window is special in that it is destroyed when ogre is shut down, and cannot be destroyed directly. This is the case because it holds the context for vertex, index buffers and textures.

Specified by:
isPrimary in interface IRenderTarget

isHardwareGammaEnabled

public boolean isHardwareGammaEnabled()
Indicates whether on rendering, linear colour space is converted to sRGB gamma colour space. This is the exact opposite conversion of what is indicated by , and can only be enabled on creation of the render target. For render windows, it's enabled through the 'gamma' creation misc parameter. For textures, it is enabled through the hwGamma parameter to the create call.

Specified by:
isHardwareGammaEnabled in interface IRenderTarget

getFSAA

public long getFSAA()
Indicates whether multisampling is performed on rendering and at what level.

Specified by:
getFSAA in interface IRenderTarget

_getImpl

public IRenderTarget.IImpl _getImpl()
Get rendersystem specific interface for this . This is used by the to (un)bind this target, and to get specific information like surfaces and framebuffer objects.

Specified by:
_getImpl in interface IRenderTarget


Copyright © 2007 netAllied GmbH. All Rights Reserved.