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


Java GL14類代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:OpenGlHelper.java

示例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));
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:TextureUtil.java

示例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!");
	}
}
 
開發者ID:andykuo1,項目名稱:candlelight,代碼行數:17,代碼來源:Texture.java

示例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);
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:20,代碼來源:EntityDocileFlameFX.java

示例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();
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:21,代碼來源:OpenGlState.java

示例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");
}
 
開發者ID:IGNF,項目名稱:geoxygene,代碼行數:32,代碼來源:LwjglLayerRenderer.java

示例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);
    }
}
 
開發者ID:unknownloner,項目名稱:HeroMod,代碼行數:19,代碼來源:TextureUtil.java

示例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);
}
 
開發者ID:XCompWiz,項目名稱:LookingGlass,代碼行數:24,代碼來源:FrameBufferContainer.java

示例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();
}
 
開發者ID:Radseq,項目名稱:Mystic-Bastion,代碼行數:25,代碼來源:Loader.java

示例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);
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:24,代碼來源:TextureUtil.java

示例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);
		}
	}
}
 
開發者ID:itdelatrisu,項目名稱:opsu,代碼行數:30,代碼來源:CurveRenderState.java

示例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_);
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:19,代碼來源:OpenGlHelper.java

示例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);
    }
}
 
開發者ID:xtrafrancyz,項目名稱:Cauldron,代碼行數:24,代碼來源:TextureUtil.java

示例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);
        }
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:30,代碼來源:JsonBlendingMode.java

示例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));
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:29,代碼來源:TextureUtil.java


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