|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines an interface to an engine factory. An engine factory is used to create all the needed engines (graphics, sound, input etc.) that then take care of one part of the game frame functionality. When an engine factory is finalized, it will finalize all the engines that were created by it. This interface is used internally by the library to wrap access to engine factories in MainFactory class.
To engine implementors:
To make your own engine factory work with GameFrame for Java you must do these things:
public static EngineFactory getInstance(GameFrameSettings)
that returns an (preferrably singleton) instance of your engine factory.public static boolean isRunnableOnPlatform()
that returns true if the engine factory is runnable on current platform and false
if it isn't runnable on current platform.
Field Summary | |
static int |
SUITABILITY_GOOD
Enumerated value for the suitability of the engine factory for the platform. |
static int |
SUITABILITY_NOT_SUITED
Enumerated value for the suitability of the engine factory for the platform. |
static int |
SUITABILITY_POOR
Enumerated value for the suitability of the engine factory for the platform. |
static int |
SUITABILITY_ULTIMATE
Enumerated value for the suitability of the engine factory for the platform. |
Method Summary | |
Timer |
createTimer()
Returns a new timer instance. |
void |
finalizationNotify(Timer timer)
Notifies that the given timer has been finalized. |
void |
finalize()
Invoked before application exits. |
java.lang.String |
getDescription()
Returns the (possibly multiline) description of the engine factory implementation. |
GraphicsEngine |
getGraphicsEngine()
Returns the graphics engine implementation for the current platform. |
InputEngine |
getInputEngine()
Returns the input engine implementation for the current platform. |
java.lang.String |
getName()
Returns the short name (max 8 characters) of the engine factory implementation (e.g. |
SoundEngine |
getSoundEngine()
Returns the sound engine implementation for the current platform. |
int |
getSuitabilityForPlatform()
Returns the suitability of this engine implementation for the current platform as one of the enumerated SUITABILITY_xxx values. |
java.lang.String[] |
getSupportedResolutions()
Returns all the fullscreen graphics modes supported by graphics engines that are created by this factory. |
Field Detail |
public static final int SUITABILITY_NOT_SUITED
public static final int SUITABILITY_POOR
public static final int SUITABILITY_GOOD
public static final int SUITABILITY_ULTIMATE
Method Detail |
public java.lang.String getName()
public java.lang.String getDescription()
public int getSuitabilityForPlatform()
public java.lang.String[] getSupportedResolutions()
Returns all the fullscreen graphics modes supported by graphics engines that are created by this factory. If the factory created graphics engines support only windowed modes, this method returns null.
Note to engine developers: This method should always do a full cleanup after it has been run. This means releasing all of the memory and resources that were used.
public SoundEngine getSoundEngine() throws GameFrameException
GameFrameException
- Thrown if sound engine creation fails.public GraphicsEngine getGraphicsEngine() throws GameFrameException
GameFrameException
- Thrown if graphics engine creation fails.public InputEngine getInputEngine() throws GameFrameException
GameFrameException
- Thrown if input engine creation fails.public Timer createTimer() throws GameFrameException
GameFrameException
- Thrown if timer creation fails.public void finalizationNotify(Timer timer)
public void finalize()
finalize
in class java.lang.Object
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |