Re: superbible sample code ported to JOGL, yet not working
Posted by
jmaasing on
Feb 27, 2015; 9:16am
URL: https://forum.jogamp.org/superbible-sample-code-ported-to-JOGL-yet-not-working-tp4034070p4034074.html
Check the documentation for glDrawArrays:
https://www.opengl.org/sdk/docs/man/html/glDrawArrays.xhtml"When glDrawArrays is called, it uses count sequential elements from each enabled array to construct a sequence of geometric primitives"
So you need to set up and enable vertex arrays, I don't see that in your code. Since the vertex shader has some vertices hard-coded I guess there might be some simplification in the example but that is not the usual way to draw elements.
It is all explained in the arcsynthesis tutorial. Sample 1.2 here :
http://www.arcsynthesis.org/gltut/Basics/Tut01%20Following%20the%20Data.htmlI don't know how to explain it better, there are explicit lines of code in the tutorial for glBufferData and glEnableVertexAttribArray