Package gaiasky.render.system
Class ImmediateModeRenderSystem
java.lang.Object
gaiasky.render.system.AbstractRenderSystem
gaiasky.render.system.ImmediateModeRenderSystem
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IRenderSystem
- Direct Known Subclasses:
InstancedRenderSystem
,LineRenderSystem
,ParticleEffectsRenderSystem
,PointCloudRenderSystem
,PointRenderSystem
,StarGroupPointRenderSystem
,StarPointRenderSystem
,VariableGroupPointRenderSystem
,VertGPURenderSystem
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
Nested classes/interfaces inherited from class gaiasky.render.system.AbstractRenderSystem
AbstractRenderSystem.RenderSystemRunnable
-
Field Summary
Modifier and TypeFieldDescriptionprotected ImmediateModeRenderSystem.MeshData
protected Set<IRenderable>
protected com.badlogic.gdx.utils.Array<ImmediateModeRenderSystem.MeshData>
protected int
protected int[]
protected float[]
Fields inherited from class gaiasky.render.system.AbstractRenderSystem
alphas, aux, auxd, comp, postRunnables, preRunnables, programs, rc
-
Constructor Summary
ModifierConstructorDescriptionprotected
ImmediateModeRenderSystem
(SceneGraphRenderer.RenderGroup rg, float[] alphas, ExtShaderProgram[] programs) protected
ImmediateModeRenderSystem
(SceneGraphRenderer.RenderGroup rg, float[] alphas, ExtShaderProgram[] programs, int tempVertsSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearMeshData
(int i) Clears the mesh data at the index ivoid
void
color
(double r, double g, double b, double a) void
color
(float colorBits) void
color
(float r, float g, float b, float a) void
color
(com.badlogic.gdx.graphics.Color color) protected int
Creates a new mesh data object and adds it to the first available index in the meshes arrayvoid
dispose()
protected void
ensureTempIndicesSize
(int size) This function makes sure that the tempIndices array has at least the given size.protected void
ensureTempVertsSize
(int size) This function makes sure that the tempVerts array has at least the given size.protected int
getCount
(IRenderable renderable) protected int
getOffset
(IRenderable renderable) protected boolean
inGpu
(IRenderable renderable) protected abstract void
protected abstract void
protected void
setCount
(IRenderable renderable, int count) protected void
setInGpu
(IRenderable renderable, boolean state) protected void
setOffset
(IRenderable renderable, int offset) void
vertex
(float x, float y, float z) Methods inherited from class gaiasky.render.system.AbstractRenderSystem
addDepthBufferUniforms, addEffectsUniforms, addGravWaveUniforms, addPostRunnables, addPreRunnables, addPreviousFrameUniforms, addRelativisticUniforms, addVRScale, getAlpha, getAlpha, getRenderGroup, getShaderProgram, render, renderStud, resize, run, updateBatchSize
-
Field Details
-
meshIdx
protected int meshIdx -
meshes
-
curr
-
tempVerts
protected float[] tempVerts -
tempIndices
protected int[] tempIndices -
inGpu
-
-
Constructor Details
-
ImmediateModeRenderSystem
protected ImmediateModeRenderSystem(SceneGraphRenderer.RenderGroup rg, float[] alphas, ExtShaderProgram[] programs) -
ImmediateModeRenderSystem
protected ImmediateModeRenderSystem(SceneGraphRenderer.RenderGroup rg, float[] alphas, ExtShaderProgram[] programs, int tempVertsSize)
-
-
Method Details
-
createMeshData
protected int createMeshData()Creates a new mesh data object and adds it to the first available index in the meshes array- Returns:
- The index of the new mesh data in meshes
-
clearMeshes
public void clearMeshes() -
clearMeshData
public void clearMeshData(int i) Clears the mesh data at the index i- Parameters:
i
- The index of the mesh data to remove
-
initShaderProgram
protected abstract void initShaderProgram() -
initVertices
protected abstract void initVertices() -
inGpu
-
setInGpu
-
setOffset
-
getOffset
-
setCount
-
getCount
-
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
- Overrides:
dispose
in classAbstractRenderSystem
-
ensureTempVertsSize
protected void ensureTempVertsSize(int size) This function makes sure that the tempVerts array has at least the given size. After calling this function, the elements of tempVerts may have been cleared.- Parameters:
size
- The size to ensure
-
ensureTempIndicesSize
protected void ensureTempIndicesSize(int size) This function makes sure that the tempIndices array has at least the given size. After calling this function, the elements of tempIndices may have been cleared.- Parameters:
size
- The size to ensure
-
color
public void color(com.badlogic.gdx.graphics.Color color) -
color
public void color(float r, float g, float b, float a) -
color
public void color(double r, double g, double b, double a) -
color
public void color(float colorBits) -
vertex
public void vertex(float x, float y, float z)
-