I'm trying to draw a colored square in ORTHO mode, but for some reason it's always white.
Anything wrong with the code below ?
public class ColoredSquare extends Quad {
public ColoredSquare(String name,float width,float height,ColorRGBA color) {
super(name,width,height);
DisplaySystem display = DisplaySystem.getDisplaySystem();
TextureState ts = display.getRenderer().createTextureState();
this.setRenderQueueMode(Renderer.QUEUE_ORTHO);
ts.setEnabled(false);
this.setRenderState(ts);
AlphaState as = display.getRenderer().createAlphaState();
as.setBlendEnabled( false );
this.setRenderState(as);
LightState ls = display.getRenderer().createLightState();
ls.setEnabled(false);
this.setRenderState(ls);
MaterialState ms = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();
ms.setDiffuse(color);
ms.setAmbient(color);
ms.setEmissive(color);
this.setRenderState(ms);
this.setLightCombineMode(LightState.OFF);
this.updateRenderState();
}
}