Java Code Examples for com.badlogic.gdx.graphics.GL20#GL_TRIANGLE_STRIP
The following examples show how to use
com.badlogic.gdx.graphics.GL20#GL_TRIANGLE_STRIP .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MG3dModelLoader.java From Mundus with Apache License 2.0 | 6 votes |
private int parseType(String type) { if (type.equals("TRIANGLES")) { return GL20.GL_TRIANGLES; } else if (type.equals("LINES")) { return GL20.GL_LINES; } else if (type.equals("POINTS")) { return GL20.GL_POINTS; } else if (type.equals("TRIANGLE_STRIP")) { return GL20.GL_TRIANGLE_STRIP; } else if (type.equals("LINE_STRIP")) { return GL20.GL_LINE_STRIP; } else { throw new GdxRuntimeException("Unknown primitive type '" + type + "', should be one of triangle, trianglestrip, line, linestrip, lineloop or point"); } }
Example 2
Source File: HeadlessG3dModelLoader.java From gdx-proto with Apache License 2.0 | 6 votes |
private int parseType (String type) { if (type.equals("TRIANGLES")) { return GL20.GL_TRIANGLES; } else if (type.equals("LINES")) { return GL20.GL_LINES; } else if (type.equals("POINTS")) { return GL20.GL_POINTS; } else if (type.equals("TRIANGLE_STRIP")) { return GL20.GL_TRIANGLE_STRIP; } else if (type.equals("LINE_STRIP")) { return GL20.GL_LINE_STRIP; } else { throw new GdxRuntimeException("Unknown primitive type '" + type + "', should be one of triangle, trianglestrip, line, linestrip, lineloop or point"); } }
Example 3
Source File: GdxRenderer.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 6 votes |
/*********************************************************************\ |* Render Calls *| \*********************************************************************/ public int convertElementMode(Mode mode) { switch (mode) { case Points: return GL20.GL_POINTS; case Lines: return GL20.GL_LINES; case LineLoop: return GL20.GL_LINE_LOOP; case LineStrip: return GL20.GL_LINE_STRIP; case Triangles: return GL20.GL_TRIANGLES; case TriangleFan: return GL20.GL_TRIANGLE_FAN; case TriangleStrip: return GL20.GL_TRIANGLE_STRIP; default: throw new UnsupportedOperationException("Unrecognized mesh mode: " + mode); } }
Example 4
Source File: GLTFTypes.java From gdx-gltf with Apache License 2.0 | 5 votes |
/** https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#primitivemode */ public static int mapPrimitiveMode(Integer glMode){ if(glMode == null) return GL20.GL_TRIANGLES; // TODO not sure switch (glMode) { case 0: return GL20.GL_POINTS; case 1: return GL20.GL_LINES; case 2: return GL20.GL_LINE_LOOP; case 3: return GL20.GL_LINE_STRIP; case 4: return GL20.GL_TRIANGLES; case 5: return GL20.GL_TRIANGLE_STRIP; case 6: return GL20.GL_TRIANGLE_FAN; } throw new GdxRuntimeException("unsupported mode " + glMode); }
Example 5
Source File: GLTFMeshExporter.java From gdx-gltf with Apache License 2.0 | 5 votes |
public static Integer mapPrimitiveMode(int type){ switch(type){ case GL20.GL_POINTS: return 0; case GL20.GL_LINES: return 1; case GL20.GL_LINE_LOOP: return 2; case GL20.GL_LINE_STRIP: return 3; case GL20.GL_TRIANGLES: return null; // default not need to be set case GL20.GL_TRIANGLE_STRIP: return 5; case GL20.GL_TRIANGLE_FAN: return 6; } throw new GdxRuntimeException("unsupported primitive type " + type); }