Example usage for org.lwjgl.opengl GL11 glTexParameterf

List of usage examples for org.lwjgl.opengl GL11 glTexParameterf

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glTexParameterf.

Prototype

public static void glTexParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname,
        @NativeType("GLfloat") float param) 

Source Link

Document

Float version of #glTexParameteri TexParameteri .

Usage

From source file:a1.gui.GUI_Map.java

License:Open Source License

public void DoCreate() {
    IntBuffer tt = BufferUtils.createIntBuffer(1);
    GL11.glGenTextures(tt);//from  w ww  .  ja  va2 s .c  om
    LightMap = tt.get(0);

    GL11.glBindTexture(GL11.GL_TEXTURE_2D, LightMap);
    ByteBuffer bb = BufferUtils.createByteBuffer(1024 * 1024 * 4);
    GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA8, 1024, 1024, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE,
            bb);
    GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
    Render2D.CheckError();
}

From source file:ar.com.quark.backend.lwjgl.opengl.DesktopGLES20.java

License:Apache License

/**
 * {@inheritDoc}// www  .  ja v a  2 s .com
 */
@Override
public void glTexParameter(int target, int type, float value) {
    GL11.glTexParameterf(target, type, value);
}

From source file:boilerplate.client.fx.FXRaygun.java

License:Minecraft Mod Public

@Override
public void renderParticle(final Tessellator tessellator, final float f, final float f1, final float f2,
        final float f3, final float f4, final float f5) {
    tessellator.draw();/*  w ww. j a v a 2s . c  om*/
    GL11.glPushMatrix();
    final float var9 = 1.0F;
    final float slide = this.worldObj.getWorldTime();
    final float rot = ((this.worldObj.provider.getWorldTime() % (360 / this.rotationspeed))
            * this.rotationspeed) + (this.rotationspeed * f);
    float size = 0.5F;

    if (this.pulse) {
        size = Math.min(this.particleAge / 4.0F, 1.0F);
        size = this.prevSize + ((size - this.prevSize) * f);
    }

    float op = 0.4F;

    if ((this.pulse) && ((this.particleMaxAge - this.particleAge) <= 4)) {
        op = 0.4F - ((4 - (this.particleMaxAge - this.particleAge)) * 0.1F);
    }

    switch (this.type) {
    default:
        // In case I make another type of beam, I can change the beam
        // texture here
        break;
    case 1:
        // and here...
        break;
    case 2:
        ClientHelper.textureManager().bindTexture(rayTex);
    }

    GL11.glTexParameterf(3553, 10242, 10497.0F);
    GL11.glTexParameterf(3553, 10243, 10497.0F);
    GL11.glDisable(2884);
    float var11 = slide + f;

    if (this.reverse) {
        var11 *= -1.0F; // why name your variables "var11"? That is so
        // un-helpful
    }

    final float var12 = (-var11 * 0.2F) - MathHelper.floor_float(-var11 * 0.1F);
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 1);
    GL11.glDepthMask(false);
    double prex = this.player.prevPosX;
    double prey = this.player.prevPosY + this.offset;
    double prez = this.player.prevPosZ;
    double px = this.player.posX;
    double py = this.player.posY + this.offset;
    double pz = this.player.posZ;
    prex -= MathHelper.cos((this.player.prevRotationYaw / 180.0F) * 3.141593F) * 0.066F;
    prey -= 0.06D;
    prez -= MathHelper.sin((this.player.prevRotationYaw / 180.0F) * 3.141593F) * 0.04F;
    Vec3 vec3d = this.player.getLook(1.0F);
    prex += vec3d.xCoord * 0.3D;
    prey += vec3d.yCoord * 0.3D;
    prez += vec3d.zCoord * 0.3D;
    px -= MathHelper.cos((this.player.rotationYaw / 180.0F) * 3.141593F) * 0.066F;
    py -= 0.06D;
    pz -= MathHelper.sin((this.player.rotationYaw / 180.0F) * 3.141593F) * 0.04F;
    vec3d = this.player.getLook(1.0F);
    px += vec3d.xCoord * 0.3D;
    py += vec3d.yCoord * 0.3D;
    pz += vec3d.zCoord * 0.3D;
    final float xx = (float) ((prex + ((px - prex) * f)) - EntityFX.interpPosX);
    final float yy = (float) ((prey + ((py - prey) * f)) - EntityFX.interpPosY);
    final float zz = (float) ((prez + ((pz - prez) * f)) - EntityFX.interpPosZ);
    GL11.glTranslated(xx, yy, zz);
    final float ry = this.prevYaw + ((this.rotYaw - this.prevYaw) * f);
    final float rp = this.prevPitch + ((this.rotPitch - this.prevPitch) * f);
    GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
    GL11.glRotatef(180.0F + ry, 0.0F, 0.0F, -1.0F);
    GL11.glRotatef(rp, 1.0F, 0.0F, 0.0F);
    final double var44 = -0.15D * size;
    final double var17 = 0.15D * size;
    final double var44b = -0.15D * size * this.endMod;
    final double var17b = 0.15D * size * this.endMod;
    GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);

    for (int t = 0; t < 5; t++) {
        final double var29 = this.length * size * var9;
        final double var31 = 0.0D;
        final double var33 = 1.0D;
        final double var35 = -1.0F + var12 + (t / 3.0F);
        final double var37 = (this.length * size * var9) + var35;
        GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.setBrightness(200);
        tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, op);
        tessellator.addVertexWithUV(var44b, var29, 0.0D, var33, var37);
        tessellator.addVertexWithUV(var44, 0.0D, 0.0D, var33, var35);
        tessellator.addVertexWithUV(var17, 0.0D, 0.0D, var31, var35);
        tessellator.addVertexWithUV(var17b, var29, 0.0D, var31, var37);
        tessellator.draw();
    }

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDepthMask(true);
    GL11.glDisable(3042);
    GL11.glEnable(2884);
    GL11.glPopMatrix();
    tessellator.startDrawingQuads();
    this.prevSize = size;
}

