当前位置: 首页>>代码示例>>Java>>正文


Java CCRenderState.startDrawing方法代码示例

本文整理汇总了Java中codechicken.lib.render.CCRenderState.startDrawing方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.startDrawing方法的具体用法?Java CCRenderState.startDrawing怎么用?Java CCRenderState.startDrawing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在codechicken.lib.render.CCRenderState的用法示例。


在下文中一共展示了CCRenderState.startDrawing方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawOverlayGrad

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayGrad(int x1, int x2, int y1, int y2, float zLevel) {
    GlStateManager.disableTexture2D();
    GlStateManager.disableCull();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    WorldRenderer r = CCRenderState.startDrawing();
    r.setColorRGBA_I(0, 255);
    r.addVertex(x2, y1, zLevel);
    r.addVertex(x1, y1, zLevel);
    r.setColorRGBA_I(0, 0);
    r.addVertex(x1, y2, zLevel);
    r.addVertex(x2, y2, zLevel);
    CCRenderState.draw();
    GlStateManager.disableBlend();
    GlStateManager.enableCull();
    GlStateManager.enableTexture2D();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:19,代码来源:OptionScrollPane.java

示例2: bakeQuads

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public List<BakedQuad> bakeQuads(EnumFacing face, IExtendedBlockState state) {
    BakingVertexBuffer buffer = BakingVertexBuffer.create();
    Triple<Integer, Integer, UVTransformation> worldData = getWorldTransforms(state);
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer);
    models[worldData.getLeft()][worldData.getMiddle()].render(ccrs, worldData.getRight());
    buffer.finishDrawing();
    List<BakedQuad> quads = buffer.bake();
    if (face == null && !shouldCull()) {
        return quads;
    } else if (face != null) {
        return VertexDataUtils.sortFaceData(quads).get(face);
    }
    return ImmutableList.of();
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:18,代码来源:SimpleBlockRenderer.java

示例3: bakeItemQuads

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public List<BakedQuad> bakeItemQuads(EnumFacing face, ItemStack stack) {
    BakingVertexBuffer buffer = BakingVertexBuffer.create();
    Triple<Integer, Integer, UVTransformation> worldData = getItemTransforms(stack);
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer);
    models[worldData.getLeft()][worldData.getMiddle()].render(ccrs, worldData.getRight());
    buffer.finishDrawing();
    List<BakedQuad> quads = buffer.bake();

    if (face == null && !shouldCull()) {
        return quads;
    } else if (face != null) {
        return VertexDataUtils.sortFaceData(quads).get(face);
    }
    return ImmutableList.of();
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:19,代码来源:SimpleBlockRenderer.java

示例4: drawOverlayGrad

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayGrad(int x1, int x2, int y1, int y2, float zLevel) {
    GlStateManager.disableTexture2D();
    GlStateManager.disableCull();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    CCRenderState ccrs = CCRenderState.instance();

    BufferBuilder buffer = ccrs.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
    buffer.pos(x2, y1, zLevel).color(0, 0, 0, 255).endVertex();
    buffer.pos(x1, y1, zLevel).color(0, 0, 0, 255).endVertex();

    buffer.pos(x1, y2, zLevel).color(0, 0, 0, 0).endVertex();
    buffer.pos(x2, y2, zLevel).color(0, 0, 0, 0).endVertex();

    ccrs.draw();
    GlStateManager.disableBlend();
    GlStateManager.enableCull();
    GlStateManager.enableTexture2D();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:21,代码来源:OptionScrollPane.java

示例5: renderContents

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderContents(PartHeatTransmitter transmitter, Vector3 pos)
{
	push();
	CCRenderState.reset();
	CCRenderState.useNormals = true;
	CCRenderState.startDrawing();
	GL11.glTranslated(pos.x, pos.y, pos.z);

	for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
	{
		renderHeatSide(side, transmitter);
	}

	MekanismRenderer.glowOn();
	MekanismRenderer.cullFrontFace();

	CCRenderState.draw();

	MekanismRenderer.disableCullFace();
	MekanismRenderer.glowOff();

	pop();
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:24,代码来源:RenderPartTransmitter.java

示例6: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderItem(int metadata)
{
	TextureUtils.bindAtlas(0);
	CCRenderState.reset();
	CCRenderState.startDrawing();
	CCRenderState.hasColour = true;
	EnumColor c = EnumColor.DYES[metadata];

	Colour colour = new ColourRGBA(c.getColor(0), c.getColor(1), c.getColor(2), 1);
	Colour white = new ColourRGBA(1.0, 1.0, 1.0, 1.0);
	
	for(int i = 4; i < 5; i++)
	{
		frameModels[i].render(new IconTransformation(icon), new ColourMultiplier(white.rgba()));
		lightModels[i].render(new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
	}
	
	CCRenderState.draw();
}
 
开发者ID:Microsoft,项目名称:vsminecraft,代码行数:20,代码来源:RenderGlowPanel.java

示例7: render

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void render(ItemStack stack, MapData data, boolean inFrame) {
    WirelessMapNodeStorage mapstorage = RedstoneEtherAddons.client().getMapNodes();

    if (stack == null || stack.getItem() != ModItems.itemWirelessMap) {
        return;
    }

    ClientMapInfo mapinfo = RedstoneEtherAddons.client().getMPMapInfo((short) stack.getItemDamage());
    if (mapinfo == null) {
        return;
    }

    CCRenderState ccrs = CCRenderState.instance();
    GlStateManager.disableTexture2D();
    GlStateManager.disableDepth();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA);
    float light = 1;

    int xCenter = mapinfo.xCenter;
    int zCenter = mapinfo.zCenter;
    int scale = mapinfo.scale;

    ccrs.startDrawing(0x07, DefaultVertexFormats.POSITION_COLOR);
    renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.75F, 1F, light * 0.5F);
    renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.6F, 1F, light);
    ccrs.draw();

    GlStateManager.enableTexture2D();
    GlStateManager.enableDepth();
    GlStateManager.disableBlend();
}
 
开发者ID:TheCBProject,项目名称:WirelessRedstone,代码行数:33,代码来源:WirelessMapRenderer.java

示例8: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack stack, final Object... data) {
    if (!stack.hasTagCompound()) {
        return;
    }
    final String mat = stack.getTagCompound().getString("mat");
    final MicroMaterialRegistry.IMicroMaterial material = MicroMaterialRegistry.getMaterial(mat);
    if (material == null) {
        return;
    }
    GL11.glPushMatrix();
    if (type == IItemRenderer.ItemRenderType.ENTITY) {
        GL11.glScaled(0.5, 0.5, 0.5);
    }
    if (type == IItemRenderer.ItemRenderType.INVENTORY || type == IItemRenderer.ItemRenderType.ENTITY) {
        GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
    }
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glEnable(3008);
    final CCRenderPipeline.PipelineBuilder builder = CCRenderState.pipeline.builder();
    CCRenderState.reset();
    TextureUtils.bindAtlas(0);
    CCRenderState.useNormals = true;
    CCRenderState.pullLightmap();
    CCRenderState.startDrawing();
    final IMicroBlock part = RegisterMicroBlocks.mParts.get(stack.getItemDamage());
    if (part != null) {
        part.renderItem(stack, material);
    }
    CCRenderState.draw();
    GL11.glPopMatrix();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:32,代码来源:RenderItemMicroblock.java

示例9: draw

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void draw(int x, int y, int w, int h) {
    CCRenderState.changeTexture(tex);
    CCRenderState.reset();
    CCRenderState.startDrawing();

    int[] sw = new int[]{x, x+seg_w[0], x+w-seg_w[2], x+w};
    int[] sh = new int[]{y, y+seg_h[0], y+h-seg_h[2], y+h};

    for(int seg = 0; seg < 9; seg++)
        drawSeg(sw, sh, seg);

    CCRenderState.draw();
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:Canvas9Seg.java

示例10: drawOverlayTex

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayTex(int x, int y, int w, int h, float zLevel) {
    GlStateManager.color(1, 1, 1, 1);
    Minecraft.getMinecraft().renderEngine.bindTexture(Gui.optionsBackground);
    WorldRenderer r = CCRenderState.startDrawing();
    r.addVertexWithUV(x, y, zLevel, 0, 0);
    r.addVertexWithUV(x, y + h, zLevel, 0, h / 16D);
    r.addVertexWithUV(x + w, y + h, zLevel, w / 16D, h / 16D);
    r.addVertexWithUV(x + w, y, zLevel, w / 16D, 0);
    CCRenderState.draw();
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:11,代码来源:OptionScrollPane.java

示例11: renderChest

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
    TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
    GlStateManager.color(1, 1, 1, 1);

    TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
    GlStateManager.pushMatrix();
    GlStateManager.enableRescaleNormal();
    GlStateManager.color(1, 1, 1, 1);
    GlStateManager.translate(x, y + 1.0, z + 1.0F);
    GlStateManager.scale(1.0F, -1F, -1F);
    GlStateManager.translate(0.5F, 0.5F, 0.5F);
    GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);
    model.chestLid.rotateAngleX = lidAngle;
    model.render(freq.hasOwner());
    GlStateManager.popMatrix();

    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    renderButtons(freq, rotation, lidAngle);
    GlStateManager.popMatrix();

    double time = ClientUtils.getRenderTime() + offset;
    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);

    GlStateManager.disableLighting();
    TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
    GlStateManager.pushMatrix();

    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
}
 
