Package javax.media.opengl

Examples of javax.media.opengl.GLException


    unbind();
  }
 
  public float[] getData() {
    if (isDisposed()) {
      throw new GLException();
    }
   
    return Arrays.copyOf(data, data.length);
  }
View Full Code Here


    if (value.length == 0) {
      throw new IllegalArgumentException();
    }
   
    if (isDisposed()) {
      throw new GLException();
    }
   
    FloatBuffer buffer = GLBuffers.newDirectFloatBuffer(value);
    int fs = Float.SIZE / Byte.SIZE;
    glInvoke("glBufferData",
View Full Code Here

    data = Arrays.copyOf(value, value.length);
  }
 
  public void bind() {
    if (isDisposed()) {
      throw new GLException();
    }
   
    glInvoke("glBindBuffer",
      int.class, GL3.GL_ARRAY_BUFFER,
      int.class, getId()
View Full Code Here

    );
  }
 
  public void unbind() {
    if (isDisposed()) {
      throw new GLException();
    }
   
    glInvoke("glBindBuffer",
      int.class, GL3.GL_ARRAY_BUFFER,
      int.class, 0
View Full Code Here

                final int error = glu.gluScaleImage(pixFormat, actualWidth, actualHeight, pixDataType,
                        image.getData(0), w, h, pixDataType, scaledImage);
                if (error != 0) {
                    final int errorCode = gl.glGetError();
                    if (errorCode != GL.GL_NO_ERROR) {
                        throw new GLException(glu.gluErrorString(errorCode));
                    }
                }

                image.setWidth(w);
                image.setHeight(h);
View Full Code Here

    private int getLocation(GL3 gl, String attributeName) {
        Integer index = attributes.get(attributeName);
        if (index == null) {
            index = gl.glGetUniformLocation(shader.program(), attributeName);
            if (index < 0)
                throw new GLException("Attribute " + attributeName + " not found");
            attributes.put(attributeName, index);
        }
        return index;
    }
View Full Code Here

                break;
            case 4:
                gl.glUniform4iv(location, elements, buffer);
                break;
            default:
                throw new GLException("glUniform vector only available for 1iv 2iv, 3iv and 4iv");
        }
    }
View Full Code Here

                break;
            case 4:
                gl.glUniform4fv(location, elements, buffer);
                break;
            default:
                throw new GLException("glUniform vector only available for 1fv 2fv, 3fv and 4fv");
        }
    }
View Full Code Here

                break;
            case 4:
                gl.glUniformMatrix4fv(location, elements, false, buffer);
                break;
            default:
                throw new GLException("glUniformMatrix only available for 2fv, 3fv and 4fv");
        }
    }
View Full Code Here

    private int getLocation(GL3 gl, String attributeName) {
        Integer index = attributes.get(attributeName);
        if (index == null) {
            index = gl.glGetAttribLocation(shader.program(), attributeName);
            if (index < 0)
                throw new GLException("Attribute " + attributeName + " not found");
            attributes.put(attributeName, index);
        }
        return index;
    }
View Full Code Here

TOP

Related Classes of javax.media.opengl.GLException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.