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