gpt4 book ai didi

com.google.gwt.webgl.client.WebGLRenderingContext.texSubImage2D()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 09:01:05 24 4
gpt4 key购买 nike

本文整理了Java中com.google.gwt.webgl.client.WebGLRenderingContext.texSubImage2D()方法的一些代码示例,展示了WebGLRenderingContext.texSubImage2D()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebGLRenderingContext.texSubImage2D()方法的具体详情如下:
包路径:com.google.gwt.webgl.client.WebGLRenderingContext
类名称:WebGLRenderingContext
方法名:texSubImage2D

WebGLRenderingContext.texSubImage2D介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type,
               Buffer pixels) {
  if (pixels.limit() > 1) {
    HasArrayBufferView arrayHolder = (HasArrayBufferView) pixels;
    ArrayBufferView webGLArray = arrayHolder.getTypedArray();
    ArrayBufferView buffer;
    if (pixels instanceof FloatBuffer) {
      buffer = webGLArray;
    } else {
      int remainingBytes = pixels.remaining() * 4;
      int byteOffset = webGLArray.byteOffset() + pixels.position() * 4;
      buffer = Uint8ArrayNative.create(webGLArray.buffer(), byteOffset, remainingBytes);
    }
    gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, buffer);
  } else {
    Pixmap pixmap = Pixmap.pixmaps.get(((IntBuffer) pixels).get(0));
    gl.texSubImage2D(target, level, xoffset, yoffset, format, type, pixmap.getCanvasElement());
  }
}

代码示例来源:origin: libgdx/libgdx

@Override
public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type,
               Buffer pixels) {
  if (pixels.limit() > 1) {
    HasArrayBufferView arrayHolder = (HasArrayBufferView) pixels;
    ArrayBufferView webGLArray = arrayHolder.getTypedArray();
    ArrayBufferView buffer;
    if (pixels instanceof FloatBuffer) {
      buffer = webGLArray;
    } else {
      int remainingBytes = pixels.remaining() * 4;
      int byteOffset = webGLArray.byteOffset() + pixels.position() * 4;
      buffer = Uint8ArrayNative.create(webGLArray.buffer(), byteOffset, remainingBytes);
    }
    gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, buffer);
  } else {
    Pixmap pixmap = Pixmap.pixmaps.get(((IntBuffer) pixels).get(0));
    gl.texSubImage2D(target, level, xoffset, yoffset, format, type, pixmap.getCanvasElement());
  }
}

代码示例来源:origin: threerings/playn

@Override
public void texSubImage2D(Image image, int target, int level, int xOffset, int yOffset, int format,
             int type) {
 // we can do this more efficiently by passing the image element right to WebGL
 glc.texSubImage2D(target, level, xOffset, yOffset, format, type, ((HtmlImage) image).img);
}

代码示例来源:origin: threerings/playn

@Override
public void glTexSubImage2D(int target, int level, int xoffset, int yoffset,
              int width, int height, int format, int type, Buffer pixels) {
 gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
          getTypedArray(pixels, type, -1));
}

代码示例来源:origin: playn/playn

@Override
public void glTexSubImage2D(int target, int level, int xoffset, int yoffset,
                   int width, int height, int format, int type, Buffer pixels) {
 gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
     getTypedArray(pixels, type, -1));
}

代码示例来源:origin: io.playn/playn-html

@Override
public void glTexSubImage2D(int target, int level, int xoffset, int yoffset,
                   int width, int height, int format, int type, Buffer pixels) {
 gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
     getTypedArray(pixels, type, -1));
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt

@Override
public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type,
               Buffer pixels) {
  if (pixels.limit() > 1) {
    HasArrayBufferView arrayHolder = (HasArrayBufferView) pixels;
    ArrayBufferView webGLArray = arrayHolder.getTypedArray();
    ArrayBufferView buffer;
    if (pixels instanceof FloatBuffer) {
      buffer = webGLArray;
    } else {
      int remainingBytes = pixels.remaining() * 4;
      int byteOffset = webGLArray.byteOffset() + pixels.position() * 4;
      buffer = Uint8ArrayNative.create(webGLArray.buffer(), byteOffset, remainingBytes);
    }
    gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, buffer);
  } else {
    Pixmap pixmap = Pixmap.pixmaps.get(((IntBuffer) pixels).get(0));
    gl.texSubImage2D(target, level, xoffset, yoffset, format, type, pixmap.getCanvasElement());
  }
}

代码示例来源:origin: thothbot/parallax

@Override
public void glTexSubImage2D (int target, int level, int xoffset, int yoffset, int width, int height, int format, int type,
  Buffer pixels) {
  if (pixels.limit() > 1) {
    HasArrayBufferView arrayHolder = (HasArrayBufferView) pixels;
    ArrayBufferView webGLArray = arrayHolder.getTypedArray();
    int remainingBytes = pixels.remaining() * 4;
    int byteOffset = webGLArray.byteOffset() + pixels.position() * 4;
    Uint8Array buffer = Uint8ArrayNative.create(webGLArray.buffer(), byteOffset, remainingBytes);
    gl.texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, buffer);
  }
}

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com