gestalt.render
Class BasicRenderer

java.lang.Object
  extended by gestalt.render.MinimalRenderer
      extended by gestalt.render.BasicRenderer
All Implemented Interfaces:
Gestalt, GestaltKeyListener, GestaltMouseListener
Direct Known Subclasses:
AnimatorRenderer, AppletRenderer, GestaltPlugIn, JoglAppletRenderer

public class BasicRenderer
extends MinimalRenderer
implements Gestalt, GestaltKeyListener, GestaltMouseListener

basic renderer supplies a basic render setup including the texturemanager, the eventhandler, bitmapproducer, a camera, etc.


Field Summary
 
Fields inherited from class gestalt.render.MinimalRenderer
WORKAROUND_FORCE_QUIT
 
Fields inherited from interface gestalt.Gestalt
ALPHA, BIN_2D_BACKGROUND, BIN_2D_BACKGROUND_FINISH, BIN_2D_BACKGROUND_SETUP, BIN_2D_FOREGROUND, BIN_2D_FOREGROUND_FINISH, BIN_2D_FOREGROUND_SETUP, BIN_3D, BIN_3D_FINISH, BIN_3D_SETUP, BIN_ARBITRARY, BIN_FRAME_FINISH, BIN_FRAME_SETUP, BIN_NUMBER_OF_DEFAULT_BINS, BITMAP_BLENDFACTOR_DST_ALPHA, BITMAP_BLENDFACTOR_DST_COLOR, BITMAP_BLENDFACTOR_ONE, BITMAP_BLENDFACTOR_ONE_MINUS_DST_ALPHA, BITMAP_BLENDFACTOR_ONE_MINUS_DST_COLOR, BITMAP_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, BITMAP_BLENDFACTOR_ONE_MINUS_SRC_COLOR, BITMAP_BLENDFACTOR_SRC_ALPHA, BITMAP_BLENDFACTOR_SRC_ALPHA_SATURATE, BITMAP_BLENDFACTOR_SRC_COLOR, BITMAP_BLENDFACTOR_ZERO, BITMAP_BLENDMODE_ADD, BITMAP_BLENDMODE_ADD_2, BITMAP_BLENDMODE_MULTIPLY, BITMAP_BLENDMODE_OVERWRITE, BITMAP_COMPONENT_ORDER_BGRA, BITMAP_COMPONENT_ORDER_RGBA, BLUE, CAMERA_A_HANDY_ANGLE, CAMERA_CULLING_BACKFACE, CAMERA_CULLING_FRONT_AND_BACKFACE, CAMERA_CULLING_FRONTFACE, CAMERA_CULLING_NONE, CAMERA_MODE_LOOK_AT, CAMERA_MODE_ROTATE_XYZ, CAMERA_MODE_ROTATION_AXIS, ENGINE_JOGL, EPSILON, FOG_FILTER_EXP, FOG_FILTER_EXP2, FOG_FILTER_LINEAR, FONT_ALIGN_CENTER, FONT_ALIGN_LEFT, FONT_ALIGN_RIGHT, FONT_QUALITY_HIGH, FONT_QUALITY_LOW, FONT_STYLE_BOLD, FONT_STYLE_ITALIC, FONT_STYLE_REGULAR, GREEN, HINT_LEAVE_STATE_UNCHANGED, IMAGE_FILEFORMAT_JPEG, IMAGE_FILEFORMAT_PNG, IMAGE_FILEFORMAT_TGA, INTEL, KEYCODE_0, KEYCODE_1, KEYCODE_2, KEYCODE_3, KEYCODE_4, KEYCODE_5, KEYCODE_6, KEYCODE_7, KEYCODE_8, KEYCODE_9, KEYCODE_A, KEYCODE_B, KEYCODE_C, KEYCODE_D, KEYCODE_DOWN, KEYCODE_E, KEYCODE_ESCAPE, KEYCODE_F, KEYCODE_G, KEYCODE_H, KEYCODE_I, KEYCODE_J, KEYCODE_K, KEYCODE_L, KEYCODE_LEFT, KEYCODE_M, KEYCODE_META, KEYCODE_N, KEYCODE_O, KEYCODE_P, KEYCODE_PAGE_DOWN, KEYCODE_PAGE_UP, KEYCODE_Q, KEYCODE_R, KEYCODE_RIGHT, KEYCODE_S, KEYCODE_SHIFT, KEYCODE_SPACE, KEYCODE_T, KEYCODE_U, KEYCODE_UP, KEYCODE_V, KEYCODE_W, KEYCODE_X, KEYCODE_Y, KEYCODE_Z, LINE_PRIMITIVE_TYPE_LINE_LOOP, LINE_PRIMITIVE_TYPE_LINE_STRIP, LINE_PRIMITIVE_TYPE_LINES, MACOSX, MATERIAL_BLEND_ALPHA, MATERIAL_BLEND_BRIGHTER, MATERIAL_BLEND_CUSTOM, MATERIAL_BLEND_INVERS_MULTIPLY, MATERIAL_BLEND_MULTIPLY, MATERIAL_BLEND_WHITE_INVERT, MATERIAL_NORMAL_NORMALIZE, MATERIAL_NORMAL_RESCALE_NORMALS, MESH_LINE_LOOP, MESH_LINES, MESH_POINTS, MESH_POLYGON, MESH_QUAD_STRIP, MESH_QUADS, MESH_TRIANGLE_FAN, MESH_TRIANGLE_STRIP, MESH_TRIANGLES, MOUSEBUTTON_LEFT, MOUSEBUTTON_MIDDLE, MOUSEBUTTON_RIGHT, MOVIE_DIRECTION_BACKWARDS, MOVIE_DIRECTION_FORWARD, PI, PI_HALF, PICKING_BIN_2D, PICKING_BIN_3D, RED, SHAPE_CUBE_TEXTURE_SAME_FOR_EACH_SIDE, SHAPE_CUBE_TEXTURE_WRAP_AROUND, SHAPE_ORIGIN_BOTTOM_CENTERED, SHAPE_ORIGIN_BOTTOM_LEFT, SHAPE_ORIGIN_BOTTOM_RIGHT, SHAPE_ORIGIN_CENTERED, SHAPE_ORIGIN_CENTERED_LEFT, SHAPE_ORIGIN_CENTERED_RIGHT, SHAPE_ORIGIN_TOP_CENTERED, SHAPE_ORIGIN_TOP_LEFT, SHAPE_ORIGIN_TOP_RIGHT, SHAPE_TRANSFORM_MATRIX, SHAPE_TRANSFORM_MATRIX_AND_ROTATION, SHAPE_TRANSFORM_POSITION_AND_ROTATION, SHAPEBIN_SORT_BY_DISTANCE_TO_CAMERA, SHAPEBIN_SORT_BY_Z_DISTANCE_TO_CAMERAPLANE, SHAPEBIN_SORT_BY_Z_POSITION, SQRT_TWO, TEXTURE_FILTERTYPE_LINEAR, TEXTURE_FILTERTYPE_MIPMAP, TEXTURE_FILTERTYPE_NEAREST, TEXTURE_MEDIA_IMAGE_BGR, TEXTURE_PROPORTION_ARBITRARY, TEXTURE_PROPORTION_POWEROF2, TEXTURE_WRAPMODE_CLAMP, TEXTURE_WRAPMODE_CLAMP_TO_BORDER, TEXTURE_WRAPMODE_REPEAT, TWO_PI, UNDEFINED, USE_DISPLAY_LISTS
 
