Java Code Examples for org.lwjgl.opengl.GL11#glEndList()

The following examples show how to use org.lwjgl.opengl.GL11#glEndList() . 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: ItemEspHack.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onEnable()
{
	EVENTS.add(UpdateListener.class, this);
	EVENTS.add(CameraTransformViewBobbingListener.class, this);
	EVENTS.add(RenderListener.class, this);
	
	itemBox = GL11.glGenLists(1);
	GL11.glNewList(itemBox, GL11.GL_COMPILE);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glColor4f(1, 1, 0, 0.5F);
	RenderUtils.drawOutlinedBox(new Box(-0.5, 0, -0.5, 0.5, 1, 0.5));
	GL11.glEndList();
}
 
Example 2
Source File: SearchHack.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
private void setDisplayListFromTask()
{
	ArrayList<int[]> vertices;
	
	try
	{
		vertices = compileVerticesTask.get();
		
	}catch(InterruptedException | ExecutionException e)
	{
		throw new RuntimeException(e);
	}
	
	GL11.glNewList(displayList, GL11.GL_COMPILE);
	for(int[] vertex : vertices)
		GL11.glVertex3d(vertex[0], vertex[1], vertex[2]);
	GL11.glEndList();
	
	displayListUpToDate = true;
}
 
Example 3
Source File: TunnellerHack.java    From ForgeWurst with GNU General Public License v3.0 6 votes vote down vote up
private void updateCyanList()
{
	GL11.glNewList(displayLists[0], GL11.GL_COMPILE);
	
	GL11.glPushMatrix();
	GL11.glTranslated(start.getX(), start.getY(), start.getZ());
	GL11.glTranslated(0.5, 0.5, 0.5);
	
	GL11.glColor4f(0, 1, 1, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils
		.drawNode(new AxisAlignedBB(-0.25, -0.25, -0.25, 0.25, 0.25, 0.25));
	GL11.glEnd();
	
	RenderUtils.drawArrow(
		new Vec3d(direction.getDirectionVec()).scale(0.25),
		new Vec3d(direction.getDirectionVec())
			.scale(Math.max(0.5, length)));
	
	GL11.glPopMatrix();
	GL11.glEndList();
}
 
Example 4
Source File: AutoFishHack.java    From ForgeWurst with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onEnable()
{
	timer = 0;
	lastSoundPos = null;
	
	box = GL11.glGenLists(1);
	
	cross = GL11.glGenLists(1);
	GL11.glNewList(cross, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	GL11.glVertex3d(-0.125, 0, -0.125);
	GL11.glVertex3d(0.125, 0, 0.125);
	GL11.glVertex3d(0.125, 0, -0.125);
	GL11.glVertex3d(-0.125, 0, 0.125);
	GL11.glEnd();
	GL11.glEndList();
	
	MinecraftForge.EVENT_BUS.register(this);
}
 
Example 5
Source File: CaveFinderHack.java    From Wurst7 with GNU General Public License v3.0 6 votes vote down vote up
private void setDisplayListFromTask()
{
	ArrayList<int[]> vertices;
	
	try
	{
		vertices = compileVerticesTask.get();
		
	}catch(InterruptedException | ExecutionException e)
	{
		throw new RuntimeException(e);
	}
	
	GL11.glNewList(displayList, GL11.GL_COMPILE);
	for(int[] vertex : vertices)
		GL11.glVertex3d(vertex[0], vertex[1], vertex[2]);
	GL11.glEndList();
	
	displayListUpToDate = true;
}
 
Example 6
Source File: ItemEspHack.java    From ForgeWurst with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onEnable()
{
	MinecraftForge.EVENT_BUS.register(this);
	
	itemBox = GL11.glGenLists(1);
	GL11.glNewList(itemBox, GL11.GL_COMPILE);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glColor4f(1, 1, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	RenderUtils.drawOutlinedBox(
		new AxisAlignedBB(-0.175, 0, -0.175, 0.175, 0.35, 0.175));
	GL11.glEnd();
	GL11.glEndList();
}
 
Example 7
Source File: AutoFishHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onEnable()
{
	bestRodValue = -1;
	bestRodSlot = -1;
	castRodTimer = 0;
	reelInTimer = -1;
	scheduledWindowClick = -1;
	lastSoundPos = null;
	
	box = GL11.glGenLists(1);
	
	cross = GL11.glGenLists(1);
	GL11.glNewList(cross, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0, 0, 0.5F);
	GL11.glBegin(GL11.GL_LINES);
	GL11.glVertex3d(-0.125, 0, -0.125);
	GL11.glVertex3d(0.125, 0, 0.125);
	GL11.glVertex3d(0.125, 0, -0.125);
	GL11.glVertex3d(-0.125, 0, 0.125);
	GL11.glEnd();
	GL11.glEndList();
	
	EVENTS.add(UpdateListener.class, this);
	EVENTS.add(PacketInputListener.class, this);
	EVENTS.add(RenderListener.class, this);
}
 
Example 8
Source File: CachedRendererFactory.java    From OpenModsLib with MIT License 5 votes vote down vote up
public DisplayListRenderer(Tessellator tes) {
	displayList = GL11.glGenLists(1);
	if (isDisplayListValid()) {
		GL11.glNewList(displayList, GL11.GL_COMPILE);
		tes.draw();
		GL11.glEndList();
	}
}
 
Example 9
Source File: MobEspHack.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onEnable()
{
	MinecraftForge.EVENT_BUS.register(this);
	
	mobBox = GL11.glGenLists(1);
	GL11.glNewList(mobBox, GL11.GL_COMPILE);
	GL11.glBegin(GL11.GL_LINES);
	AxisAlignedBB bb = new AxisAlignedBB(-0.5, 0, -0.5, 0.5, 1, 0.5);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEnd();
	GL11.glEndList();
}
 
Example 10
Source File: PlayerEspHack.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void onEnable()
{
	MinecraftForge.EVENT_BUS.register(this);
	
	playerBox = GL11.glGenLists(1);
	GL11.glNewList(playerBox, GL11.GL_COMPILE);
	GL11.glBegin(GL11.GL_LINES);
	AxisAlignedBB bb = new AxisAlignedBB(-0.5, 0, -0.5, 0.5, 1, 0.5);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEnd();
	GL11.glEndList();
}
 
Example 11
Source File: TunnellerHack.java    From ForgeWurst with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean canRun()
{
	if(!torches.isChecked())
	{
		lastTorch = null;
		nextTorch = new BlockPos(WMinecraft.getPlayer());
		GL11.glNewList(displayLists[4], GL11.GL_COMPILE);
		GL11.glEndList();
		return false;
	}
	
	if(lastTorch != null)
		nextTorch = lastTorch.offset(direction,
			size.getSelected().torchDistance);
	
	GL11.glNewList(displayLists[4], GL11.GL_COMPILE);
	GL11.glColor4f(1, 1, 0, 0.5F);
	Vec3d torchVec = new Vec3d(nextTorch).addVector(0.5, 0, 0.5);
	RenderUtils.drawArrow(torchVec, torchVec.addVector(0, 0.5, 0));
	GL11.glEndList();
	
	BlockPos base = start.offset(direction, length);
	if(getDistance(start, base) <= getDistance(start, nextTorch))
		return false;
	
	return Blocks.TORCH.canPlaceBlockAt(WMinecraft.getWorld(),
		nextTorch);
}
 
Example 12
Source File: ChestEspHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
private void setupDisplayLists()
{
	Box box = new Box(BlockPos.ORIGIN);
	
	greenBox = GL11.glGenLists(1);
	GL11.glNewList(greenBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(0, 1, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	orangeBox = GL11.glGenLists(1);
	GL11.glNewList(orangeBox, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0.5F, 0, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(1, 0.5F, 0, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	cyanBox = GL11.glGenLists(1);
	GL11.glNewList(cyanBox, GL11.GL_COMPILE);
	GL11.glColor4f(0, 1, 1, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(0, 1, 1, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	purpleBox = GL11.glGenLists(1);
	GL11.glNewList(purpleBox, GL11.GL_COMPILE);
	GL11.glColor4f(1, 0, 1, 0.25F);
	RenderUtils.drawSolidBox(box);
	GL11.glColor4f(1, 0, 1, 0.5F);
	RenderUtils.drawOutlinedBox(box);
	GL11.glEndList();
	
	normalChests = GL11.glGenLists(1);
}
 
Example 13
Source File: ManualDisplayList.java    From OpenModsLib with MIT License 5 votes vote down vote up
public void compile(Renderer renderer) {
	if (isAllocated) GL11.glDeleteLists(displayList, 1);

	displayList = GL11.glGenLists(1);
	GL11.glNewList(displayList, GL11.GL_COMPILE);
	renderer.render();
	GL11.glEndList();

	isAllocated = isValid = true;
}
 
Example 14
Source File: PlayerEspHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onEnable()
{
	EVENTS.add(UpdateListener.class, this);
	EVENTS.add(CameraTransformViewBobbingListener.class, this);
	EVENTS.add(RenderListener.class, this);
	
	playerBox = GL11.glGenLists(1);
	GL11.glNewList(playerBox, GL11.GL_COMPILE);
	Box bb = new Box(-0.5, 0, -0.5, 0.5, 1, 0.5);
	RenderUtils.drawOutlinedBox(bb);
	GL11.glEndList();
}
 
Example 15
Source File: TunnellerHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean canRun()
{
	if(!torches.isChecked())
	{
		lastTorch = null;
		nextTorch = new BlockPos(MC.player.getPos());
		GL11.glNewList(displayLists[4], GL11.GL_COMPILE);
		GL11.glEndList();
		return false;
	}
	
	if(lastTorch != null)
		nextTorch = lastTorch.offset(direction,
			size.getSelected().torchDistance);
	
	GL11.glNewList(displayLists[4], GL11.GL_COMPILE);
	GL11.glColor4f(1, 1, 0, 0.5F);
	Vec3d torchVec = Vec3d.ofBottomCenter(nextTorch);
	RenderUtils.drawArrow(torchVec, torchVec.add(0, 0.5, 0));
	GL11.glEndList();
	
	BlockPos base = start.offset(direction, length);
	if(getDistance(start, base) <= getDistance(start, nextTorch))
		return false;
	
	return Blocks.TORCH.canPlaceAt(BlockUtils.getState(nextTorch),
		MC.world, nextTorch);
}
 
Example 16
Source File: RendererRollingMachine.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public RendererRollingMachine() {
	try {
		model = new WavefrontObject(new ResourceLocation("advancedrocketry:models/rollingMachine.obj"));
	} catch (ModelFormatException e) {
		e.printStackTrace();
	}
	GL11.glNewList(bodyList = GL11.glGenLists(1), GL11.GL_COMPILE);
	model.renderOnly("Hull");
	GL11.glEndList();
}
 
Example 17
Source File: RendererLathe.java    From AdvancedRocketry with MIT License 5 votes vote down vote up
public RendererLathe() {
	try {
		model = new WavefrontObject(new ResourceLocation("advancedrocketry:models/lathe.obj"));
	} catch (ModelFormatException e) {
		e.printStackTrace();
	}

	GL11.glNewList(bodyList = GL11.glGenLists(1), GL11.GL_COMPILE);
	model.renderOnly("body");
	GL11.glEndList();
}
 
Example 18
Source File: LwJglRenderingEngine.java    From Gaalop with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void run() {
    startEngine();
    //long start = System.currentTimeMillis();
    while (!Display.isCloseRequested()) {
        //System.out.println(System.currentTimeMillis()-start);
        //start = System.currentTimeMillis();
        
        if (rendering.isNewDataSetAvailable()) {
            if (list != -1) GL11.glDeleteLists(list, 1);
            list = GL11.glGenLists(1);
            GL11.glNewList(list, GL11.GL_COMPILE);
            draw(rendering.getDataSet(), rendering.getVisibleObjects(), rendering.getLoadedPointClouds());
            GL11.glEndList();
            changed = true;
        }
        
        
        GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); // clear the screen
        GL11.glLoadIdentity(); // apply camPos before rotation

        GL11.glTranslatef(0.0f, 0.0f, -5.0f);
        // draw
        GLU.gluLookAt(camPos.x, camPos.y, camPos.z, // Position
                camPos.x + camDir.x, camPos.y + camDir.y, camPos.z + camDir.z, // Lookat
                camUp.x, camUp.y, camUp.z);               // Up-direction
        // apply rotation
        GL11.glRotatef(camAngleX, 0, 1, 0); // window x axis rotates around up vector
        GL11.glRotatef(camAngleY, 1, 0, 0); // window y axis rotates around x

        //Render the scene
        if (list != -1) GL11.glCallList(list);

        pollInput();
        Display.update();
        if (recorder != null) {
            if (changed || firstFrame) {
                recorder.makeScreenshot();
                changed = false;
            }
            firstFrame = false;
            Display.sync(25); // cap fps to 60fps
        }
        else 
            Display.sync(60); 
    }

    Display.destroy();
}
 
Example 19
Source File: ImmediateModeOGLRenderer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
/**
 * @see org.newdawn.slick.opengl.renderer.SGL#glEndList()
 */
public void glEndList() {
	GL11.glEndList();
}
 
Example 20
Source File: Model.java    From pycode-minecraft with MIT License 4 votes vote down vote up
public void genList() {
        this.glList = GL11.glGenLists(1);
        GL11.glNewList(this.glList, GL11.GL_COMPILE);
//        if use_texture: glEnable(GL_TEXTURE_2D)
        GL11.glFrontFace(GL11.GL_CCW);
        GL11.glEnable(GL11.GL_CULL_FACE);

        GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);
        GL11.glDepthFunc(GL11.GL_LESS);
        GL11.glCullFace(GL11.GL_BACK);
        String currentMaterial = "";
        Material mtl;
        for (Face face : this.faces) {
            if (!face.material.equals(currentMaterial)) {
                currentMaterial = face.material;
                mtl = this.materials.get(face.material);
                if (mtl == null) {
                    GL11.glColor3f(1, 1, 1);
                } else {
//                    if 'texture_Kd' in mtl:
//                    # use diffuse texmap
//                    glBindTexture(GL_TEXTURE_2D, mtl['texture_Kd'])
                    GL11.glColor3f(mtl.diffuse.x, mtl.diffuse.y, mtl.diffuse.z);
                }
            }

            GL11.glBegin(GL11.GL_POLYGON);
            for (int i = 0; i < face.vertexes.size(); i++) {
                if (face.normals.get(i) != 0) {
                    Vector3f n = this.normals.get(face.normals.get(i));
                    GL11.glNormal3f(n.x, n.y, n.z);
                }
//                if texture_coords[i]:
//                    glTexCoord2fv(self.texcoords[texture_coords[i] - 1])
                Vector3f v = this.vertices.get(face.vertexes.get(i));
                GL11.glVertex3f(v.x, v.y, v.z);
            }
            GL11.glEnd();
        }

        GL11.glCullFace(GL11.GL_BACK);
        GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL);

        GL11.glDisable(GL11.GL_CULL_FACE);

//      if use_texture: glDisable(GL11.GL_TEXTURE_2D);
        GL11.glEndList();
    }