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

The following examples show how to use org.lwjgl.opengl.GL11#GL_REPEAT . 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: 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 2
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 3
Source File: IslandGenerator.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
private final Texture createDetail(GLImage detail_image, int base_level) {
	GLImage[] detail_mipmaps = detail_image.buildMipMaps();
	GLImage.updateMipMapsArea(detail_mipmaps, base_level, Globals.LANDSCAPE_DETAIL_FADEOUT_FACTOR,
							  0, 0, detail_mipmaps[0].getWidth(), detail_mipmaps[0].getHeight(), false);
	return new Texture(detail_mipmaps, Globals.COMPRESSED_RGBA_FORMAT, GL11.GL_LINEAR_MIPMAP_LINEAR,
							  GL11.GL_LINEAR, GL11.GL_REPEAT, GL11.GL_REPEAT);
}
 
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: Font.java    From tribaltrouble with GNU General Public License v2.0 5 votes vote down vote up
public Font(FontInfo font_info) {
	this.key_array = font_info.getKeyMap();
	TextureFile file = new TextureFile(font_info.getTextureName(),
									   GL11.GL_RGBA,
									   GL11.GL_LINEAR,
									   GL11.GL_LINEAR,
									   GL11.GL_REPEAT,
									   GL11.GL_REPEAT);
	this.texture = (Texture)Resources.findResource(file);
	this.x_border = font_info.getBorderX();
	this.y_border = font_info.getBorderY();
	this.height = font_info.getHeight();
}
 
Example 6
Source File: MapTexture.java    From mapwriter with MIT License 5 votes vote down vote up
public MapTexture(int textureSize, boolean linearScaling) {
	super(textureSize, textureSize, 0x00000000, GL11.GL_LINEAR, GL11.GL_LINEAR, GL11.GL_REPEAT);
	
	this.setLinearScaling(linearScaling);
	
	this.textureRegions = textureSize >> Region.SHIFT;
	this.textureSize = textureSize;
	this.regionArray = new Region[this.textureRegions * this.textureRegions];
}
 
Example 7
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 8
Source File: TextureFile.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
public TextureFile(String location, int internal_format) {
	this(location, internal_format, GL11.GL_LINEAR_MIPMAP_NEAREST, GL11.GL_LINEAR, GL11.GL_REPEAT, GL11.GL_REPEAT);
}
 
Example 9
Source File: BlendInfo.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
private final Texture createAlphaMap(GLByteImage alpha_image, int format) {
	return new Texture(new GLByteImage[]{alpha_image}, format, GL11.GL_LINEAR,
									  GL11.GL_LINEAR, GL11.GL_REPEAT, GL11.GL_REPEAT);
}
 
Example 10
Source File: StructureBlend.java    From tribaltrouble with GNU General Public License v2.0 4 votes vote down vote up
private final Texture createStructureMap(GLIntImage structure_image) {
	return new Texture(new GLIntImage[]{structure_image}, GL11.GL_RGB, GL11.GL_LINEAR, GL11.GL_LINEAR, GL11.GL_REPEAT, GL11.GL_REPEAT);
}