Re: blank screen by shader render
Posted by
slava_jazz on
Mar 27, 2012; 8:39am
URL: https://forum.jogamp.org/blank-screen-by-shader-render-tp3848071p3860697.html
sorry for delay, I just back from business trip.
actually my load code is:
private static int[] uploadData(final GL2 _gl2, final float[] _vertexes, final short[] _indices)
{
int h[] = new int[]{-1, -1};
_gl2.glGenBuffers(2, h, 0);
if (h[0] != -1 && h[1] != -1)
{
_gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, h[0]);
_gl2.glBufferData(GL.GL_ARRAY_BUFFER, _vertexes.length * 4, FloatBuffer.wrap(_vertexes), GL.GL_STATIC_DRAW);
checkGLError(_gl2, "glBufferData");
_gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, h[1]);
_gl2.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, _indices.length * 2, ShortBuffer.wrap(_indices), GL.GL_STATIC_DRAW);
checkGLError(_gl2, "glBufferData");
}
else
{
h = null;
}
return h;
}