开发者ID:TheCBProject,项目名称:EnderStorage,代码行数:40,代码来源:RenderTileEnderChest.java

示例12: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
    renderWrapped(stack);

    double rot = ClientUtils.getRenderTime() / 3F;
    double height;
    double size;
    double updown = (float) Math.sin(((ClientUtils.getRenderTime() % 50) / 25F) * 3.141593) * 0.2;

    if (stack.getMetadata() == 0) {
        height = 0.9;
        size = 0.08;
    } else {
        height = 0.5;
        size = 0.05;
    }

    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();

    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(0.5, height + (updown + 0.3), 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);

    disableLighting();
    pushMatrix();
    TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
    ccrs.draw();
    popMatrix();
    enableLighting();
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:32,代码来源:ChunkLoaderItemModel.java

示例13: renderItem

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
    GlStateManager.pushMatrix();

    TextureUtils.changeTexture("translocator:textures/model/tex.png");
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    TileTranslocatorRenderer.renderAttachment(ccrs, 2, stack.getItemDamage(), 1D, 0, 0.0D, 0.0D, 0.5D);
    ccrs.draw();

    GlStateManager.popMatrix();
}
 
开发者ID:TheCBProject,项目名称:Translocators,代码行数:13,代码来源:TranslocatorItemRender.java

