本文整理匯總了Java中org.lwjgl.opengl.GL14類的典型用法代碼示例。如果您正苦於以下問題:Java GL14類的具體用法?Java GL14怎麽用?Java GL14使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GL14類屬於org.lwjgl.opengl包,在下文中一共展示了GL14類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: glBlendFunc
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void glBlendFunc(int sFactorRGB, int dFactorRGB, int sfactorAlpha, int dfactorAlpha)
{
if (openGL14)
{
if (extBlendFuncSeparate)
{
EXTBlendFuncSeparate.glBlendFuncSeparateEXT(sFactorRGB, dFactorRGB, sfactorAlpha, dfactorAlpha);
}
else
{
GL14.glBlendFuncSeparate(sFactorRGB, dFactorRGB, sfactorAlpha, dfactorAlpha);
}
}
else
{
GL11.glBlendFunc(sFactorRGB, dFactorRGB);
}
}
示例2: allocateTextureImpl
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void allocateTextureImpl(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_)
{
deleteTexture(p_180600_0_);
bindTexture(p_180600_0_);
if (p_180600_1_ >= 0)
{
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_180600_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_180600_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F);
}
for (int i = 0; i <= p_180600_1_; ++i)
{
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i, GL11.GL_RGBA, p_180600_2_ >> i, p_180600_3_ >> i, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)((IntBuffer)null));
}
}
示例3: getInternalTextureFormat
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
private static int getInternalTextureFormat(Bitmap.Format format)
{
switch (format)
{
case GRAYSCALE:
return GL11.GL_LUMINANCE;
case GRAYSCALEALPHA:
return GL11.GL_LUMINANCE_ALPHA;
case RGB: return GL21.GL_SRGB;
case RGBA: return GL21.GL_SRGB_ALPHA;
case DEPTH:
return GL14.GL_DEPTH_COMPONENT16;
default:
throw new UnsupportedOperationException("Unrecognized bitmap format!");
}
}
示例4: renderParticle
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
@Override
public void renderParticle(Tessellator t, float par2, float par3, float par4, float par5, float par6, float par7)
{
Minecraft.getMinecraft().renderEngine.bindTexture(RivalRebels.etflameball);
GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL14.glBlendEquation(GL14.GL_FUNC_ADD);
float f10 = 0.03F * particleScale;
float f11 = (float) (prevPosX + (posX - prevPosX) * par2 - interpPosX);
float f12 = (float) (prevPosY + (posY - prevPosY) * par2 - interpPosY);
float f13 = (float) (prevPosZ + (posZ - prevPosZ) * par2 - interpPosZ);
t.setColorRGBA_F(1, 1, 1, 1);
float X = (sequence % 4) / 4f;
float Y = (sequence - (sequence % 4)) / 16f;
t.addVertexWithUV(f11 - par3 * f10 - par6 * f10, f12 - par4 * f10, f13 - par5 * f10 - par7 * f10, X + 0.25f, Y + 0.25f);
t.addVertexWithUV(f11 - par3 * f10 + par6 * f10, f12 + par4 * f10, f13 - par5 * f10 + par7 * f10, X + 0.25f, Y);
t.addVertexWithUV(f11 + par3 * f10 + par6 * f10, f12 + par4 * f10, f13 + par5 * f10 + par7 * f10, X, Y);
t.addVertexWithUV(f11 + par3 * f10 - par6 * f10, f12 - par4 * f10, f13 + par5 * f10 - par7 * f10, X, Y + 0.25f);
}
示例5: OpenGlState
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
private OpenGlState() {
this.enableBlend = isSet(GL11.GL_BLEND);
this.blendSource = getInteger(GL11.GL_BLEND_SRC);
this.blendDest = getInteger(GL11.GL_BLEND_DST);
this.blendEquation = getInteger(GL14.GL_BLEND_EQUATION);
this.enableAlphaTest = isSet(GL11.GL_ALPHA_TEST);
this.alphaTestFunc = getInteger(GL11.GL_ALPHA_TEST_FUNC);
this.alphaTestRef = getFloat(GL11.GL_ALPHA_TEST_REF);
this.depthTest = isSet(GL11.GL_DEPTH_TEST);
this.depthFunc = getInteger(GL11.GL_DEPTH_FUNC);
this.lighting = isSet(GL11.GL_LIGHTING);
this.depthMask = isSet(GL11.GL_DEPTH_WRITEMASK);
this.normal = isSet(GL11.GL_NORMALIZE);
this.rescaleNormal = isSet(GL12.GL_RESCALE_NORMAL);
GlStateManager.pushMatrix();
}
示例6: clearFBOLayer
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
/**
* Initialize layer FBO to receive GL primitives from a set of identical
* symbolizers
*
* @param primitive
* @param opacity
* @param currentSymbolizer
* @throws GLException
*/
private void clearFBOLayer() throws GLException {
GLTools.glCheckError("preparing next FBO Layer");
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, this.getLayerViewPanel().getGLCanvas().getFboId());
GL11.glDrawBuffer(GL30.GL_COLOR_ATTACHMENT0);
GLTools.glCheckError("bind frame buffer");
// Blending mode in FBO drawing.
GLTools.glCheckError("finalizing FBO initialization");
GL11.glClearColor(0f, 0f, 0f, 0f);
GLTools.glCheckError("finalizing FBO initialization");
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
GLTools.glCheckError("finalizing FBO initialization");
glEnable(GL11.GL_BLEND);
GLTools.glCheckError("finalizing FBO initialization");
GL20.glBlendEquationSeparate(GL14.GL_FUNC_ADD, GL14.GL_MAX);
GLTools.glCheckError("finalizing FBO initialization");
GL14.glBlendFuncSeparate(GL11.GL_ONE, GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_ZERO);
GL30.glBindFramebuffer(GL30.GL_DRAW_FRAMEBUFFER, 0);
GLTools.glCheckError("finalizing FBO initialization");
}
示例7: loadTextureMipmap
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void loadTextureMipmap(int tex, int[] rgb, int width, int height) {
IntBuffer rgbBuf = BufferUtils.createIntBuffer(rgb.length);
rgbBuf.put(rgb);
rgbBuf.flip();
bind(tex);
//If OpenGL30, use glGenerateMipmap, else use the GL_GENERATE_MIPMAP tex param
if (RenderUtil.GL_30) {
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, width, height,
0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, rgbBuf);
GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
} else {
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_GENERATE_MIPMAP, GL11.GL_TRUE);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, width, height,
0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, rgbBuf);
}
}
示例8: allocateFrameBuffer
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
private void allocateFrameBuffer() {
if (this.framebuffer != 0) return;
this.framebuffer = EXTFramebufferObject.glGenFramebuffersEXT(); //Release via: EXTFramebufferObject.glDeleteFramebuffersEXT(framebuffer);
this.depthBuffer = EXTFramebufferObject.glGenRenderbuffersEXT(); //Release via: EXTFramebufferObject.glDeleteRenderbuffersEXT(depthBuffer);
EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, this.framebuffer);
EXTFramebufferObject.glBindRenderbufferEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer);
if (MinecraftForgeClient.getStencilBits() == 0) EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, GL14.GL_DEPTH_COMPONENT24, width, height);
else EXTFramebufferObject.glRenderbufferStorageEXT(EXTFramebufferObject.GL_RENDERBUFFER_EXT, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, width, height);
EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer);
if (MinecraftForgeClient.getStencilBits() != 0) EXTFramebufferObject.glFramebufferRenderbufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, EXTFramebufferObject.GL_RENDERBUFFER_EXT, depthBuffer);
this.texture = GL11.glGenTextures(); //Release via: GL11.glDeleteTextures(colorTexture);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.texture);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, width, height, 0, GL11.GL_RGBA, GL11.GL_INT, (java.nio.ByteBuffer) null);
EXTFramebufferObject.glFramebufferTexture2DEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, EXTFramebufferObject.GL_COLOR_ATTACHMENT0_EXT, GL11.GL_TEXTURE_2D, this.texture, 0);
EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, 0);
}
示例9: loadTexture
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public int loadTexture(String fileName) {
Texture texture = null;
try {
texture = TextureLoader.getTexture("PNG",
new FileInputStream(MainGameLoop.fileManager.getTextureFile(fileName)));
GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0);
if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic) {
float amount = Math.min(4f,
GL11.glGetFloat(EXTTextureFilterAnisotropic.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT));
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
amount);
} else {
System.out.println("Filter Anisotropic Not Supported");
}
} catch (Exception e) {
e.printStackTrace();
System.err.println("Tried to load texture " + fileName + ".png , didn't work");
System.exit(-1);
}
textures.add(texture.getTextureID());
return texture.getTextureID();
}
示例10: func_147946_a
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void func_147946_a(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_, float p_147946_4_)
{
deleteTexture(p_147946_0_);
bindTexture(p_147946_0_);
if (OpenGlHelper.anisotropicFilteringSupported)
{
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_147946_4_);
}
if (p_147946_1_ > 0)
{
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_147946_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_147946_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F);
}
for (int var5 = 0; var5 <= p_147946_1_; ++var5)
{
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, var5, GL11.GL_RGBA, p_147946_2_ >> var5, p_147946_3_ >> var5, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null);
}
}
示例11: initGradient
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
/**
* Reads the first row of the slider gradient texture and upload it as
* a 1D texture to OpenGL if it hasn't already been done.
*/
public void initGradient() {
if (gradientTexture == 0) {
Image slider = GameImage.SLIDER_GRADIENT.getImage().getScaledCopy(1.0f / GameImage.getUIscale());
staticState.gradientTexture = GL11.glGenTextures();
ByteBuffer buff = BufferUtils.createByteBuffer(slider.getWidth() * 4);
for (int i = 0; i < slider.getWidth(); ++i) {
Color col = slider.getColor(i, 0);
buff.put((byte) (255 * col.r));
buff.put((byte) (255 * col.g));
buff.put((byte) (255 * col.b));
buff.put((byte) (255 * col.a));
}
buff.flip();
GL11.glBindTexture(GL11.GL_TEXTURE_1D, gradientTexture);
GL11.glTexImage1D(GL11.GL_TEXTURE_1D, 0, GL11.GL_RGBA, slider.getWidth(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buff);
ContextCapabilities capabilities = GLContext.getCapabilities();
if (capabilities.OpenGL30) {
GL30.glGenerateMipmap(GL11.GL_TEXTURE_1D);
} else if (capabilities.GL_EXT_framebuffer_object) {
EXTFramebufferObject.glGenerateMipmapEXT(GL11.GL_TEXTURE_1D);
} else {
GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL14.GL_GENERATE_MIPMAP, GL11.GL_TRUE);
}
}
}
示例12: glBlendFunc
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void glBlendFunc(int p_148821_0_, int p_148821_1_, int p_148821_2_, int p_148821_3_)
{
if (openGL14)
{
if (field_153211_u)
{
EXTBlendFuncSeparate.glBlendFuncSeparateEXT(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_);
}
else
{
GL14.glBlendFuncSeparate(p_148821_0_, p_148821_1_, p_148821_2_, p_148821_3_);
}
}
else
{
GL11.glBlendFunc(p_148821_0_, p_148821_1_);
}
}
示例13: allocateTextureImpl
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void allocateTextureImpl(int p_147946_0_, int p_147946_1_, int p_147946_2_, int p_147946_3_, float p_147946_4_)
{
deleteTexture(p_147946_0_);
bindTexture(p_147946_0_);
if (OpenGlHelper.anisotropicFilteringSupported)
{
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, p_147946_4_);
}
if (p_147946_1_ > 0)
{
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_147946_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_147946_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F);
}
for (int i1 = 0; i1 <= p_147946_1_; ++i1)
{
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i1, GL11.GL_RGBA, p_147946_2_ >> i1, p_147946_3_ >> i1, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null);
}
}
示例14: func_148109_a
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public void func_148109_a()
{
if (!this.equals(field_148118_a))
{
if (field_148118_a == null || this.field_148119_h != field_148118_a.func_148111_b())
{
field_148118_a = this;
if (this.field_148119_h)
{
GlStateManager.disableBlend();
return;
}
GlStateManager.enableBlend();
}
GL14.glBlendEquation(this.field_148112_f);
if (this.field_148113_g)
{
GlStateManager.tryBlendFuncSeparate(this.field_148116_b, this.field_148114_d, this.field_148117_c, this.field_148115_e);
}
else
{
GlStateManager.blendFunc(this.field_148116_b, this.field_148114_d);
}
}
}
示例15: allocateTextureImpl
import org.lwjgl.opengl.GL14; //導入依賴的package包/類
public static void allocateTextureImpl(int p_180600_0_, int p_180600_1_, int p_180600_2_, int p_180600_3_)
{
Object object = TextureUtil.class;
if (Reflector.SplashScreen.exists())
{
object = Reflector.SplashScreen.getTargetClass();
}
synchronized (object)
{
deleteTexture(p_180600_0_);
bindTexture(p_180600_0_);
}
if (p_180600_1_ >= 0)
{
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, p_180600_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, (float)p_180600_1_);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0F);
}
for (int i = 0; i <= p_180600_1_; ++i)
{
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, i, GL11.GL_RGBA, p_180600_2_ >> i, p_180600_3_ >> i, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)((IntBuffer)null));
}
}