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


Java GL2.glTexEnvf方法代碼示例

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


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

示例1: endDrawIcons

import javax.media.opengl.GL2; //導入方法依賴的package包/類
protected void endDrawIcons(DrawContext dc)
{
	if (dc.isPickingMode())
		this.pickSupport.endPicking(dc);

       GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

       if (dc.isPickingMode())
       {
           gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, OGLUtil.DEFAULT_TEX_ENV_MODE);
           gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, OGLUtil.DEFAULT_SRC0_RGB);
           gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, OGLUtil.DEFAULT_COMBINE_RGB);
       }

	gl.glBindTexture(GL.GL_TEXTURE_2D, 0);

	this.oglStackHandler.pop(gl);
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:19,代碼來源:DetailedIconRenderer.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.
        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

示例3: 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

示例4: beginDrawIcons

import javax.media.opengl.GL2; //導入方法依賴的package包/類
@Override
protected void beginDrawIcons(DrawContext dc) {
  GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

	this.oglStackHandler.clear();

	int attributeMask =
		GL.GL_DEPTH_BUFFER_BIT // for depth test, depth mask and depth func
			| GL2.GL_TRANSFORM_BIT // for modelview and perspective
			| GL2.GL_VIEWPORT_BIT // for depth range
			| GL2.GL_CURRENT_BIT // for current color
			| GL.GL_COLOR_BUFFER_BIT // for alpha test func and ref, and blend
			| GL2.GL_TEXTURE_BIT // for texture env
			| GL.GL_DEPTH_BUFFER_BIT // for depth func
			| GL2.GL_ENABLE_BIT; // for enable/disable changes
	this.oglStackHandler.pushAttrib(gl, attributeMask);

	// Apply the depth buffer but don't change it.
	if ((!dc.isDeepPickingEnabled())) {
		gl.glEnable(GL.GL_DEPTH_TEST);
	}
	gl.glDepthMask(false);

	// Suppress any fully transparent image pixels
	gl.glEnable(GL2.GL_ALPHA_TEST);
	gl.glAlphaFunc(GL.GL_GREATER, 0.001f);

	// Load a parallel projection with dimensions (viewportWidth, viewportHeight)
	this.oglStackHandler.pushProjectionIdentity(gl);
	gl.glOrtho(0d, dc.getView().getViewport().width, 0d, dc.getView().getViewport().height, -16d, 16d);

	this.oglStackHandler.pushModelview(gl);
	this.oglStackHandler.pushTexture(gl);

	if (dc.isPickingMode())
	{
		this.pickSupport.beginPicking(dc);

		// Set up to replace the non-transparent texture colors with the single pick color.
		gl.glEnable(GL.GL_TEXTURE_2D);
		gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_COMBINE);
		gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_PREVIOUS);
		gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_REPLACE);
	}
	else
	{
		gl.glEnable(GL.GL_TEXTURE_2D);
		gl.glEnable(GL.GL_BLEND);
		gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
	}

	//Only calculate pitch / heading once **
	heading = this.computeHeading(dc.getView());
	pitch = this.computePitch(dc.getView());
}
 
開發者ID:iedadata,項目名稱:geomapapp,代碼行數:56,代碼來源:DetailedIconRenderer.java


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