Class JavaApplication
- java.lang.Object
-
- WildMagic.LibApplications.OpenGLApplication.Application
-
- WildMagic.LibApplications.OpenGLApplication.JavaApplication
-
- All Implemented Interfaces:
java.awt.event.KeyListener
,java.io.Serializable
,java.util.EventListener
- Direct Known Subclasses:
JavaApplication2D
,JavaApplication3D
public abstract class JavaApplication extends Application implements java.awt.event.KeyListener, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
m_acWindowTitle
constructor inputsprotected FrameBuffer.BufferingType
m_eBuffering
protected FrameBuffer.DepthType
m_eDepth
protected FrameBuffer.FormatType
m_eFormat
The frame buffer parameters for the renderer creation.protected FrameBuffer.MultisamplingType
m_eMultisampling
protected FrameBuffer.StencilType
m_eStencil
protected int
m_iHeight
protected int
m_iWidth
protected int
m_iXPosition
protected int
m_iYPosition
protected ColorRGBA
m_kBackgroundColor
protected Renderer
m_pkRenderer
The renderer (used for 2D and 3D applications).private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description JavaApplication(java.lang.String acWindowTitle, int iXPosition, int iYPosition, int iWidth, int iHeight, ColorRGBA rkBackgroundColor)
Creates a new JavaApplication3.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Delete memory.float
GetAspectRatio()
Returns the window aspect ratio.int
GetHeight()
Returns the window height.Renderer
GetRenderer()
Returns the Renderer object.int
GetWidth()
Returns the window width.java.lang.String
GetWindowTitle()
Returns the window title.int
GetXPosition()
Returns the window x-position.int
GetYPosition()
Returns the window y-position.void
keyPressed(java.awt.event.KeyEvent e)
KeyEvents:void
keyReleased(java.awt.event.KeyEvent arg0)
void
keyTyped(java.awt.event.KeyEvent arg0)
void
OnDisplay()
OnDisplay call back, called when the application window is displayedvoid
OnIdle()
OnIdle call back, called when the application is idleboolean
OnInitialize()
OnInitialize call back, called when the application is created.void
OnMove(int iX, int iY)
OnMove call back, called when the application window is moved.boolean
OnPrecreate()
OnPrecreate call back, called before the application is created.void
OnResize(int iWidth, int iHeight)
OnResize call back, called when the application window is resizedvoid
OnTerminate()
OnTerminate call back, called when the application is terminated.void
SetRenderer(Renderer pkRenderer)
Set the Renderer object.-
Methods inherited from class WildMagic.LibApplications.OpenGLApplication.Application
reloadShaders, TestStreaming
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
m_acWindowTitle
protected java.lang.String m_acWindowTitle
constructor inputs
-
m_iXPosition
protected int m_iXPosition
-
m_iYPosition
protected int m_iYPosition
-
m_iWidth
protected int m_iWidth
-
m_iHeight
protected int m_iHeight
-
m_kBackgroundColor
protected ColorRGBA m_kBackgroundColor
-
m_eFormat
protected FrameBuffer.FormatType m_eFormat
The frame buffer parameters for the renderer creation. You may set these to values different than the defaults during your application constructor call. Default buffer parameters. These may be overridden by the derived class constructor. Current hardware seems to pack a 24-bit depth buffer and 8-bit stencil buffer into a 32-bit buffer, so I suggest not overriding these. Perhaps the only one you should is the multisampling value.
-
m_eDepth
protected FrameBuffer.DepthType m_eDepth
-
m_eStencil
protected FrameBuffer.StencilType m_eStencil
-
m_eBuffering
protected FrameBuffer.BufferingType m_eBuffering
-
m_eMultisampling
protected FrameBuffer.MultisamplingType m_eMultisampling
-
m_pkRenderer
protected Renderer m_pkRenderer
The renderer (used for 2D and 3D applications).
-
-
Constructor Detail
-
JavaApplication
public JavaApplication(java.lang.String acWindowTitle, int iXPosition, int iYPosition, int iWidth, int iHeight, ColorRGBA rkBackgroundColor)
Creates a new JavaApplication3.- Parameters:
acWindowTitle
- the window titleiXPosition
- window screen x-positioniYPosition
- window screen y-positioniWidth
- window widthiHeight
- window heightrkBackgroundColor
- background color
-
-
Method Detail
-
dispose
public void dispose()
Delete memory.
-
GetAspectRatio
public float GetAspectRatio()
Returns the window aspect ratio.- Returns:
- window aspect ratio.
-
GetHeight
public int GetHeight()
Returns the window height.- Returns:
- the window height.
-
GetRenderer
public Renderer GetRenderer()
Returns the Renderer object.- Returns:
- the Renderer object.
-
GetWidth
public int GetWidth()
Returns the window width.- Returns:
- the window width.
-
GetWindowTitle
public java.lang.String GetWindowTitle()
Returns the window title.- Returns:
- the window title.
-
GetXPosition
public int GetXPosition()
Returns the window x-position.- Returns:
- the window x-position.
-
GetYPosition
public int GetYPosition()
Returns the window y-position.- Returns:
- the window y-position.
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
KeyEvents:- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent arg0)
- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent arg0)
- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
-
OnDisplay
public void OnDisplay()
OnDisplay call back, called when the application window is displayed
-
OnIdle
public void OnIdle()
OnIdle call back, called when the application is idle
-
OnInitialize
public boolean OnInitialize()
OnInitialize call back, called when the application is created.- Returns:
- true
-
OnMove
public void OnMove(int iX, int iY)
OnMove call back, called when the application window is moved.- Parameters:
iX
- new x-positioniY
- new y-position
-
OnPrecreate
public boolean OnPrecreate()
OnPrecreate call back, called before the application is created.- Returns:
- true
-
OnResize
public void OnResize(int iWidth, int iHeight)
OnResize call back, called when the application window is resized- Parameters:
iWidth
- the new window widthiHeight
- the new window height
-
OnTerminate
public void OnTerminate()
OnTerminate call back, called when the application is terminated.
-
SetRenderer
public void SetRenderer(Renderer pkRenderer)
Set the Renderer object.- Parameters:
pkRenderer
- the new renderer object.
-
-