com.threed.jpct
Interface IPostProcessor


public interface IPostProcessor

An interface for defining a post processor that can be run on the framebuffer. The OpenGL state is ensured to be "clean" when entering process(), but if you are manipulating modelview- or projection matrix (or whatever), it's up to you to restore them to the state they had before.


Method Summary
 void dispose()
          Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected.
 void init(FrameBuffer buffer)
          Initialize the processor.
 boolean isInitialized()
          Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).
 void process()
          Does the actual processing.
 

Method Detail

init

void init(FrameBuffer buffer)
Initialize the processor. Because it has to work on the framebuffer, it should be bound to it. I.e. you shouldn't write a post processor which can be run on multiple framebuffers at a time albeit it's up the actual implementation to ensure this. All the framework does, is to check if isInitialized() returns true, so this method has to ensure that this is the case to prevent all kinds of strange bugs and multi initialization calls.
This method will be called on the first call of the post processor, not when adding it to a framebuffer.

Parameters:
buffer - the FrameBuffer

process

void process()
Does the actual processing. It's totally up to the implementation what happens here.


dispose

void dispose()
Will be called when a post processor gets removed from a framebuffer and should be called, when the processor gets garbage collected. A processor will implicitly be removed from a framebuffer if a renderer gets enabled or disabled on it.


isInitialized

boolean isInitialized()
Has to return true if the init()-method has run correctly and should return false after the processor has been disposed (but doesn't have to, if an implementation requires something else...no problem).

Returns:
boolean is it initialized?