Package java.nio

Examples of java.nio.IntBuffer.flip()


    this.gl.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, renderedTexture, 0);
    
    // Set the list of draw buffers.
    IntBuffer drbuf = IntBuffer.allocate(1);
    drbuf.put(GL_COLOR_ATTACHMENT0);
    drbuf.flip();
    this.gl.glDrawBuffers(1, drbuf); // "1" is the size of DrawBuffers
   
    if(this.gl.glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
      throw new IllegalStateException("The internal state of the setup framebuffer seems to be corrupted");
   
View Full Code Here


        int width = image.getWidth();
        int height = image.getHeight();
        int[] texels = image.getRGB(0, 0, width, height, null, 0, width);
        IntBuffer buffer = BufferUtils.createIntBuffer(texels.length);
        buffer.put(texels);
        buffer.flip();
        int textureID = GL11.glGenTextures();
        GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
        GL11.glTexImage2D(GL11.GL_TEXTURE_2D,
                0,
                GL11.GL_RGBA,
View Full Code Here

  public void destroy() {
    super.destroy();

    IntBuffer buffer = BufferUtils.createIntBuffer(1);
    buffer.put(FBO);
    buffer.flip();
   
    EXTFramebufferObject.glDeleteFramebuffersEXT(buffer);
    valid = false;
  }
View Full Code Here

   * @see org.newdawn.slick.opengl.Texture#release()
   */
    public void release() {
        IntBuffer texBuf = createIntBuffer(1);
        texBuf.put(textureID);
        texBuf.flip();
       
      GL.glDeleteTextures(texBuf);
     
        if (lastBind == this) {
          bindNone();
View Full Code Here

  public Cursor getAnimatedCursor(String ref,int x,int y, int width, int height, int[] cursorDelays) throws IOException, LWJGLException {
    IntBuffer cursorDelaysBuffer = ByteBuffer.allocateDirect(cursorDelays.length*4).order(ByteOrder.nativeOrder()).asIntBuffer();
    for (int i=0;i<cursorDelays.length;i++) {
      cursorDelaysBuffer.put(cursorDelays[i]);
    }
    cursorDelaysBuffer.flip();

    LoadableImageData imageData = new TGAImageData();
    ByteBuffer buf = imageData.loadImage(ResourceLoader.getResourceAsStream(ref), false, null);
         
    return new Cursor(width, height, x, y, cursorDelays.length, buf.asIntBuffer(), cursorDelaysBuffer);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.