Package java.nio

Examples of java.nio.IntBuffer.clear()


        assertContentEquals(buf, duplicate);

        // duplicate's position, mark, and limit should be independent to buf
        duplicate.reset();
        assertEquals(duplicate.position(), 0);
        duplicate.clear();
        assertEquals(buf.position(), buf.limit());
        buf.reset();
        assertEquals(buf.position(), 0);

        // duplicate share the same content with buf
View Full Code Here


        } catch (NullPointerException e) {
            // expected
        }

        loadTestData2(other);
        other.clear();
        buf.clear();
        IntBuffer ret = buf.put(other);
        assertEquals(other.position(), other.capacity());
        assertEquals(buf.position(), buf.capacity());
        assertContentEquals(other, buf);
View Full Code Here

        fileName = outputName + ".png";
      else
        fileName = outputName + (pageIndex + 1) + ".png";

      page.getTexture().bind();
      buffer.clear();
      GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL11.GL_UNSIGNED_BYTE, buffer);
      WritableRaster raster = pageImage.getRaster();
      for (int y = 0; y < height; y++) {
        buffer.get(row);
        raster.setDataElements(0, y, width, 1, row);
View Full Code Here

      //server.publishFrameTexture(intBuff.get(0), GL11.GL_TEXTURE_2D, 0, 0, dims.get(2), dims.get(3), dims.get(2), dims.get(3), false);
      server.publishFrameTexture(intBuff.get(0), target, 0, 0, 800, 600, 800, 600, false);
     
      GL11.glDeleteTextures(intBuff.get(0));

      intBuff.clear();
      intBuff.rewind();


      // Always call this so LWJGL can swap buffers, etc.
      Display.update();
View Full Code Here

      imgPosY = 0;
      for(int y = top; y < bottom + this.height; y += this.height) {
        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
        mc.entityRenderer.setupOverlayRendering();
        drawForSreenShot(y, x);
        pixels.clear();
        GL11.glReadPixels(0, 0, useWidth, useHeight, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
        pixels.get(intArray);
        mirror(intArray, useWidth, useHeight);
        bufferedimage.setRGB(imgPosX, imgPosY, Math.min(useWidth, bufferedimage.getWidth() - imgPosX), Math.min(useHeight, bufferedimage.getHeight() - imgPosY), intArray, 0, useWidth);
        imgPosY += useHeight;
View Full Code Here

    useMipmap = useMipmap && RenderSettings.HasMipmap;
    IntBuffer textureIDBuffer = BufferUtils.createIntBuffer(1);
    GL11.glGenTextures(textureIDBuffer);
    textureId = textureIDBuffer.get(0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
    textureIDBuffer.clear();
   
   
    byte[] data = bitmap.exportRAW();
    ByteBuffer imageBuffer = ByteBuffer.allocateDirect(data.length);
    imageBuffer.order(ByteOrder.nativeOrder());
View Full Code Here

    IntBuffer handle = BufferUtils.newIntBuffer(1);
    gl.glGenFramebuffers(1, handle);
    framebufferHandle = handle.get(0);

    if (hasDepth) {
      handle.clear();
      gl.glGenRenderbuffers(1, handle);
      depthbufferHandle = handle.get(0);
    }

    gl.glBindTexture(GL20.GL_TEXTURE_2D, colorTexture.getTextureObjectHandle());
View Full Code Here

    gl.glBindFramebuffer(GL20.GL_FRAMEBUFFER, defaultFramebufferHandle);

    if (result != GL20.GL_FRAMEBUFFER_COMPLETE) {
      colorTexture.dispose();
      if (hasDepth) {
        handle.clear();
        handle.put(depthbufferHandle);
        handle.flip();
        gl.glDeleteRenderbuffers(1, handle);
      }
View Full Code Here

        handle.put(depthbufferHandle);
        handle.flip();
        gl.glDeleteRenderbuffers(1, handle);
      }

      handle.clear();
      handle.put(framebufferHandle);
      handle.flip();
      gl.glDeleteFramebuffers(1, handle);

      if (result == GL20.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT)
View Full Code Here

      handle.put(depthbufferHandle);
      handle.flip();
      gl.glDeleteRenderbuffers(1, handle);
    }

    handle.clear();
    handle.put(framebufferHandle);
    handle.flip();
    gl.glDeleteFramebuffers(1, handle);

    if (buffers.get(Gdx.app) != null) buffers.get(Gdx.app).removeValue(this, true);
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.