From source file:com.ardor3d.scene.state.lwjgl.LwjglTextureStateUtil.java

License:Open Source License

/**
 * Check if the filter settings of this particular texture have been changed and apply as needed.
 * /*from   w  ww . j a v  a 2  s .co m*/
 * @param texture
 *            our texture object
 * @param texRecord
 *            our record of the last state of the texture in gl
 * @param record
 */
public static void applyFilter(final Texture texture, final TextureRecord texRecord, final int unit,
        final TextureStateRecord record, final ContextCapabilities caps) {
    final Type type = texture.getType();

    final int magFilter = LwjglTextureUtil.getGLMagFilter(texture.getMagnificationFilter());
    // set up magnification filter
    if (!texRecord.isValid() || texRecord.magFilter != magFilter) {
        checkAndSetUnit(unit, record, caps);
        GL11.glTexParameteri(getGLType(type), GL11.GL_TEXTURE_MAG_FILTER, magFilter);
        texRecord.magFilter = magFilter;
    }

    final int minFilter = LwjglTextureUtil.getGLMinFilter(texture.getMinificationFilter());
    // set up mipmap filter
    if (!texRecord.isValid() || texRecord.minFilter != minFilter) {
        checkAndSetUnit(unit, record, caps);
        GL11.glTexParameteri(getGLType(type), GL11.GL_TEXTURE_MIN_FILTER, minFilter);
        texRecord.minFilter = minFilter;
    }

    // set up aniso filter
    if (caps.isAnisoSupported()) {
        float aniso = texture.getAnisotropicFilterPercent() * (caps.getMaxAnisotropic() - 1.0f);
        aniso += 1.0f;
        if (!texRecord.isValid() || (texRecord.anisoLevel - aniso > MathUtils.ZERO_TOLERANCE)) {
            checkAndSetUnit(unit, record, caps);
            GL11.glTexParameterf(getGLType(type), EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
                    aniso);
            texRecord.anisoLevel = aniso;
        }
    }
}

From source file:com.badlogic.gdx.backends.jglfw.JglfwGL20.java

License:Apache License

public void glTexParameterf(int target, int pname, float param) {
    GL11.glTexParameterf(target, pname, param);
}

From source file:com.badlogic.gdx.backends.lwjgl.LwjglGL10.java

License:Apache License

public final void glTexParameterf(int target, int pname, float param) {
    // LwjglGraphics.major is should to be 1 if we are in LwjglGL10.
    if (LwjglGraphics.minor < 2 && param == GL12.GL_CLAMP_TO_EDGE)
        param = GL11.GL_CLAMP;//w w  w  .  jav  a  2 s.  c  om
    GL11.glTexParameterf(target, pname, param);
}

From source file:com.badlogic.gdx.backends.lwjgl.swt.LwjglGL10.java

License:Apache License

public final void glTexParameterf(int target, int pname, float param) {
    // LwjglGraphics.major is should to be 1 if we are in LwjglGL10.
    if (SwtLwjglGraphics.minor < 2 && param == GL12.GL_CLAMP_TO_EDGE)
        param = GL11.GL_CLAMP;/*w ww . j  a v a2s . c  o  m*/
    GL11.glTexParameterf(target, pname, param);
}

From source file:com.flowpowered.caustic.lwjgl.gl20.GL20Texture.java

License:MIT License

@Override
public void setAnisotropicFiltering(float value) {
    checkCreated();/*from   ww  w. ja v a  2  s .c  o  m*/
    if (value <= 0) {
        throw new IllegalArgumentException("Anisotropic filtering value must be greater than zero");
    }
    // Bind the texture
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, id);
    // Set the anisotropic filtering value
    GL11.glTexParameterf(GL11.GL_TEXTURE_2D, EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT, value);
    // Unbind the texture
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.foudroyantfactotum.mod.fousarchive.midi.generation.MidiTexture.java

License:Open Source License

@Override
public void loadTexture(IResourceManager resourceManager) throws IOException {
    final int xSize = getSmallTextureSize();
    final int ySize = 88;
    byte[] res = null;

    try (final InputStream io = resourceManager.getResource(rl).getInputStream()) {
        res = getMidiTrack(io, xSize, ySize);
    } catch (InvalidMidiDataException e) {
        e.printStackTrace();/* w  w w  .j a  v a2  s.  c o  m*/
    }

    if (res != null) {
        this.deleteGlTexture();

        GlStateManager.bindTexture(this.getGlTextureId());

        final ByteBuffer bb = (ByteBuffer) BufferUtils.createByteBuffer(res.length).put(res).flip();

        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, 0);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MIN_LOD, 0.0f);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, 0.0f);
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, 0.0f);

        GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, xSize, ySize, 0, GL11.GL_RGB, GL11.GL_BYTE, bb);
    }
}

From source file:com.grillecube.client.opengl.GLTexture.java

public final void parameterf(int target, int pname, float param) {
    GL11.glTexParameterf(target, pname, param);
}