當前位置: 首頁>>代碼示例>>Java>>正文


Java GL2.glTexParameteri方法代碼示例

本文整理匯總了Java中javax.media.opengl.GL2.glTexParameteri方法的典型用法代碼示例。如果您正苦於以下問題:Java GL2.glTexParameteri方法的具體用法?Java GL2.glTexParameteri怎麽用?Java GL2.glTexParameteri使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.media.opengl.GL2的用法示例。


在下文中一共展示了GL2.glTexParameteri方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialize

import javax.media.opengl.GL2; //導入方法依賴的package包/類
@SuppressWarnings("static-access")
protected void initialize(GL2 gl2) {
    if (initialized_context_ == gl2) {
        return;
    }

    initialized_context_ = gl2;

    if (!gl2.getContext().isHardwareRasterizer()) {
        // Workaround for Windows Remote Desktop which requires pot textures.
        CefApp.getLogger().info("opengl rendering may be slow as hardware rendering isn't available");
        use_draw_pixels_ = true;
        return;
    }

    gl2.glHint(gl2.GL_POLYGON_SMOOTH_HINT, gl2.GL_NICEST);

    gl2.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

    // Necessary for non-power-of-2 textures to render correctly.
    gl2.glPixelStorei(gl2.GL_UNPACK_ALIGNMENT, 1);

    // Create the texture.
    gl2.glGenTextures(1, texture_id_, 0);
    assert (texture_id_[0] != 0);

    gl2.glBindTexture(gl2.GL_TEXTURE_2D, texture_id_[0]);
    gl2.glTexParameteri(gl2.GL_TEXTURE_2D, gl2.GL_TEXTURE_MIN_FILTER, gl2.GL_NEAREST);
    gl2.glTexParameteri(gl2.GL_TEXTURE_2D, gl2.GL_TEXTURE_MAG_FILTER, gl2.GL_NEAREST);
    gl2.glTexEnvf(gl2.GL_TEXTURE_ENV, gl2.GL_TEXTURE_ENV_MODE, gl2.GL_MODULATE);
}
 
開發者ID:Panda-Programming-Language,項目名稱:Pandomium,代碼行數:32,代碼來源:CefRenderer.java

示例2: initialize

import javax.media.opengl.GL2; //導入方法依賴的package包/類
@SuppressWarnings("static-access")
protected void initialize(GL2 gl2) {
  if (initialized_context_ == gl2)
    return;

  initialized_context_ = gl2;

  if (!gl2.getContext().isHardwareRasterizer()) {
    // Workaround for Windows Remote Desktop which requires pot textures.
    System.out.println("opengl rendering may be slow as hardware rendering isn't available");
    use_draw_pixels_ = true;
    return;
  }

  gl2.glHint(gl2.GL_POLYGON_SMOOTH_HINT, gl2.GL_NICEST);

  gl2.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

  // Necessary for non-power-of-2 textures to render correctly.
  gl2.glPixelStorei(gl2.GL_UNPACK_ALIGNMENT, 1);

  // Create the texture.
  gl2.glGenTextures(1, texture_id_, 0);
  assert(texture_id_[0] != 0);

  gl2.glBindTexture(gl2.GL_TEXTURE_2D, texture_id_[0]);
  gl2.glTexParameteri(gl2.GL_TEXTURE_2D, gl2.GL_TEXTURE_MIN_FILTER, gl2.GL_NEAREST);
  gl2.glTexParameteri(gl2.GL_TEXTURE_2D, gl2.GL_TEXTURE_MAG_FILTER, gl2.GL_NEAREST);
  gl2.glTexEnvf(gl2.GL_TEXTURE_ENV, gl2.GL_TEXTURE_ENV_MODE, gl2.GL_MODULATE);
}
 
開發者ID:viglucci,項目名稱:app-jcef-example,代碼行數:31,代碼來源:CefRenderer.java


注:本文中的javax.media.opengl.GL2.glTexParameteri方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。