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


Java GL11.glShadeModel方法代码示例

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


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

示例1: initGL

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Initialise the GL context
 */
protected void initGL() {
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);        
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);                    
       
	GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);                
       GL11.glClearDepth(1);                                       
       
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       
       GL11.glViewport(0,0,screenWidth,screenHeight);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
	GL11.glLoadIdentity();
	
	enterOrtho();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:22,代码来源:PBufferGraphics.java

示例2: initGL

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Initialise the GL context
 */
protected void initGL() {
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);        
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);                    
       
	GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);                
       GL11.glClearDepth(1);                                       
       
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       
       GL11.glViewport(0,0,screenWidth,screenHeight);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);               
	GL11.glLoadIdentity();
	
	enterOrtho();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:22,代码来源:FBOGraphics.java

示例3: drawGradientRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientRect(double x, double y, double x2, double y2, int col1, int col2) {
    GL11.glEnable((int)3042);
    GL11.glDisable((int)3553);
    GL11.glBlendFunc((int)770, (int)771);
    GL11.glEnable((int)2848);
    GL11.glShadeModel((int)7425);
    GL11.glPushMatrix();
    GL11.glBegin((int)7);
    RenderUtils.glColor(col1);
    GL11.glVertex2d((double)x2, (double)y);
    GL11.glVertex2d((double)x, (double)y);
    RenderUtils.glColor(col2);
    GL11.glVertex2d((double)x, (double)y2);
    GL11.glVertex2d((double)x2, (double)y2);
    GL11.glEnd();
    GL11.glPopMatrix();
    GL11.glEnable((int)3553);
    GL11.glDisable((int)3042);
    GL11.glDisable((int)2848);
    GL11.glShadeModel((int)7424);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:22,代码来源:RenderUtils.java

示例4: drawGradientRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientRect(float x, float y, float x1, float x2, int col1, int col2) {
    int[] color = {col1, col1, col2, col2};
    float[] r = new float[color.length];
    float[] g = new float[color.length];
    float[] b = new float[color.length];
    float[] a = new float[color.length];
    for (int i = 0; i < color.length; i++) {
        r[i] = ((color[i] >> 16 & 0xFF) / 255.0F);
        g[i] = ((color[i] >> 8 & 0xFF) / 255.0F);
        b[i] = ((color[i] & 0xFF) / 255.0F);
        a[i] = ((color[i] >> 24 & 0xFF) / 255.0F);
    }
    GL11.glDisable(3553);
    GL11.glEnable(3042);
    GL11.glDisable(3008);
    OpenGlHelper.func_148821_a(770, 771, 1, 0);
    GL11.glBlendFunc(770, 771);
    GL11.glShadeModel(7425);
    Tessellator t = Tessellator.field_78398_a;
    t.func_78382_b();
    t.func_78369_a(r[0], g[0], b[0], a[0]);
    t.func_78377_a(x1, y, 0.0D);
    t.func_78369_a(r[1], g[1], b[1], a[1]);
    t.func_78377_a(x, y, 0.0D);
    t.func_78369_a(r[2], g[2], b[2], a[2]);
    t.func_78377_a(x, x2, 0.0D);
    t.func_78369_a(r[3], g[3], b[3], a[3]);
    t.func_78377_a(x1, x2, 0.0D);
    t.func_78381_a();
    GL11.glShadeModel(7424);
    GL11.glDisable(3042);
    GL11.glEnable(3008);
    GL11.glEnable(3553);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:35,代码来源:TessRenderUtil.java

示例5: renderPinnedWindows

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void renderPinnedWindows()
{
	GL11.glDisable(GL11.GL_CULL_FACE);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	GL11.glShadeModel(GL11.GL_SMOOTH);
	GL11.glLineWidth(1);
	
	for(Window window : windows)
		if(window.isPinned())
			renderWindow(window, Integer.MIN_VALUE, Integer.MIN_VALUE);
		
	GL11.glEnable(GL11.GL_CULL_FACE);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glDisable(GL11.GL_BLEND);
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:18,代码来源:ClickGui.java

示例6: initGL

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Initialise the GL display
 * 
 * @param width The width of the display
 * @param height The height of the display
 */
private void initGL(int width, int height) {
	try {
		Display.setDisplayMode(new DisplayMode(width,height));
		Display.create();
		Display.setVSyncEnabled(true);
	} catch (LWJGLException e) {
		e.printStackTrace();
		System.exit(0);
	}

	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);        
	GL11.glDisable(GL11.GL_DEPTH_TEST);
	GL11.glDisable(GL11.GL_LIGHTING);                    
       
	GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);                
       GL11.glClearDepth(1);                                       
       
       GL11.glEnable(GL11.GL_BLEND);
       GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
       
       GL11.glViewport(0,0,width,height);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);

	GL11.glMatrixMode(GL11.GL_PROJECTION);
	GL11.glLoadIdentity();
	GL11.glOrtho(0, width, height, 0, 1, -1);
	GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:TestUtils.java

示例7: shadeModel

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void shadeModel(int mode)
{
    if (mode != activeShadeModel)
    {
        activeShadeModel = mode;
        GL11.glShadeModel(mode);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:GlStateManager.java

示例8: drawGradientHRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawGradientHRect(float x, float y, float x1, float y1, int topColor, int bottomColor) {
    RenderUtils.enableGL2D();
    GL11.glShadeModel((int)7425);
    GL11.glBegin((int)7);
    RenderUtils.glColor(topColor);
    GL11.glVertex2f((float)x, (float)y);
    GL11.glVertex2f((float)x, (float)y1);
    RenderUtils.glColor(bottomColor);
    GL11.glVertex2f((float)x1, (float)y1);
    GL11.glVertex2f((float)x1, (float)y);
    GL11.glEnd();
    GL11.glShadeModel((int)7424);
    RenderUtils.disableGL2D();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:RenderUtils.java

示例9: drawGradientRect

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6)
{
    float f = (float)(par5 >> 24 & 255) / 255.0F;
    float f1 = (float)(par5 >> 16 & 255) / 255.0F;
    float f2 = (float)(par5 >> 8 & 255) / 255.0F;
    float f3 = (float)(par5 & 255) / 255.0F;
    float f4 = (float)(par6 >> 24 & 255) / 255.0F;
    float f5 = (float)(par6 >> 16 & 255) / 255.0F;
    float f6 = (float)(par6 >> 8 & 255) / 255.0F;
    float f7 = (float)(par6 & 255) / 255.0F;
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_ALPHA_TEST);
    OpenGlHelper.glBlendFunc(770, 771, 1, 0);
    GL11.glShadeModel(GL11.GL_SMOOTH);
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setColorRGBA_F(f1, f2, f3, f);
    tessellator.addVertex((double)par3, (double)par2, 0.0D);
    tessellator.addVertex((double)par1, (double)par2, 0.0D);
    tessellator.setColorRGBA_F(f5, f6, f7, f4);
    tessellator.addVertex((double)par1, (double)par4, 0.0D);
    tessellator.addVertex((double)par3, (double)par4, 0.0D);
    tessellator.draw();
    GL11.glShadeModel(GL11.GL_FLAT);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:Pishka,项目名称:MineDonate,代码行数:30,代码来源:GuiScrollingList.java

示例10: disableRender2D

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableRender2D() {
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LINE_SMOOTH);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glShadeModel(GL11.GL_FLAT);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:Ygore,项目名称:bit-client,代码行数:11,代码来源:RenderUtil.java

示例11: func_31070_a

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void func_31070_a(TileEntityPiston tileentitypiston, double d, double d1, double d2, 
        float f)
{
    Block block = Block.blocksList[tileentitypiston.getStoredBlockID()];
    if(block != null && tileentitypiston.func_31008_a(f) < 1.0F)
    {
        Tessellator tessellator = Tessellator.instance;
        if(block.getRenderBlockPass()==2)
        {
            bindTextureByName("/betaexpansion/be_blocks.png");
        }else
        {
        	bindTextureByName("/terrain.png");
        }
        RenderHelper.disableStandardItemLighting();
        GL11.glBlendFunc(770, 771);
        GL11.glEnable(3042 /*GL_BLEND*/);
        GL11.glDisable(2884 /*GL_CULL_FACE*/);
        if(Minecraft.isAmbientOcclusionEnabled())
        {
            GL11.glShadeModel(7425 /*GL_SMOOTH*/);
        } else
        {
            GL11.glShadeModel(7424 /*GL_FLAT*/);
        }
        tessellator.startDrawingQuads();
        tessellator.setTranslationD(((float)d - (float)tileentitypiston.xCoord) + tileentitypiston.func_31017_b(f), ((float)d1 - (float)tileentitypiston.yCoord) + tileentitypiston.func_31014_c(f), ((float)d2 - (float)tileentitypiston.zCoord) + tileentitypiston.func_31013_d(f));
        tessellator.setColorOpaque(1, 1, 1);
        if(block == Block.pistonExtension && tileentitypiston.func_31008_a(f) < 0.5F)
        {
            field_31071_b.renderPistonExtensionWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, false, false);
        } else
        if(block == BEBlocks.launcherExtension && tileentitypiston.func_31008_a(f) < 0.5F)
        {
        	field_31071_b.renderPistonExtensionWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, false, true);
        }else
        if(tileentitypiston.func_31012_k() && !tileentitypiston.func_31015_b())
        {
            Block.pistonExtension.func_31052_a_(((BlockPistonBase)block).func_31040_i());
            if(block == BEBlocks.launcherBase || block == BEBlocks.launcherExtension)
            {
            	field_31071_b.renderPistonExtensionWithAllFaces(BEBlocks.launcherExtension, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, tileentitypiston.func_31008_a(f) < 0.5F, true);
            }else
            {
            	field_31071_b.renderPistonExtensionWithAllFaces(Block.pistonExtension, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord, tileentitypiston.func_31008_a(f) < 0.5F, false);
            }
            Block.pistonExtension.func_31051_a();
            tessellator.setTranslationD((float)d - (float)tileentitypiston.xCoord, (float)d1 - (float)tileentitypiston.yCoord, (float)d2 - (float)tileentitypiston.zCoord);
            field_31071_b.renderPistonBaseWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord);
        } else
        {
            field_31071_b.renderBlockWithAllFaces(block, tileentitypiston.xCoord, tileentitypiston.yCoord, tileentitypiston.zCoord);
        }
        tessellator.setTranslationD(0.0D, 0.0D, 0.0D);
        tessellator.draw();
        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:59,代码来源:TileEntityRendererPiston.java

示例12: renderBeams

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderBeams(float age, int number, int startRBG, int endRGB, float size) {
	GL11.glDisable(GL11.GL_TEXTURE_2D);
	GL11.glShadeModel(GL11.GL_SMOOTH);
	GL11.glDisable(GL11.GL_ALPHA_TEST);

	BEAM_RAND.setSeed(432L);
	float r_ = (startRBG >>> 16 & 0xFF) / 256F;
	float g_ = (startRBG >>> 8 & 0xFF) / 256F;
	float b_ = (startRBG & 0xFF) / 256F;

	float r = (endRGB >>> 16 & 0xFF) / 256F;
	float g = (endRGB >>> 8 & 0xFF) / 256F;
	float b = (endRGB & 0xFF) / 256F;

	Tessellator tessellator = Tessellator.getInstance();
	BufferBuilder bufferbuilder = tessellator.getBuffer();
	float rotation = age % 500;

	for(int i = 0; (float) i < number; ++i) {
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
		GlStateManager.rotate(BEAM_RAND.nextFloat() * 360.0F + rotation * 90.0F, 0.0F, 0.0F, 1.0F);
		float min = (size * 0.5F);
		float resized = BEAM_RAND.nextFloat() * size + min;
		float sizeMulti = BEAM_RAND.nextFloat() * min + (min * 0.5F);
		bufferbuilder.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
		bufferbuilder.pos(0.0D, 0.0D, 0.0D).color(r_, g_, b_, 1F).endVertex();
		bufferbuilder.pos(-0.866D *  sizeMulti,  resized,  (-0.5F * sizeMulti)).color(r, g, b, 0F).endVertex();
		bufferbuilder.pos(0.866D *  sizeMulti,  resized,  (-0.5F * sizeMulti)).color(r, g, b, 0F).endVertex();
		bufferbuilder.pos(0.0D,  resized,  (1.0F * sizeMulti)).color(r, g, b, 0F).endVertex();
		bufferbuilder.pos(-0.866D *  sizeMulti,  resized,  (-0.5F * sizeMulti)).color(r, g, b, 0F).endVertex();
		tessellator.draw();
	}

	GL11.glEnable(GL11.GL_ALPHA_TEST);
	GL11.glShadeModel(GL11.GL_FLAT);
	GL11.glEnable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:ArekkuusuJerii,项目名称:Solar,代码行数:42,代码来源:RenderHelper.java


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