当前位置: 首页>>代码示例>>Java>>正文


Java GL11.glTexParameterf方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.GL11.glTexParameterf方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glTexParameterf方法的具体用法?Java GL11.glTexParameterf怎么用?Java GL11.glTexParameterf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.GL11的用法示例。


在下文中一共展示了GL11.glTexParameterf方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: allocateTextureImpl

import org.lwjgl.opengl.GL11; //导入方法依赖的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

示例2: setFramebufferFilter

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void setFramebufferFilter(int p_147607_1_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        this.framebufferFilter = p_147607_1_;
        GlStateManager.bindTexture(this.framebufferTexture);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, (float)p_147607_1_);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, (float)p_147607_1_);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
        GlStateManager.bindTexture(0);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:14,代码来源:Framebuffer.java

示例3: applyAnisotropicLevel

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void applyAnisotropicLevel()
{
    if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic)
    {
        float f = GL11.glGetFloat(34047);
        float f1 = (float)Config.getAnisotropicFilterLevel();
        f1 = Math.min(f1, f);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, f1);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:TextureUtils.java

示例4: allocateTextureImpl

import org.lwjgl.opengl.GL11; //导入方法依赖的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

示例5: loadTexture

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static Texture loadTexture(String textureFile) {
		try {
//			InputStream in = TextureLoader.class.getResourceAsStream("/" + textureFile);
			InputStream in = Util.loadInternal(textureFile);
			BufferedImage image = ImageIO.read(in);
			
			int[] pixels = new int[image.getWidth() * image.getHeight()];
			image.getRGB(0, 0, image.getWidth(), image.getHeight(), pixels, 0, image.getWidth());
			ByteBuffer buffer = ByteBuffer.allocateDirect(image.getWidth() * image.getHeight() * 4);
			
			for(int h = 0; h < image.getHeight(); h++) {
				for(int w = 0; w < image.getWidth(); w++) {
					int pixel = pixels[h * image.getWidth() + w];
					
					buffer.put((byte) ((pixel >> 16) & 0xFF));
					buffer.put((byte) ((pixel >> 8) & 0xFF));
					buffer.put((byte) (pixel & 0xFF));
					buffer.put((byte) ((pixel >> 24) & 0xFF));
				}
			}
			
			buffer.flip();
			in.close();
			
			int textureID = GL11.glGenTextures();
			GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
			GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, image.getWidth(), image.getHeight(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
			
			GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
			GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_NEAREST);
			GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_MAX_TEXTURE_LOD_BIAS, -1);
			GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
			
			return new Texture(textureID, image.getWidth(), image.getHeight());
		} catch (Exception e) {
			e.printStackTrace();
			
			return null;
		}
	}
 
开发者ID:ComunityEngine,项目名称:CommunityEngine-Java,代码行数:41,代码来源:TextureLoader.java

示例6: loadTextureToOpenGL

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected static int loadTextureToOpenGL(TextureData data, TextureBuilder builder) {
	int texID = GL11.glGenTextures();
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, texID);
	GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
	GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, data.getWidth(), data.getHeight(), 0, GL12.GL_BGRA,
			GL11.GL_UNSIGNED_BYTE, data.getBuffer());
	if (builder.isMipmap()) {
		GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
		if (builder.isAnisotropic() && GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic) {
			GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0);
			GL11.glTexParameterf(GL11.GL_TEXTURE_2D, EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
					4.0f);
		}
	} else if (builder.isNearest()) {
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
	} else {
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
	}
	if (builder.isClampEdges()) {
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);
	} else {
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
		GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
	}
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
	return texID;
}
 
开发者ID:TheThinMatrix,项目名称:OpenGL-Animation,代码行数:34,代码来源:TextureUtils.java

