- java.lang.Object
-
- be.yildizgames.module.graphic.BaseGraphicEngine
-
- All Implemented Interfaces:
FpsProvider,GraphicEngine
- Direct Known Subclasses:
DummyGraphicEngine
public abstract class BaseGraphicEngine extends Object implements GraphicEngine, FpsProvider
Behavior for a graphic engine. Specification: The engine must be able to load resources, show a sky box, show the GUI, move and rotate 3d meshes.- Author:
- Grégory Van den Borre
-
-
Constructor Summary
Constructors Constructor Description BaseGraphicEngine()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddResourcePath(be.yildizgames.common.file.ResourcePath resource)Add a folder to use to load resources.abstract voidclose()Free resources used by the engine.FontcreateFont(String path, int size, be.yildizgames.module.color.Color color)Create a new font with a given color and a random name.FontcreateFont(String path, be.yildizgames.module.coordinate.Relative size, be.yildizgames.module.color.Color color)Create a new font with a given color and a random name.FontcreateFont(String name, String path, int size)Create a new font to use to print text.FontcreateFont(String name, String path, be.yildizgames.module.coordinate.Relative size)Create a new font.FontcreateFont(String name, String path, be.yildizgames.module.coordinate.Relative size, be.yildizgames.module.color.Color color)Create a new font with a given color.abstract SceneManagercreateGraphicWorld(String worldName, ShadowType shadowType)Create a new graphic world.abstract GraphicWorldcreateWorld()static BaseGraphicEnginegetEngine()static BaseGraphicEnginegetEngine(be.yildizgames.module.window.BaseWindowEngine windowEngine)GuiEventManagergetEventManager()abstract be.yildizgames.module.window.BaseWindowEnginegetWindowEngine()abstract voidupdate()Render one frame.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface be.yildizgames.module.graphic.FpsProvider
getFPS
-
Methods inherited from interface be.yildizgames.module.graphic.GraphicEngine
createFont, createSelectionRectangle, createSkybox, getGuiFactory, getMaterialManager, getScreenSize, printScreen
-
-
-
-
Method Detail
-
getEngine
public static BaseGraphicEngine getEngine(be.yildizgames.module.window.BaseWindowEngine windowEngine)
-
getEngine
public static BaseGraphicEngine getEngine()
-
getEventManager
public final GuiEventManager getEventManager()
- Specified by:
getEventManagerin interfaceGraphicEngine
-
close
public abstract void close()
Free resources used by the engine.
-
update
public abstract void update()
Render one frame.
-
addResourcePath
public abstract void addResourcePath(be.yildizgames.common.file.ResourcePath resource)
Add a folder to use to load resources.- Parameters:
resource- Data for the resources.
-
createFont
public final Font createFont(String name, String path, int size)
Description copied from interface:GraphicEngineCreate a new font to use to print text.- Specified by:
createFontin interfaceGraphicEngine- Parameters:
name- Name of the font, must be unique, used to retrieve it from the registerer.path- Path to the font file to load.size- Size of the font.- Returns:
- The newly built font.
-
createFont
public final Font createFont(String name, String path, be.yildizgames.module.coordinate.Relative size, be.yildizgames.module.color.Color color)
Description copied from interface:GraphicEngineCreate a new font with a given color.- Specified by:
createFontin interfaceGraphicEngine- Parameters:
name- Font name, must be unique.path- Path to the font file.size- Size of the font.color- Font color.- Returns:
- The newly created font.
-
createFont
public final Font createFont(String path, int size, be.yildizgames.module.color.Color color)
Description copied from interface:GraphicEngineCreate a new font with a given color and a random name.- Specified by:
createFontin interfaceGraphicEngine- Parameters:
path- Path to the font file.size- Size of the font.color- Font color.- Returns:
- The newly created font.
-
createFont
public final Font createFont(String path, be.yildizgames.module.coordinate.Relative size, be.yildizgames.module.color.Color color)
Description copied from interface:GraphicEngineCreate a new font with a given color and a random name.- Specified by:
createFontin interfaceGraphicEngine- Parameters:
path- Path to the font file.size- Size of the font.color- Font color.- Returns:
- The newly created font.
-
createFont
public final Font createFont(String name, String path, be.yildizgames.module.coordinate.Relative size)
Description copied from interface:GraphicEngineCreate a new font.- Specified by:
createFontin interfaceGraphicEngine- Parameters:
name- Font name, must be unique.path- Path to the font file.size- Size of the font.- Returns:
- The newly created font.
-
createGraphicWorld
public abstract SceneManager createGraphicWorld(String worldName, ShadowType shadowType)
Create a new graphic world.- Parameters:
worldName- Unique name to give to the world.shadowType- Type of the shadow to use.- Returns:
- The created GraphicWorld.
-
createWorld
public abstract GraphicWorld createWorld()
-
getWindowEngine
public abstract be.yildizgames.module.window.BaseWindowEngine getWindowEngine()
-
-