示例14: drawOverlayTex

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayTex(int x, int y, int w, int h, float zLevel) {
    GlStateManager.color(1, 1, 1, 1);
    Minecraft.getMinecraft().renderEngine.bindTexture(Gui.OPTIONS_BACKGROUND);
    CCRenderState ccrs = CCRenderState.instance();
    BufferBuilder buffer = ccrs.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);

    buffer.pos(x, y, zLevel).tex(0, 0).endVertex();
    buffer.pos(x, y + h, zLevel).tex(0, h / 16D).endVertex();
    buffer.pos(x + w, y + h, zLevel).tex(w / 16D, h / 16D).endVertex();
    buffer.pos(x + w, y, zLevel).tex(w / 16D, 0).endVertex();
    ccrs.draw();
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:13,代码来源:OptionScrollPane.java

示例15: render

import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void render(TileChunkLoaderBase tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
    CCRenderState ccrs = CCRenderState.instance();
    ccrs.reset();
    ccrs.setBrightness(tile.getWorld(), tile.getPos());
    double rot = ClientUtils.getRenderTime() * 2;
    double height;
    double size;
    double updown = (ClientUtils.getRenderTime() % 50) / 25F;

    updown = (float) Math.sin(updown * 3.141593);
    updown *= 0.2;

    if (tile instanceof TileChunkLoader) {
        TileChunkLoader ctile = (TileChunkLoader) tile;
        rot /= Math.pow(ctile.radius, 0.2);
        height = 0.9;
        size = 0.08;
    } else if (tile instanceof TileSpotLoader) {
        height = 0.5;
        size = 0.05;
    } else {
        return;
    }

    RenderInfo renderInfo = tile.renderInfo;
    double active = (renderInfo.activationCounter) / 20D;
    if (tile.active && renderInfo.activationCounter < 20) {
        active += partialTicks / 20D;
    } else if (!tile.active && renderInfo.activationCounter > 0) {
        active -= partialTicks / 20D;
    }

    if (renderInfo.showLasers) {
        disableTexture2D();
        disableLighting();
        disableFog();
        drawRays(x, y, z, rot, updown, tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(), tile.getChunks());
        enableTexture2D();
        enableLighting();
        enableFog();
    }
    rot = ClientUtils.getRenderTime() * active / 3F;

    Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + height + (updown + 0.3) * active, z + 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);
    disableLighting();
    pushMatrix();
    TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
    ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
    CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
    ccrs.draw();
    popMatrix();
    enableLighting();
}
 
开发者ID:TheCBProject,项目名称:ChickenChunks,代码行数:55,代码来源:TileChunkLoaderRenderer.java


注:本文中的codechicken.lib.render.CCRenderState.startDrawing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。