Class 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 Detail

      • BaseGraphicEngine

        public BaseGraphicEngine()
    • Method Detail

      • getEngine

        public static BaseGraphicEngine getEngine​(be.yildizgames.module.window.BaseWindowEngine windowEngine)
      • 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: GraphicEngine
        Create a new font to use to print text.
        Specified by:
        createFont in interface GraphicEngine
        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: GraphicEngine
        Create a new font with a given color.
        Specified by:
        createFont in interface GraphicEngine
        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: GraphicEngine
        Create a new font with a given color and a random name.
        Specified by:
        createFont in interface GraphicEngine
        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: GraphicEngine
        Create a new font with a given color and a random name.
        Specified by:
        createFont in interface GraphicEngine
        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: GraphicEngine
        Create a new font.
        Specified by:
        createFont in interface GraphicEngine
        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.
      • getWindowEngine

        public abstract be.yildizgames.module.window.BaseWindowEngine getWindowEngine()