Constructor Summary
BasicRenderer()
           
 
Method Summary
 Camera camera()
          get reference to current camera.
 void create(DisplayCapabilities theDisplayCapabilities)
          creates all context.
 void dispose(Disposable theDisposable)
          schedule an object for disposing.
 Fog fog()
          return a reference to the current fog.
 FrameFinish framefinish()
           
 FrameSetup framesetup()
           
 void keyPressed(char theKey, int theKeyCode)
          override this method to receive key events.
 void keyReleased(char theKey, int theKeyCode)
          override this method to receive key events.
 Light light()
          return a reference to the current light.
 void mousePressed(int x, int y, int thePressedMouseButton)
          override this method to receive mouse events.
 void mouseReleased(int x, int y, int thePressedMouseButton)
          override this method to receive mouse events.
 Origin origin()
          handles the origin in the 2D bins.
 void quit()
          quits the renderer.
 void replaceCamera(Camera theCamera)
          replace the current camera.
 void set3DFinishRef(Bin3DFinish theBin3DFinish)
           
 void setBinRef(AbstractBin theBin)
           
 void setCameraRef(Camera theCamera)
          set the reference to the camera.
 void setFogRef(Fog theFog)
           
 void setFramefinishRef(FrameFinish theFrameFinish)
           
 void setFramesetupRef(FrameSetup theFrameSetup)
           
 void setLightRef(Light theLight)
           
 void setOriginRef(Origin theOrigin)
           
 void setupDefaultRenderbins()
          creates a default setup of several 2D, 3D and some helper bins.
 java.lang.String toString()
           
 
