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.Stringm_acWindowTitleconstructor inputsprotected FrameBuffer.BufferingTypem_eBufferingprotected FrameBuffer.DepthTypem_eDepthprotected FrameBuffer.FormatTypem_eFormatThe frame buffer parameters for the renderer creation.protected FrameBuffer.MultisamplingTypem_eMultisamplingprotected FrameBuffer.StencilTypem_eStencilprotected intm_iHeightprotected intm_iWidthprotected intm_iXPositionprotected intm_iYPositionprotected ColorRGBAm_kBackgroundColorprotected Rendererm_pkRendererThe renderer (used for 2D and 3D applications).private static longserialVersionUID
-
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 voiddispose()Delete memory.floatGetAspectRatio()Returns the window aspect ratio.intGetHeight()Returns the window height.RendererGetRenderer()Returns the Renderer object.intGetWidth()Returns the window width.java.lang.StringGetWindowTitle()Returns the window title.intGetXPosition()Returns the window x-position.intGetYPosition()Returns the window y-position.voidkeyPressed(java.awt.event.KeyEvent e)KeyEvents:voidkeyReleased(java.awt.event.KeyEvent arg0)voidkeyTyped(java.awt.event.KeyEvent arg0)voidOnDisplay()OnDisplay call back, called when the application window is displayedvoidOnIdle()OnIdle call back, called when the application is idlebooleanOnInitialize()OnInitialize call back, called when the application is created.voidOnMove(int iX, int iY)OnMove call back, called when the application window is moved.booleanOnPrecreate()OnPrecreate call back, called before the application is created.voidOnResize(int iWidth, int iHeight)OnResize call back, called when the application window is resizedvoidOnTerminate()OnTerminate call back, called when the application is terminated.voidSetRenderer(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:
keyPressedin interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent arg0)
- Specified by:
keyReleasedin interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent arg0)
- Specified by:
keyTypedin 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.
-
-