Java Code Examples for org.lwjgl.opengl.GL11#GL_TEXTURE_2D

The following examples show how to use org.lwjgl.opengl.GL11#GL_TEXTURE_2D . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TextureUtils.java    From CodeChickenLib with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static void prepareTexture(int target, int texture, int min_mag_filter, int wrap) {
    GlStateManager.texParameter(target, GL11.GL_TEXTURE_MIN_FILTER, min_mag_filter);
    GlStateManager.texParameter(target, GL11.GL_TEXTURE_MAG_FILTER, min_mag_filter);
    if (target == GL11.GL_TEXTURE_2D) {
        GlStateManager.bindTexture(target);
    } else {
        GL11.glBindTexture(target, texture);
    }

    switch (target) {
        case GL12.GL_TEXTURE_3D:
            GlStateManager.texParameter(target, GL12.GL_TEXTURE_WRAP_R, wrap);
        case GL11.GL_TEXTURE_2D:
            GlStateManager.texParameter(target, GL11.GL_TEXTURE_WRAP_T, wrap);
        case GL11.GL_TEXTURE_1D:
            GlStateManager.texParameter(target, GL11.GL_TEXTURE_WRAP_S, wrap);
    }
}
 
Example 2
Source File: TextureUtils.java    From CodeChickenLib with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static void prepareTexture(int target, int texture, int min_mag_filter, int wrap) {
    GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, min_mag_filter);
    GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, min_mag_filter);
    if(target == GL11.GL_TEXTURE_2D)
        GlStateManager.bindTexture(target);
    else
        GL11.glBindTexture(target, texture);

    switch (target) {
        case GL12.GL_TEXTURE_3D:
            GL11.glTexParameteri(target, GL12.GL_TEXTURE_WRAP_R, wrap);
        case GL11.GL_TEXTURE_2D:
            GL11.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_T, wrap);
        case GL11.GL_TEXTURE_1D:
            GL11.glTexParameteri(target, GL11.GL_TEXTURE_WRAP_S, wrap);
    }
}
 
Example 3
Source File: Texture.java    From OpenGL-Animation with The Unlicense 4 votes vote down vote up
protected Texture(int textureId, int size) {
	this.textureId = textureId;
	this.size = size;
	this.type = GL11.GL_TEXTURE_2D;
}