Methods inherited from class gestalt.render.MinimalRenderer
bin, bin, createDisplayCapabilities, display, displaycapabilities, drawablefactory, event, setDisplayRef, setDrawablefactoryRef, setEventRef, updateDisplayCapabilities
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicRenderer

public BasicRenderer()
Method Detail

create

public void create(DisplayCapabilities theDisplayCapabilities)
creates all context. this method must be called before the renderer is actually used.

Overrides:
create in class MinimalRenderer
Parameters:
theDisplayCapabilities - DisplayCapabilities

quit

public void quit()
quits the renderer.

Overrides:
quit in class MinimalRenderer

setupDefaultRenderbins

public void setupDefaultRenderbins()
creates a default setup of several 2D, 3D and some helper bins.
available bins are:
    BIN_FRAME_SETUP
    BIN_2D_BACKGROUND_SETUP
    BIN_2D_BACKGROUND
    BIN_2D_BACKGROUND_FINISH
    BIN_3D_SETUP
    BIN_3D
    BIN_3D_FINISH
    BIN_2D_FOREGROUND_SETUP
    BIN_2D_FOREGROUND
    BIN_2D_FOREGROUND_FINISH
    BIN_ARBITRARY
    BIN_FRAME_FINISH
 


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

dispose

public void dispose(Disposable theDisposable)
schedule an object for disposing.

Parameters:
theDisposable - Disposable

setBinRef

public final void setBinRef(AbstractBin theBin)
Parameters:
theBin - AbstractBin

setFogRef

public final void setFogRef(Fog theFog)
Parameters:
theFog - Fog

fog

public final Fog fog()
return a reference to the current fog.

Returns:
Fog

setLightRef

public final void setLightRef(Light theLight)
Parameters:
theLight - Light

light

public final Light light()
return a reference to the current light.

Returns:
Light

setOriginRef

public final void setOriginRef(Origin theOrigin)
Parameters:
theOrigin - Origin

origin

public final Origin origin()
handles the origin in the 2D bins.

Returns:
Origin

framesetup

public final FrameSetup framesetup()
Returns:
FrameSetup

setFramesetupRef

public final void setFramesetupRef(FrameSetup theFrameSetup)
Parameters:
theFrameSetup - FrameSetup

framefinish

public final FrameFinish framefinish()
Returns:
FrameFinish

setFramefinishRef

public final void setFramefinishRef(FrameFinish theFrameFinish)
Parameters:
theFrameFinish - FrameFinish

set3DFinishRef

public final void set3DFinishRef(Bin3DFinish theBin3DFinish)
Parameters:
theFrameFinish - FrameFinish

camera

public final Camera camera()
get reference to current camera.

Returns:
Camera

setCameraRef

public final void setCameraRef(Camera theCamera)
set the reference to the camera.

Parameters:
theCamera - Camera

replaceCamera

public final void replaceCamera(Camera theCamera)
replace the current camera.

Parameters:
theCamera - Camera

mousePressed

public void mousePressed(int x,
                         int y,
                         int thePressedMouseButton)
override this method to receive mouse events.

Specified by:
mousePressed in interface GestaltMouseListener
Parameters:
x - int
y - int
thePressedMouseButton - int

mouseReleased

public void mouseReleased(int x,
                          int y,
                          int thePressedMouseButton)
override this method to receive mouse events.

Specified by:
mouseReleased in interface GestaltMouseListener
Parameters:
x - int
y - int
thePressedMouseButton - int

keyPressed

public void keyPressed(char theKey,
                       int theKeyCode)
override this method to receive key events.

Specified by:
keyPressed in interface GestaltKeyListener
Parameters:
theKey - char
theKeyCode - int

keyReleased

public void keyReleased(char theKey,
                        int theKeyCode)
override this method to receive key events.

Specified by:
keyReleased in interface GestaltKeyListener
Parameters:
theKey - char
theKeyCode - int


processing library gestalt_p5 by Patrick Kochlik + Dennis Paul. (c) 2009