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

The following examples show how to use org.lwjgl.opengl.GL11#GL_NEAREST . 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: Graphics.java    From AnyaBasic with MIT License 6 votes vote down vote up
public Graphics( int screenWidth, int screenHeight, int vsynch )
{

    super( screenWidth, screenHeight );

    if( vsynch !=  0)
    {
        Display.setVSyncEnabled( true );
    }

    spriteFont = new SpriteFont( new ImageAtlas(
                                 new ImageTextureDataFont(),
                                 32, 32, GL11.GL_NEAREST ));

    glowImages = new ImageAtlas( new ImageTextureDataGlowSprites(), GL11.GL_LINEAR, 0 );

}
 
Example 2
Source File: TextureAttachment.java    From LowPolyWater with The Unlicense 5 votes vote down vote up
private void setTextureParams(){
	int filterType = nearestFiltering ? GL11.GL_NEAREST : GL11.GL_LINEAR;
	GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filterType);
	GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filterType);
	int wrapType = clampEdges ? GL12.GL_CLAMP_TO_EDGE : GL11.GL_REPEAT;
	GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wrapType);
	GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wrapType);
}
 
Example 3
Source File: Cursor.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
public Cursor(URL url_16_1, int offset_x_16_1, int offset_y_16_1,
			  URL url_32_1, int offset_x_32_1, int offset_y_32_1,
			  URL url_32_8, int offset_x_32_8, int offset_y_32_8) {
	this.offset_x = offset_x_32_8;
	this.offset_y = offset_y_32_8;
	Image image = Image.read(url_32_8);
	int width = image.getWidth();
	int height = image.getHeight();
	GLIntImage img_32_8 = new GLIntImage(width, height, image.getPixels(), GL11.GL_RGBA);

	Image image_16_1 = Image.read(url_16_1);
	GLIntImage img_16_1 = new GLIntImage(image_16_1.getWidth(), image_16_1.getHeight(), image_16_1.getPixels(), GL11.GL_RGBA);
	Image image_32_1 = Image.read(url_32_1);
	GLIntImage img_32_1 = new GLIntImage(image_32_1.getWidth(), image_32_1.getHeight(), image_32_1.getPixels(), GL11.GL_RGBA);
	
	native_cursor = new NativeCursor(img_16_1, offset_x_16_1, offset_y_16_1,
									 img_32_1, offset_x_32_1, offset_y_32_1,
									 img_32_8, offset_x_32_8, offset_y_32_8);

	texture = new Texture(new GLImage[]{img_32_8},
							GL11.GL_RGBA,
							GL11.GL_NEAREST,
							GL11.GL_NEAREST,
							GL11.GL_REPEAT,
							GL11.GL_REPEAT);
	cursor = new Quad(0, 0, 1, 1, 32, 32);
}
 
Example 4
Source File: GeneratorRespond.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
public final Texture[] generate() {
	GLIntImage img = new GLIntImage(1, 1, GL11.GL_RGBA);
	img.putPixel(0, 0, COLOR);
	Texture[] textures = new Texture[1];
	textures[0] = new Texture(new GLImage[]{img}, Globals.COMPRESSED_RGBA_FORMAT, GL11.GL_NEAREST, GL11.GL_NEAREST, GL11.GL_REPEAT, GL11.GL_REPEAT);
	return textures;
}
 
Example 5
Source File: UndergroundTexture.java    From mapwriter with MIT License 5 votes vote down vote up
public UndergroundTexture(Mw mw, int textureSize, boolean linearScaling) {	
	super(textureSize, textureSize, 0x00000000, GL11.GL_NEAREST, GL11.GL_NEAREST, GL11.GL_REPEAT);
	this.setLinearScaling(false);
	this.textureSize = textureSize;
	this.textureChunks = textureSize >> 4;
	this.loadedChunkArray = new Point[this.textureChunks * this.textureChunks];
	this.pixels = new int[textureSize * textureSize];
	Arrays.fill(this.pixels, 0xff000000);
	this.mw = mw;
}
 
Example 6
Source File: Texture.java    From mapwriter with MIT License 4 votes vote down vote up
public Texture(int w, int h, int fillColour) {
	this(w, h, fillColour, GL11.GL_LINEAR, GL11.GL_NEAREST, GL12.GL_CLAMP_TO_EDGE);
}