Package graphics.renderer
Class DefaultRenderer
java.lang.Object
graphics.renderer.Renderer
graphics.renderer.DefaultRenderer
Azurite
Used to render sprites, which are rendered asPrimitive.QUAD
s
with textures. This should be used to render any renderable gameObject
.-
Field Summary
Fields inherited from class graphics.renderer.Renderer
batches, framebuffer, noRebuffer, textureSlots
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(GameObject gameObject) Add a gameObject to this rendererprotected RenderBatch
createBatch
(int zIndex) Create a new Batch with appropriate parametersprotected Framebuffer
Create a framebufferprotected Shader
Create a shaderprotected void
prepare()
Prepare for rendering.protected void
rebuffer()
Rebuffer all the data into batchesvoid
remove
(GameObject gameObject) Remove a gameObject from this rendererprotected void
uploadUniforms
(Shader shader) Upload uniforms to the shaderMethods inherited from class graphics.renderer.Renderer
clean, fetchColorAttachment, getAvailableBatch, init, render
-
Constructor Details
-
DefaultRenderer
public DefaultRenderer()
-
-
Method Details
-
createShader
Create a shader- Specified by:
createShader
in classRenderer
- Returns:
- the created shader
-
createFramebuffer
Create a framebuffer- Specified by:
createFramebuffer
in classRenderer
- Returns:
- the created Framebuffer
-
createBatch
Create a new Batch with appropriate parameters- Specified by:
createBatch
in classRenderer
- Parameters:
zIndex
-- Returns:
- a new batch
-
uploadUniforms
Upload uniforms to the shader- Specified by:
uploadUniforms
in classRenderer
- Parameters:
shader
- the shader
-
rebuffer
protected void rebuffer()Rebuffer all the data into batches -
add
Add a gameObject to this renderer -
remove
Remove a gameObject from this renderer -
prepare
protected void prepare()Prepare for rendering. Do anything like setting background here.
-