本文整理汇总了Java中com.jogamp.opengl.GL4.glCreateTextures方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glCreateTextures方法的具体用法?Java GL4.glCreateTextures怎么用?Java GL4.glCreateTextures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL4
的用法示例。
在下文中一共展示了GL4.glCreateTextures方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
boolean validated = true;
Vec2i windowSizeF = new Vec2i(windowSize).shiftR(framebufferScale);
textureName.position(Texture.COLORBUFFER);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureStorage2D(textureName.get(Texture.COLORBUFFER), 1, GL_RGBA8, windowSizeF.x, windowSizeF.y);
textureName.position(Texture.RENDERBUFFER);
gl4.glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.RENDERBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.RENDERBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2DMultisample(textureName.get(Texture.RENDERBUFFER), 4, GL_RGBA8, windowSizeF.x,
windowSizeF.y, true);
textureName.rewind();
return validated;
}
示例2: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
assert (!texture.empty());
Vec2u framebufferSize = new Vec2u(windowSize).div(16);
gl4.glCreateTextures(GL_TEXTURE_2D_ARRAY, Texture.MAX, textureName);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureStorage3D(textureName.get(0), 1, GL_RGBA8, framebufferSize.x, framebufferSize.y, 1);
} catch (IOException ex) {
Logger.getLogger(Gl_500_conservative_raster_nv.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
}
示例3: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
boolean validated = true;
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl4.glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, textureName);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_R, GL_RED);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_G, GL_GREEN);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_B, GL_BLUE);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl4.glTextureStorage3D(textureName.get(0), texture.levels(),
format.internal.value,
texture.dimensions(0)[0], texture.dimensions(0)[1], 1);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage3D(textureName.get(0), level,
0, 0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1], 1,
format.external.value, format.type.value,
texture.data(level));
}
} catch (IOException ex) {
Logger.getLogger(Gl_500_buffer_sparse_arb.class.getName()).log(Level.SEVERE, null, ex);
}
return validated;
}
示例4: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
assert (!texture.empty());
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_R, GL_RED);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_G, GL_GREEN);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_B, GL_BLUE);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
gl4.glTextureStorage2D(textureName.get(0), texture.levels(), format.internal.value, texture.dimensions()[0],
texture.dimensions()[1]);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage2D(textureName.get(0), level,
0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1],
format.external.value, format.type.value,
texture.data(level));
}
} catch (IOException ex) {
Logger.getLogger(Gl_500_primitive_bindless_nv.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
}
示例5: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
gl4.glCreateTextures(GL_TEXTURE_2D, Texture.MAX, textureName);
Vec2i framebufferSize = new Vec2i(windowSize).mul(FRAMEBUFFER_SCALE);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
gl4.glTextureStorage2D(textureName.get(Texture.COLORBUFFER), 1, GL_RGBA8, framebufferSize.x,
framebufferSize.y);
gl4.glTextureParameteri(textureName.get(Texture.RENDERBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.RENDERBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2D(textureName.get(Texture.RENDERBUFFER), 1, GL_DEPTH_COMPONENT24, framebufferSize.x,
framebufferSize.y);
gl4.glTextureParameteri(textureName.get(Texture.INVOCATION_COUNT), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.INVOCATION_COUNT), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2D(textureName.get(Texture.INVOCATION_COUNT), 1, GL_R32UI, framebufferSize.x,
framebufferSize.y);
return true;
}
示例6: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
jgli.Gl.Swizzles swizzles = jgli.Gl.translate(texture.swizzles());
textureName.position(Texture.TEXTURE);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_SWIZZLE_R, swizzles.r.value);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_SWIZZLE_G, swizzles.g.value);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_SWIZZLE_B, swizzles.b.value);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_SWIZZLE_A, swizzles.a.value);
gl4.glTextureStorage2D(textureName.get(Texture.TEXTURE), texture.levels(), format.internal.value,
texture.dimensions(0)[0], texture.dimensions(0)[1]);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage2D(textureName.get(Texture.TEXTURE),
level,
0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1],
format.external.value, format.type.value,
texture.data(level));
}
textureName.position(Texture.MULTISAMPLE);
gl4.glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2DMultisample(textureName.get(Texture.MULTISAMPLE), 4, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y, false);
textureName.position(Texture.COLORBUFFER);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2D(textureName.get(Texture.COLORBUFFER), 1, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y);
textureName.rewind();
} catch (IOException ex) {
Logger.getLogger(Gl_430_direct_state_access_ext.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
}
示例7: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
if (texture.empty()) {
return false;
}
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
textureName.position(Texture.TEXTURE);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureStorage2D(textureName.get(Texture.TEXTURE), texture.levels(), format.internal.value,
texture.dimensions(0)[0], texture.dimensions(0)[1]);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage2D(textureName.get(Texture.TEXTURE), level,
0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1],
format.external.value, format.type.value,
texture.data(level));
}
} catch (IOException ex) {
Logger.getLogger(Gl_450_direct_state_access.class.getName()).log(Level.SEVERE, null, ex);
}
textureName.position(Texture.MULTISAMPLE);
gl4.glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2DMultisample(textureName.get(Texture.MULTISAMPLE), 4, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y, false);
textureName.position(Texture.COLORBUFFER);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2D(textureName.get(Texture.COLORBUFFER), 1, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y);
textureName.rewind();
return true;
}
示例8: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
if (texture.empty()) {
return false;
}
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
textureName.position(Texture.TEXTURE);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MIN_FILTER, GL_NEAREST);
gl4.glTextureParameteri(textureName.get(Texture.TEXTURE), GL_TEXTURE_MAG_FILTER, GL_NEAREST);
gl4.glTextureStorage2D(textureName.get(Texture.TEXTURE), texture.levels(), format.internal.value,
texture.dimensions(0)[0], texture.dimensions(0)[1]);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage2D(textureName.get(Texture.TEXTURE), level,
0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1],
format.external.value, format.type.value,
texture.data(level));
}
textureName.position(Texture.MULTISAMPLE);
gl4.glCreateTextures(GL_TEXTURE_2D_MULTISAMPLE, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.MULTISAMPLE), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2DMultisample(textureName.get(Texture.MULTISAMPLE), 4, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y, false);
textureName.position(Texture.COLORBUFFER);
gl4.glCreateTextures(GL_TEXTURE_2D, 1, textureName);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(Texture.COLORBUFFER), GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTextureStorage2D(textureName.get(Texture.COLORBUFFER), 1, GL_RGBA8, FRAMEBUFFER_SIZE.x,
FRAMEBUFFER_SIZE.y);
textureName.rewind();
} catch (IOException ex) {
Logger.getLogger(Gl_500_direct_state_access_gtc.class.getName()).log(Level.SEVERE, null, ex);
}
return true;
}
示例9: initTexture
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initTexture(GL4 gl4) {
boolean validated = true;
try {
jgli.Texture2d texture = new Texture2d(jgli.Load.load(TEXTURE_ROOT + "/" + TEXTURE_DIFFUSE));
assert (!texture.empty());
jgli.Gl.Format format = jgli.Gl.translate(texture.format());
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
gl4.glCreateTextures(GL_TEXTURE_2D_ARRAY, 1, textureName);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_R, GL_RED);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_G, GL_GREEN);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_B, GL_BLUE);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_SWIZZLE_A, GL_ALPHA);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAX_LEVEL, texture.levels() - 1);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
gl4.glTextureParameteri(textureName.get(0), GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl4.glTextureStorage3D(textureName.get(0), texture.levels(), format.internal.value,
texture.dimensions()[0], texture.dimensions()[0], 1);
for (int level = 0; level < texture.levels(); ++level) {
gl4.glTextureSubImage3D(textureName.get(0), level,
0, 0, 0,
texture.dimensions(level)[0], texture.dimensions(level)[1], 1,
format.external.value, format.type.value,
texture.data(level));
}
gl4.glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
// Query the texture handle and make the texture resident
textureHandle.put(0, gl4.glGetTextureHandleARB(textureName.get(0)));
gl4.glMakeTextureHandleResidentARB(textureHandle.get(0));
} catch (IOException ex) {
Logger.getLogger(Gl_500_texture_bindless_nv.class.getName()).log(Level.SEVERE, null, ex);
}
return validated;
}