示例7: func_152922_k

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void func_152922_k()
{
    if (this.broadcastController.isBroadcasting() && !this.broadcastController.isBroadcastPaused())
    {
        long i = System.nanoTime();
        long j = (long)(1000000000 / this.targetFPS);
        long k = i - this.field_152959_k;
        boolean flag = k >= j;

        if (flag)
        {
            FrameBuffer framebuffer = this.broadcastController.func_152822_N();
            Framebuffer framebuffer1 = this.mc.getFramebuffer();
            this.framebuffer.bindFramebuffer(true);
            GlStateManager.matrixMode(5889);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.ortho(0.0D, (double)this.framebuffer.framebufferWidth, (double)this.framebuffer.framebufferHeight, 0.0D, 1000.0D, 3000.0D);
            GlStateManager.matrixMode(5888);
            GlStateManager.pushMatrix();
            GlStateManager.loadIdentity();
            GlStateManager.translate(0.0F, 0.0F, -2000.0F);
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
            GlStateManager.viewport(0, 0, this.framebuffer.framebufferWidth, this.framebuffer.framebufferHeight);
            GlStateManager.enableTexture2D();
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            float f = (float)this.framebuffer.framebufferWidth;
            float f1 = (float)this.framebuffer.framebufferHeight;
            float f2 = (float)framebuffer1.framebufferWidth / (float)framebuffer1.framebufferTextureWidth;
            float f3 = (float)framebuffer1.framebufferHeight / (float)framebuffer1.framebufferTextureHeight;
            framebuffer1.bindFramebufferTexture();
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, 9729.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, 9729.0F);
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
            worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, (double)f3).endVertex();
            worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, (double)f3).endVertex();
            worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, 0.0D).endVertex();
            worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
            tessellator.draw();
            framebuffer1.unbindFramebufferTexture();
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5889);
            GlStateManager.popMatrix();
            GlStateManager.matrixMode(5888);
            this.broadcastController.captureFramebuffer(framebuffer);
            this.framebuffer.unbindFramebuffer();
            this.broadcastController.submitStreamFrame(framebuffer);
            this.field_152959_k = i;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:55,代码来源:TwitchStream.java

示例8: setupShadowFrameBuffer

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void setupShadowFrameBuffer()
{
    if (usedShadowDepthBuffers != 0)
    {
        if (sfb != 0)
        {
            EXTFramebufferObject.glDeleteFramebuffersEXT(sfb);
            GlStateManager.deleteTextures(sfbDepthTextures);
            GlStateManager.deleteTextures(sfbColorTextures);
        }

        sfb = EXTFramebufferObject.glGenFramebuffersEXT();
        EXTFramebufferObject.glBindFramebufferEXT(36160, sfb);
        GL11.glDrawBuffer(0);
        GL11.glReadBuffer(0);
        GL11.glGenTextures((IntBuffer)sfbDepthTextures.clear().limit(usedShadowDepthBuffers));
        GL11.glGenTextures((IntBuffer)sfbColorTextures.clear().limit(usedShadowColorBuffers));
        sfbDepthTextures.position(0);
        sfbColorTextures.position(0);

        for (int i = 0; i < usedShadowDepthBuffers; ++i)
        {
            GlStateManager.bindTexture(sfbDepthTextures.get(i));
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
            int j = shadowFilterNearest[i] ? 9728 : 9729;
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, j);
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j);

            if (shadowHardwareFilteringEnabled[i])
            {
                GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_COMPARE_MODE, GL14.GL_COMPARE_R_TO_TEXTURE);
            }

            GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null));
        }

        EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
        checkGLError("FT sd");

        for (int k = 0; k < usedShadowColorBuffers; ++k)
        {
            GlStateManager.bindTexture(sfbColorTextures.get(k));
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
            GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
            int i1 = shadowColorFilterNearest[k] ? 9728 : 9729;
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i1);
            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i1);
            GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, shadowMapWidth, shadowMapHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null));
            EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, sfbColorTextures.get(k), 0);
            checkGLError("FT sc");
        }

        GlStateManager.bindTexture(0);

        if (usedShadowColorBuffers > 0)
        {
            GL20.glDrawBuffers(sfbDrawBuffers);
        }

        int l = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160);

        if (l != 36053)
        {
            printChatAndLogError("[Shaders] Error: Failed creating shadow framebuffer! (Status " + l + ")");
        }
        else
        {
            SMCLog.info("Shadow framebuffer created.");
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:73,代码来源:Shaders.java

示例9: glTexParameterf

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glTexParameterf(int p_187403_0_, int p_187403_1_, float p_187403_2_)
{
    GL11.glTexParameterf(p_187403_0_, p_187403_1_, p_187403_2_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:GlStateManager.java


注:本文中的org.lwjgl.opengl.GL11.glTexParameterf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。