Package java.nio

Examples of java.nio.IntBuffer


  }

  private Object createBlankCursor() throws LWJGLException {
    int width = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CXCURSOR);
    int height = WindowsDisplay.getSystemMetrics(WindowsDisplay.SM_CYCURSOR);
    IntBuffer pixels = BufferUtils.createIntBuffer(width*height);
    return WindowsDisplay.doCreateCursor(width, height, 0, 0, 1, pixels, null);
  }
View Full Code Here


  @Override
  public Dimension getInfoMapSize(String fileName, String name) {

    Dimension dimension = null;

    IntBuffer width = IntBuffer.allocate(1);
    IntBuffer height = IntBuffer.allocate(1);
    int ret = UnitsyncLibrary.GetInfoMapSize(fileName, name, width, height);
    if (ret != 0) {
      dimension = new Dimension(width.get(), width.get());
    }
View Full Code Here

   * @return The created cursor
   * @throws IOException Indicates a failure to load the image
   * @throws LWJGLException Indicates a failure to create the hardware cursor
   */
  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

   *
   * @return The maximum size of the textures supported by the underlying
   * hardware.
   */
  public static final int getMaxSingleImageSize() {
    IntBuffer buffer = BufferUtils.createIntBuffer(16);
    GL.glGetInteger(SGL.GL_MAX_TEXTURE_SIZE, buffer);
   
    return buffer.get(0);
  }
View Full Code Here

     *
     * @return A new texture ID
     */
    public static int createTextureID()
    {
       IntBuffer tmp = createIntBuffer(1);
       GL11.glGenTextures(tmp);
       return tmp.get(0);
    }
View Full Code Here

      texture.setTextureHeight(imageData.getTexHeight());

        texWidth = texture.getTextureWidth();
        texHeight = texture.getTextureHeight();

        IntBuffer temp = BufferUtils.createIntBuffer(16);
        GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE, temp);
        int max = temp.get(0);
        if ((texWidth > max) || (texHeight > max)) {
          throw new IOException("Attempt to allocate a texture to big for the current hardware");
        }
       
        int srcPixelFormat = hasAlpha ? GL11.GL_RGBA : GL11.GL_RGB;
View Full Code Here

       
        texture.setWidth(width);
        texture.setHeight(height);
        texture.setAlpha(hasAlpha);
       
        IntBuffer temp = BufferUtils.createIntBuffer(16);
        GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE, temp);
        int max = temp.get(0);
        if ((texWidth > max) || (texHeight > max)) {
          throw new IOException("Attempt to allocate a texture to big for the current hardware");
        }
       
        GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, minFilter);
View Full Code Here

  private void showNativeCursor(boolean show) {
    if (!show) {
      try {
        int w = org.lwjgl.input.Cursor.getMinCursorSize();
        IntBuffer cursorImages;
        cursorImages = ByteBuffer.allocateDirect(w * w * 4).order(
            ByteOrder.nativeOrder()).asIntBuffer();

        org.lwjgl.input.Cursor cur = new org.lwjgl.input.Cursor(w, w,
            0, 0, 1, cursorImages, null);
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

    final ExecutorService executorService = Executors.newFixedThreadPool(THREADS);
    final ExecutorCompletionService<Long> completionService = new ExecutorCompletionService<Long>(executorService);

    try {
      // We need to use a NIO buffer in order to guarantee memory alignment.
      final IntBuffer memory = getMemory(MAX_SIZE);

      // -- WARMUP --

      final int WARMUP = 10;
      for ( int i = 0; i < WARMUP; i++ )
View Full Code Here

TOP

Related Classes of java.nio.IntBuffer

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.