-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
228b73c
commit 499b9d0
Showing
29 changed files
with
300 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/java/com/marginallyclever/makelangelo/MeshFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.marginallyclever.makelangelo; | ||
|
||
import com.jogamp.opengl.GL3; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* A factory for creating and maintaining Mesh objects. | ||
*/ | ||
public class MeshFactory { | ||
private static final Logger logger = LoggerFactory.getLogger(MeshFactory.class); | ||
|
||
// the pool of all mesh loaded | ||
private static final List<Mesh> meshPool = new ArrayList<>(); | ||
|
||
/** | ||
* Create a new mesh and add it to the pool. This should be the only way to create a mesh. | ||
* @return a new mesh | ||
*/ | ||
public static Mesh createMesh() { | ||
Mesh m = new Mesh(); | ||
addMesh(m); | ||
return m; | ||
} | ||
|
||
public static void addMesh(Mesh mesh) { | ||
if(meshPool.contains(mesh)) return; | ||
meshPool.add(mesh); | ||
} | ||
|
||
public static void removeMesh(Mesh mesh) { | ||
meshPool.remove(mesh); | ||
} | ||
|
||
public static void unloadAll(GL3 gl) { | ||
for(Mesh m : meshPool) { | ||
m.unload(gl); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/com/marginallyclever/makelangelo/apps/previewpanel/RenderContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.marginallyclever.makelangelo.apps.previewpanel; | ||
|
||
import com.jogamp.opengl.GL3; | ||
|
||
public class RenderContext { | ||
public GL3 gl; | ||
public ShaderProgram shader; | ||
|
||
public RenderContext(GL3 gl, ShaderProgram shader) { | ||
this.gl = gl; | ||
this.shader = shader; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
...va/com/marginallyclever/makelangelo/apps/previewpanel/plotterrenderer/Makelangelo3_3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.