Class DefaultRenderer

java.lang.Object
graphics.renderer.Renderer
graphics.renderer.DefaultRenderer

public class DefaultRenderer extends Renderer

Azurite

Used to render sprites, which are rendered as Primitive.QUADs with textures. This should be used to render any renderable gameObject.
  • Constructor Details

    • DefaultRenderer

      public DefaultRenderer()
  • Method Details

    • createShader

      protected Shader createShader()
      Create a shader
      Specified by:
      createShader in class Renderer
      Returns:
      the created shader
    • createFramebuffer

      protected Framebuffer createFramebuffer()
      Create a framebuffer
      Specified by:
      createFramebuffer in class Renderer
      Returns:
      the created Framebuffer
    • createBatch

      protected RenderBatch createBatch(int zIndex)
      Create a new Batch with appropriate parameters
      Specified by:
      createBatch in class Renderer
      Parameters:
      zIndex -
      Returns:
      a new batch
    • uploadUniforms

      protected void uploadUniforms(Shader shader)
      Upload uniforms to the shader
      Specified by:
      uploadUniforms in class Renderer
      Parameters:
      shader - the shader
    • rebuffer

      protected void rebuffer()
      Rebuffer all the data into batches
      Specified by:
      rebuffer in class Renderer
    • add

      public void add(GameObject gameObject)
      Add a gameObject to this renderer
      Overrides:
      add in class Renderer
      Parameters:
      gameObject - the GameObject with renderable components
    • remove

      public void remove(GameObject gameObject)
      Remove a gameObject from this renderer
      Overrides:
      remove in class Renderer
      Parameters:
      gameObject - the GameObject with renderable components
    • prepare

      protected void prepare()
      Prepare for rendering. Do anything like setting background here.
      Specified by:
      prepare in class Renderer