Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some way to get current rendering state. #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/com/base/engine/rendering/RenderingEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

public class RenderingEngine extends MappedValues
{
private int renderState;
private HashMap<String, Integer> samplerMap;
private ArrayList<BaseLight> lights;
private BaseLight activeLight;
Expand Down Expand Up @@ -54,6 +55,8 @@ public void updateUniformStruct(Transform transform, Material material, Shader s

public void render(GameObject object)
{
renderState = 0;
activeLight = null; // <-- if getActiveLight returns null - we in not lightning rendering state.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

object.renderAll(forwardAmbient, this);
Expand All @@ -65,6 +68,7 @@ public void render(GameObject object)

for(BaseLight light : lights)
{
renderState++;
activeLight = light;
object.renderAll(light.getShader(), this);
}
Expand Down Expand Up @@ -108,4 +112,8 @@ public void setMainCamera(Camera mainCamera)
{
this.mainCamera = mainCamera;
}

public int getRenderState() {
return renderState;
}
}