@Override protected void enableArrays( RenderContext glRenderContext, DirectGeometryBuffer geomBuffer ) { super.enableArrays( glRenderContext, geomBuffer ); if ( texturePosition >= 0 && textureBuffer == null && geomBuffer != null ) { textureBuffer = geomBuffer.getTextureCoordinates( texturePosition, textureOrdinatesCount ); if ( textureBuffer == null ) { texturePosition = -1; } } if ( textureBuffer != null ) { glRenderContext.getContext().glEnable( GL.GL_TEXTURE_2D ); TexturePool.loadTexture( glRenderContext, texture ); glRenderContext.getContext().glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY ); glRenderContext.getContext().glTexCoordPointer( 2, GL.GL_FLOAT, 0, textureBuffer ); } }
public void renderPrepared( RenderContext glRenderContext, DirectGeometryBuffer geomBuffer ) { enableArrays( glRenderContext, geomBuffer ); GL context = glRenderContext.getContext(); normalBuffer.rewind(); context.glPushAttrib( GL.GL_CURRENT_BIT | GL.GL_LIGHTING_BIT ); // context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT, ambientColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_DIFFUSE, diffuseColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_SPECULAR, specularColor, 0 ); context.glMaterialfv( GL.GL_FRONT_AND_BACK, GL.GL_EMISSION, emmisiveColor, 0 ); context.glMaterialf( GL.GL_FRONT_AND_BACK, GL.GL_SHININESS, style.getShininess() ); context.glDrawArrays( openGLType, 0, vertexCount ); context.glPopAttrib(); disableArrays( glRenderContext ); }