Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.agpu.oc.client; import java.nio.IntBuffer; import net.minecraftforge.fml.client.registry.ClientRegistry; import org.agpu.oc.client.renderer.AdvancedMonitorRenderer; import org.agpu.oc.common.CommonProxy; import org.agpu.oc.common.tileentity.AdvancedMonitor; import org.lwjgl.opengl.GL11; /** * * @author arnau */ public class ClientProxy extends CommonProxy { @Override public void registerRenderers() { ClientRegistry.bindTileEntitySpecialRenderer(AdvancedMonitor.class, new AdvancedMonitorRenderer()); } @Override public int setup2DScreenTextureTarget(int w, int h) { //Generate Texture Space int texture = GL11.glGenTextures(); GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); //Generate Blank Texture GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, w, h, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_INT, (IntBuffer) null); //Poor filtering. Needed! 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); System.out.println("Generated AGPU output texture"); return texture; } }