@Override public void build() { program = new GLProgram(); program.quickCreateResource("Diag", "cs4620/util/Diag.vert", "cs4620/util/Diag.frag", null); fxsi = new ShaderInterface( new ArrayBind[] { new ArrayBind(Semantic.Position, GLType.Float, 3, 0), new ArrayBind(Semantic.TexCoord, GLType.Float, 2, 3 * 4) }); fxsi.build(program.semanticLinks); vb = new GLBuffer(BufferTarget.ArrayBuffer, BufferUsageHint.StaticDraw, true); vb.setAsVertex(5 * 4); FloatBuffer vBuf = NativeMem.createFloatBuffer(4 * 5); vBuf.put( new float[] { -0.5f, 0.5f, 0, 0, 1, 0.5f, 0.5f, 0, 1, 1, -0.5f, -0.5f, 0, 0, 0, 0.5f, -0.5f, 0, 1, 0 }); vBuf.flip(); vb.setDataInitial(vBuf); ib = new GLBuffer(BufferTarget.ElementArrayBuffer, BufferUsageHint.StaticDraw, true); ib.setAsIndexInt(); IntBuffer iBuf = NativeMem.createIntBuffer(6); iBuf.put(new int[] {0, 2, 1, 1, 2, 3}); iBuf.flip(); ib.setDataInitial(iBuf); texture = new GLTexture(TextureTarget.Texture2D, true); texture.internalFormat = PixelInternalFormat.Rgba; try { texture.setImage2DResource("cs4620/util/Diag.png", false); } catch (Exception e) { System.out.println("NO IMAGE\r\n" + e.getMessage()); } }