diff --git a/src/org/atriasoft/gale/context/GaleContext.java b/src/org/atriasoft/gale/context/GaleContext.java index 92bfad8..aaba8a2 100644 --- a/src/org/atriasoft/gale/context/GaleContext.java +++ b/src/org/atriasoft/gale/context/GaleContext.java @@ -22,7 +22,7 @@ import org.atriasoft.gale.key.KeyType; import org.atriasoft.gale.resource.ResourceManager; interface ActionToDoInAsyncLoop { - public void run(GaleContext context); + void run(GaleContext context); } enum ApplicationState { @@ -658,7 +658,7 @@ public abstract class GaleContext { // // internal clean elements // //this.objectManager.cleanInternalRemoved(); // this.resourceManager.cleanInternalRemoved(); - // + // // Log.info("List of all widget of this context must be equal at 0 ==> otherwise some remove is missing"); // //this.objectManager.displayListObject(); // // Resource is an lower element as objects ... diff --git a/src/org/atriasoft/gale/resource/ResourceColored3DObject.java b/src/org/atriasoft/gale/resource/ResourceColored3DObject.java index 40368cf..f75a039 100644 --- a/src/org/atriasoft/gale/resource/ResourceColored3DObject.java +++ b/src/org/atriasoft/gale/resource/ResourceColored3DObject.java @@ -27,7 +27,6 @@ public class ResourceColored3DObject extends Resource { private int oGLMatrixView; protected ResourceColored3DObject() { - super(); // get the shader resource : this.oGLPosition = 0; this.program = ResourceProgram.create(new Uri("DATA", "simple3D.vert", "gale"), new Uri("DATA", "simple3D.frag", "gale")); @@ -86,13 +85,13 @@ public class ResourceColored3DObject extends Resource { if (color.a() < 1.0f) { OpenGL.enable(OpenGL.Flag.flag_blend); } - // Request the draw of the elements: + // Request the draw of the elements: OpenGL.drawArrays(OpenGL.RenderMode.TRIANGLE, 0, vertices.size()); if (color.a() < 1.0f) { OpenGL.disable(OpenGL.Flag.flag_blend); } this.program.unUse(); - // Request the draw od the elements: + // Request the draw od the elements: //glDrawArrays(oGLLINES, 0, vertices.size()); //this.oGLprogram.UnUse(); if (depthtest) { @@ -134,7 +133,7 @@ public class ResourceColored3DObject extends Resource { if (color.a() < 1.0f) { OpenGL.enable(OpenGL.Flag.flag_blend); } - // Request the draw of the elements: + // Request the draw of the elements: OpenGL.drawArrays(OpenGL.RenderMode.TRIANGLE, 0, vertices.size()); if (color.a() < 1.0f) { OpenGL.disable(OpenGL.Flag.flag_blend); @@ -424,7 +423,7 @@ public class ResourceColored3DObject extends Resource { if (color.a() < 1.0f) { OpenGL.enable(OpenGL.Flag.flag_blend); } - // Request the draw od the elements: + // Request the draw od the elements: OpenGL.drawArrays(OpenGL.RenderMode.LINE, 0, vertices.size()); if (color.a() < 1.0f) { OpenGL.disable(OpenGL.Flag.flag_blend); @@ -492,6 +491,15 @@ public class ResourceColored3DObject extends Resource { draw(tmpVertices, tmpColor, transformationMatrix, true, true); } + public void drawTriangle(final Vector3f p1, final Vector3f p2, final Vector3f p3, final Matrix4f transformationMatrix, final Color tmpColor) { + final List tmpVertices = new ArrayList<>(); + tmpVertices.add(p1); + tmpVertices.add(p2); + tmpVertices.add(p3); + //Log.info("display " << tmpVertices.size() << " vertices form " << indice.size()); + draw(tmpVertices, tmpColor, transformationMatrix, true, true); + } + public void drawTriangles(final List vertex, final List indice, final Matrix4f transformationMatrix, final Color tmpColor) { drawTriangles(vertex, indice, transformationMatrix, tmpColor, new Vector3f(0.0f, 0.0f, 0.1f)); }