@@ -2969,6 +2969,7 @@ public void keyTyped(com.jogamp.newt.event.KeyEvent e) {
29692969 public static final int VERTEX_ATTRIB_ARRAY_STRIDE = GL2 .GL_VERTEX_ATTRIB_ARRAY_STRIDE ;
29702970 public static final int VERTEX_ATTRIB_ARRAY_TYPE = GL2 .GL_VERTEX_ATTRIB_ARRAY_TYPE ;
29712971 public static final int VERTEX_ATTRIB_ARRAY_NORMALIZED = GL2 .GL_VERTEX_ATTRIB_ARRAY_NORMALIZED ;
2972+ public static final int VERTEX_ATTRIB_ARRAY_POINTER = GL2 .GL_VERTEX_ATTRIB_ARRAY_POINTER ;
29722973
29732974 public static final int BLEND = GL .GL_BLEND ;
29742975 public static final int ONE = GL .GL_ONE ;
@@ -3226,15 +3227,11 @@ public void viewport(int x, int y, int w, int h) {
32263227 // Reading Pixels
32273228
32283229 public void readPixels (int x , int y , int width , int height , int format , int type , Buffer buffer ) {
3229- boolean needBeginOp = format != STENCIL_INDEX &&
3230- format != DEPTH_COMPONENT && format != DEPTH_STENCIL ;
3231- if (needBeginOp ) {
3232- PGraphicsOpenGL .pgCurrent .beginPixelsOp (PGraphicsOpenGL .OP_READ );
3233- }
3230+ boolean needEndBegin = format != STENCIL_INDEX &&
3231+ format != DEPTH_COMPONENT && format != DEPTH_STENCIL ;
3232+ if (needEndBegin ) pg .beginReadPixels ();
32343233 readPixelsImpl (x , y , width , height , format , type , buffer );
3235- if (needBeginOp ) {
3236- PGraphicsOpenGL .pgCurrent .endPixelsOp ();
3237- }
3234+ if (needEndBegin ) pg .endReadPixels ();
32383235 }
32393236
32403237 protected void readPixelsImpl (int x , int y , int width , int height , int format , int type , Buffer buffer ) {
@@ -3477,13 +3474,14 @@ public void deleteProgram(int program) {
34773474 gl2 .glDeleteProgram (program );
34783475 }
34793476
3480- public void getActiveAttrib (int program , int index , int [] size , int [] type , String [] name ) {
3477+ public String glGetActiveAttrib (int program , int index , IntBuffer size , IntBuffer type ) {
34813478 int [] tmp = {0 , 0 , 0 };
34823479 byte [] namebuf = new byte [1024 ];
34833480 gl2 .glGetActiveAttrib (program , index , 1024 , tmp , 0 , tmp , 1 , tmp , 2 , namebuf , 0 );
3484- if (size != null && size .length != 0 ) size [0 ] = tmp [1 ];
3485- if (type != null && type .length != 0 ) type [0 ] = tmp [2 ];
3486- if (name != null && name .length != 0 ) name [0 ] = new String (namebuf , 0 , tmp [0 ]);
3481+ size .put (tmp [1 ]);
3482+ type .put (tmp [2 ]);
3483+ String name = new String (namebuf , 0 , tmp [0 ]);
3484+ return name ;
34873485 }
34883486
34893487 public int getAttribLocation (int program , String name ) {
@@ -3498,13 +3496,14 @@ public int getUniformLocation(int program, String name) {
34983496 return gl2 .glGetUniformLocation (program , name );
34993497 }
35003498
3501- public void getActiveUniform (int program , int index , int [] size ,int [] type , String [] name ) {
3499+ public String getActiveUniform (int program , int index , IntBuffer size , IntBuffer type ) {
35023500 int [] tmp = {0 , 0 , 0 };
35033501 byte [] namebuf = new byte [1024 ];
35043502 gl2 .glGetActiveUniform (program , index , 1024 , tmp , 0 , tmp , 1 , tmp , 2 , namebuf , 0 );
3505- if (size != null && size .length != 0 ) size [0 ] = tmp [1 ];
3506- if (type != null && type .length != 0 ) type [0 ] = tmp [2 ];
3507- if (name != null && name .length != 0 ) name [0 ] = new String (namebuf , 0 , tmp [0 ]);
3503+ size .put (tmp [1 ]);
3504+ type .put (tmp [2 ]);
3505+ String name = new String (namebuf , 0 , tmp [0 ]);
3506+ return name ;
35083507 }
35093508
35103509 public void uniform1i (int location , int value ) {
@@ -3628,7 +3627,7 @@ public void getVertexAttribiv(int index, int pname, IntBuffer params) {
36283627 gl2 .glGetVertexAttribiv (index , pname , params );
36293628 }
36303629
3631- public void getVertexAttribPointerv () {
3630+ public void getVertexAttribPointerv (int index , int pname , ByteBuffer data ) {
36323631 throw new RuntimeException (String .format (MISSING_GLFUNC_ERROR , "glGetVertexAttribPointerv()" ));
36333632 }
36343633
0 commit comments