List of usage examples for org.lwjgl.opengl GL11 glShadeModel
public static native void glShadeModel(@NativeType("GLenum") int mode);
From source file:org.fenggui.binding.render.lwjgl.LWJGLOpenGL.java
License:Open Source License
public void setupStateVariables(boolean depthTestEnabled) { GL11.glEnable(GL11.GL_BLEND);//from w w w. j ava 2 s .c om // GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if (depthTestEnabled) GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_DITHER); GL11.glEnable(GL11.GL_SCISSOR_TEST); //GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL); GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); GL11.glDisable(GL11.GL_LINE_STIPPLE); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); 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); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL); //GL11.glDisable(GL11.GL_TEXTURE_GEN_S); GL11.glDisable(GL11.GL_CULL_FACE); // GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glFrontFace(GL11.GL_CW); GL11.glCullFace(GL11.GL_BACK); // disabling textures after setting state values. They would // be ignored otherwise (i think) GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_TEXTURE_1D); }
From source file:org.fenggui.render.lwjgl.LWJGLOpenGL.java
License:Open Source License
public void setupStateVariables(boolean depthTestEnabled) { GL11.glEnable(GL11.GL_BLEND);/* w w w. j a v a 2 s. co m*/ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); if (depthTestEnabled) GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_DITHER); GL11.glEnable(GL11.GL_SCISSOR_TEST); //GL11.glPolygonMode(GL11.GL_FRONT, GL11.GL_FILL); GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glDisable(GL11.GL_LINE_STIPPLE); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); 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); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL); //GL11.glDisable(GL11.GL_TEXTURE_GEN_S); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glFrontFace(GL11.GL_CW); GL11.glCullFace(GL11.GL_BACK); // disabling textures after setting state values. They would // be ignored otherwise (i think) GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_TEXTURE_1D); }
From source file:org.free.jake2.render.lwjgl.Light.java
License:Open Source License
/** * R_RenderDlights/*from w w w.j a v a 2s. co m*/ */ void R_RenderDlights() { if (gl_flashblend.value == 0) { return; } r_dlightframecount = r_framecount + 1; // because the count hasn't // advanced yet for this frame GL11.glDepthMask(false); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); for (int i = 0; i < r_newrefdef.num_dlights; i++) { R_RenderDlight(r_newrefdef.dlights[i]); } GL11.glColor3f(1, 1, 1); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(true); }
From source file:org.free.jake2.render.lwjgl.Mesh.java
License:Open Source License
/** * R_DrawAliasModel//ww w . j a va2 s . co m */ void R_DrawAliasModel(entity_t e) { if ((e.flags & Defines.RF_WEAPONMODEL) == 0) { if (R_CullAliasModel(e)) { return; } } if ((e.flags & Defines.RF_WEAPONMODEL) != 0) { if (r_lefthand.value == 2.0f) { return; } } qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; // // get lighting information // // PMM - rewrote, reordered to handle new shells & mixing // PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy // int i; if ((currententity.flags & (Defines.RF_SHELL_HALF_DAM | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_RED | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE)) != 0) { Math3D.VectorClear(shadelight); if ((currententity.flags & Defines.RF_SHELL_HALF_DAM) != 0) { shadelight[0] = 0.56f; shadelight[1] = 0.59f; shadelight[2] = 0.45f; } if ((currententity.flags & Defines.RF_SHELL_DOUBLE) != 0) { shadelight[0] = 0.9f; shadelight[1] = 0.7f; } if ((currententity.flags & Defines.RF_SHELL_RED) != 0) { shadelight[0] = 1.0f; } if ((currententity.flags & Defines.RF_SHELL_GREEN) != 0) { shadelight[1] = 1.0f; } if ((currententity.flags & Defines.RF_SHELL_BLUE) != 0) { shadelight[2] = 1.0f; } } else if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) { for (i = 0; i < 3; i++) { shadelight[i] = 1.0f; } } else { R_LightPoint(currententity.origin, shadelight); // player lighting hack for communication back to server // big hack! if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0) { // pick the greatest component, which should be the same // as the mono value returned by software if (shadelight[0] > shadelight[1]) { if (shadelight[0] > shadelight[2]) { r_lightlevel.value = 150 * shadelight[0]; } else { r_lightlevel.value = 150 * shadelight[2]; } } else { if (shadelight[1] > shadelight[2]) { r_lightlevel.value = 150 * shadelight[1]; } else { r_lightlevel.value = 150 * shadelight[2]; } } } if (gl_monolightmap.string.charAt(0) != '0') { float s = shadelight[0]; if (s < shadelight[1]) { s = shadelight[1]; } if (s < shadelight[2]) { s = shadelight[2]; } shadelight[0] = s; shadelight[1] = s; shadelight[2] = s; } } if ((currententity.flags & Defines.RF_MINLIGHT) != 0) { for (i = 0; i < 3; i++) { if (shadelight[i] > 0.1f) { break; } } if (i == 3) { shadelight[0] = 0.1f; shadelight[1] = 0.1f; shadelight[2] = 0.1f; } } if ((currententity.flags & Defines.RF_GLOW) != 0) { // bonus items will pulse with time float scale; float min; scale = (float) (0.1f * Math.sin(r_newrefdef.time * 7)); for (i = 0; i < 3; i++) { min = shadelight[i] * 0.8f; shadelight[i] += scale; if (shadelight[i] < min) { shadelight[i] = min; } } } // ================= // PGM ir goggles color override if ((r_newrefdef.rdflags & Defines.RDF_IRGOGGLES) != 0 && (currententity.flags & Defines.RF_IR_VISIBLE) != 0) { shadelight[0] = 1.0f; shadelight[1] = 0.0f; shadelight[2] = 0.0f; } // PGM // ================= shadedots = r_avertexnormal_dots[((int) (currententity.angles[1] * (SHADEDOT_QUANT / 360.0))) & (SHADEDOT_QUANT - 1)]; float an = (float) (currententity.angles[1] / 180 * Math.PI); shadevector[0] = (float) Math.cos(-an); shadevector[1] = (float) Math.sin(-an); shadevector[2] = 1; Math3D.VectorNormalize(shadevector); // // locate the proper data // c_alias_polys += paliashdr.num_tris; // // draw all the triangles // if ((currententity.flags & Defines.RF_DEPTHHACK) != 0) // hack the depth range to prevent view model from poking into walls { GL11.glDepthRange(gldepthmin, gldepthmin + 0.3 * (gldepthmax - gldepthmin)); } if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0f)) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glScalef(-1, 1, 1); MYgluPerspective(r_newrefdef.fov_y, (float) r_newrefdef.width / r_newrefdef.height, 4, 4096); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glCullFace(GL11.GL_BACK); } GL11.glPushMatrix(); e.angles[PITCH] = -e.angles[PITCH]; // sigh. R_RotateForEntity(e); e.angles[PITCH] = -e.angles[PITCH]; // sigh. image_t skin; // select skin if (currententity.skin != null) { skin = currententity.skin; // custom player skin } else { if (currententity.skinnum >= qfiles.MAX_MD2SKINS) { skin = currentmodel.skins[0]; } else { skin = currentmodel.skins[currententity.skinnum]; if (skin == null) { skin = currentmodel.skins[0]; } } } if (skin == null) { skin = r_notexture; // fallback... } GL_Bind(skin.texnum); // draw it GL11.glShadeModel(GL11.GL_SMOOTH); GL_TexEnv(GL11.GL_MODULATE); if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { GL11.glEnable(GL11.GL_BLEND); } if ((currententity.frame >= paliashdr.num_frames) || (currententity.frame < 0)) { VID.Printf(Defines.PRINT_ALL, "R_DrawAliasModel " + currentmodel.name + ": no such frame " + currententity.frame + '\n'); currententity.frame = 0; currententity.oldframe = 0; } if ((currententity.oldframe >= paliashdr.num_frames) || (currententity.oldframe < 0)) { VID.Printf(Defines.PRINT_ALL, "R_DrawAliasModel " + currentmodel.name + ": no such oldframe " + currententity.oldframe + '\n'); currententity.frame = 0; currententity.oldframe = 0; } if (r_lerpmodels.value == 0.0f) { currententity.backlerp = 0; } GL_DrawAliasFrameLerp(paliashdr, currententity.backlerp); GL_TexEnv(GL11.GL_REPLACE); GL11.glShadeModel(GL11.GL_FLAT); GL11.glPopMatrix(); if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0F)) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glCullFace(GL11.GL_FRONT); } if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { GL11.glDisable(GL11.GL_BLEND); } if ((currententity.flags & Defines.RF_DEPTHHACK) != 0) { GL11.glDepthRange(gldepthmin, gldepthmax); } if (gl_shadows.value != 0.0f && (currententity.flags & (Defines.RF_TRANSLUCENT | Defines.RF_WEAPONMODEL)) == 0) { GL11.glPushMatrix(); R_RotateForEntity(e); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(0, 0, 0, 0.5f); GL_DrawAliasShadow(paliashdr, currententity.frame); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); } GL11.glColor4f(1, 1, 1, 1); }
From source file:org.free.jake2.render.lwjgl.Misc.java
License:Open Source License
void GL_SetDefaultState() { GL11.glClearColor(1f, 0f, 0.5f, 0.5f); // original quake2 //GL11.glClearColor(0, 0, 0, 0); // replaced with black GL11.glCullFace(GL11.GL_FRONT);/* w w w. j av a 2 s . c om*/ GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0.666f); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glColor4f(1, 1, 1, 1); GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL); GL11.glShadeModel(GL11.GL_FLAT); GL_TextureMode(gl_texturemode.string); GL_TextureAlphaMode(gl_texturealphamode.string); GL_TextureSolidMode(gl_texturesolidmode.string); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_min); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL_TexEnv(GL11.GL_REPLACE); if (qglPointParameterfEXT) { // float[] attenuations = { gl_particle_att_a.value, gl_particle_att_b.value, gl_particle_att_c.value }; FloatBuffer att_buffer = BufferUtils.createFloatBuffer(4); att_buffer.put(0, gl_particle_att_a.value); att_buffer.put(1, gl_particle_att_b.value); att_buffer.put(2, gl_particle_att_c.value); GL11.glEnable(GL11.GL_POINT_SMOOTH); GL14.glPointParameterf(EXTPointParameters.GL_POINT_SIZE_MIN_EXT, gl_particle_min_size.value); GL14.glPointParameterf(EXTPointParameters.GL_POINT_SIZE_MAX_EXT, gl_particle_max_size.value); GL14.glPointParameter(EXTPointParameters.GL_DISTANCE_ATTENUATION_EXT, att_buffer); } if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f) { GL11.glEnable(EXTSharedTexturePalette.GL_SHARED_TEXTURE_PALETTE_EXT); GL_SetTexturePalette(d_8to24table); } GL_UpdateSwapInterval(); /* * vertex array extension */ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); GL13.glClientActiveTexture(GL_TEXTURE0); GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); }
From source file:org.getspout.spout.gui.about.GuiAbout.java
License:LGPL
@Override public void drawScreen(int x, int y, float z) { super.drawBackground(0); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glDisable(2912 /*GL_FOG*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); bg.setTopColor(background1);//from w w w . j a va 2 s .c om bg.setBottomColor(background2); bg.setY(30); bg.setHeight(this.height - 50); bg.setX(0); bg.setWidth(this.width - 12); bg.render(); scrollArea.setY(30); scrollArea.setHeight(this.height - 50); scrollArea.setX(this.width - 12); scrollArea.setWidth(16); scrollArea.setTopColor(scrollBarColor); scrollArea.setBottomColor(scrollBarColor2); scrollArea.render(); drawScaledString("What is Spoutcraft?", this.width / 2 - 200, this.height, 0xffffff); drawScaledString("Spoutcraft is a modified Minecraft client", this.width / 2 - 200, this.height + 10, 0x808080); drawScaledString("that plays exactly like the official game.", this.width / 2 - 200, this.height + 20, 0x808080); drawScaledString("Its goal is to give modders an easy to", this.width / 2 - 200, this.height + 30, 0x808080); drawScaledString("use development platform for building", this.width / 2 - 200, this.height + 40, 0x808080); drawScaledString("and distributing mods, as well as a ", this.width / 2 - 200, this.height + 50, 0x808080); drawScaledString("providing a rich experience for players.", this.width / 2 - 200, this.height + 60, 0x808080); drawScaledString("What is Spout?", this.width / 2 - 200, this.height + 90, 0xffffff); drawScaledString("Spout is a Bukkit plugin that gives ", this.width / 2 - 200, this.height + 100, 0x808080); drawScaledString("developers an advanced server", this.width / 2 - 200, this.height + 110, 0x808080); drawScaledString("development platform that allows previouly ", this.width / 2 - 200, this.height + 120, 0x808080); drawScaledString("impossible tasks, such as custom items,", this.width / 2 - 200, this.height + 130, 0x808080); drawScaledString("blocks, mobs, animals, and vehicles. ", this.width / 2 - 200, this.height + 140, 0x808080); drawScaledString("Who is SpoutDev?", this.width / 2 - 200, this.height + 170, 0xffffff); drawScaledString("SpoutDev is the team behind Spout, ", this.width / 2 - 200, this.height + 180, 0x808080); drawScaledString("SpoutAPI, Spoutcraft and SpoutcraftAPI.", this.width / 2 - 200, this.height + 190, 0x808080); drawScaledString("Sponsors", this.width / 2 + 30, this.height, 0xffffff); drawScaledString("Team", this.width / 2 + 30, this.height + 90, 0xffffff); drawScaledString("Afforess - Lead Developer", this.width / 2 + 30, this.height + 100, 0x808080); drawScaledString("Wulfspider - Co-Lead & Support", this.width / 2 + 30, this.height + 110, 0x808080); drawScaledString("alta189 - Co-Lead & Developer", this.width / 2 + 30, this.height + 120, 0x808080); drawScaledString("Top_Cat - Developer", this.width / 2 + 30, this.height + 130, 0x808080); drawScaledString("Raphfrk - Developer", this.width / 2 + 30, this.height + 140, 0x808080); drawScaledString("narrowtux - Developer", this.width / 2 + 30, this.height + 150, 0x808080); drawScaledString("Olloth - Developer", this.width / 2 + 30, this.height + 160, 0x808080); drawScaledString("Email: dev@getspout.org", this.width / 2 + 30, this.height + 170, 0x808080); drawScaledString("Website: getspout.org", this.width / 2 + 30, this.height + 180, 0x808080); drawScaledString("IRC: #spout in Esper.net", this.width / 2 + 30, this.height + 190, 0x808080); drawScaledString("Move along, nothing to see here.", 40, this.height * 5, 0x808080); GL11.glDisable(2896 /*GL_LIGHTING*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int var11 = this.mc.renderEngine.getTexture("/gui/allitems.png"); this.mc.renderEngine.bindTexture(var11); RenderUtil.drawTexturedModalRectangle(this.width - 14, getInvertedScaledHeight(this.height - 5), 0, 208, 16, 16, 0f); GL11.glDisable(2912 /*GL_FOG*/); GL11.glDisable(2929 /*GL_DEPTH_TEST*/); this.overlayBackground(0, 30, 255, 255); this.overlayBackground(this.height - 50, this.height, 255, 255); drawCenteredString(this.fontRenderer, "About", this.width / 2, 16, 0xffffff); GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/title/mclogo.png")); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glScalef(0.4f, 0.4f, 0.4f); this.drawTexturedModalRect((int) (0.23f * this.width), (int) (this.height * 2.1f), 0, 0, 155, 44); this.drawTexturedModalRect((int) (0.23f * this.width) + 155, (int) (this.height * 2.1f), 0, 45, 155, 44); GL11.glScalef(1 / .4f, 1 / .4f, 1 / .4f); //undo scale above if (textureBinding != null) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef((0.685f * this.width), (this.height * 0.83f), 0); // moves texture into place GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureBinding.getTextureID()); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, 32, -90, 0.0D, 0.0D); // draw corners tessellator.addVertexWithUV(128, 32, -90, textureBinding.getWidth(), 0.0D); tessellator.addVertexWithUV(128, 0.0D, -90, textureBinding.getWidth(), textureBinding.getHeight()); tessellator.addVertexWithUV(0.0D, 0.0D, -90, 0.0D, textureBinding.getHeight()); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); } drawString(this.fontRenderer, "Beta 1.8.1", (int) (this.width * 0.097f), this.height - 20, 0xffffff); drawString(this.fontRenderer, "Copyright Mojang AB", (int) (this.width * 0.097f), this.height - 10, 0x808080); drawString(this.fontRenderer, SpoutClient.getClientVersion().toString(), (int) (this.width * 0.8713f), this.height - 20, 0xffffff); drawString(this.fontRenderer, "Licensed under LGPLv3", (int) (this.width * 0.695f), this.height - 10, 0x808080); getControlList().get(0).xPosition = this.width / 2 - 45; getControlList().get(0).yPosition = this.height - 25; getControlList().get(0).drawButton(this.mc, x, y); //super.drawScreen(x, x, z); //Shadow magic GL11.glEnable(3042 /*GL_BLEND*/); GL11.glBlendFunc(770, 771); GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glShadeModel(7425 /*GL_SMOOTH*/); GL11.glDisable(3553 /*GL_TEXTURE_2D*/); Tessellator var16 = Tessellator.instance; byte var19 = 4; var16.startDrawingQuads(); var16.setColorRGBA_I(0, 0); var16.addVertexWithUV(0, (double) (30 + var19), 0.0D, 0.0D, 1.0D); var16.addVertexWithUV(this.width - 12, (double) (30 + var19), 0.0D, 1.0D, 1.0D); var16.setColorRGBA_I(0, 255); var16.addVertexWithUV(this.width - 12, 30, 0.0D, 1.0D, 0.0D); var16.addVertexWithUV(0, 30, 0.0D, 0.0D, 0.0D); var16.draw(); var16.startDrawingQuads(); var16.setColorRGBA_I(0, 255); var16.addVertexWithUV(0, this.height - 50, 0.0D, 0.0D, 1.0D); var16.addVertexWithUV(this.width - 12, this.height - 50, 0.0D, 1.0D, 1.0D); var16.setColorRGBA_I(0, 0); var16.addVertexWithUV(this.width - 12, (double) (this.height - 50 - var19), 0.0D, 1.0D, 0.0D); var16.addVertexWithUV(0, (double) (this.height - 50 - var19), 0.0D, 0.0D, 0.0D); var16.draw(); }
From source file:org.getspout.spout.gui.GenericGradient.java
License:Open Source License
@Override public void render() { GL11.glDisable(3553 /*GL_TEXTURE_2D*/); GL11.glEnable(3042 /*GL_BLEND*/); GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glBlendFunc(770, 771);/* w ww . jav a 2s . c o m*/ GL11.glShadeModel(7425 /*GL_SMOOTH*/); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(color1.getRedF(), color1.getGreenF(), color1.getBlueF(), color1.getAlphaF()); tessellator.addVertex(getWidth() + getScreenX(), getScreenY(), 0.0D); tessellator.addVertex(getScreenX(), getScreenY(), 0.0D); tessellator.setColorRGBA_F(color2.getRedF(), color2.getGreenF(), color2.getBlueF(), color2.getAlphaF()); tessellator.addVertex(getScreenX(), getHeight() + getScreenY(), 0.0D); tessellator.addVertex(getWidth() + getScreenX(), getHeight() + getScreenY(), 0.0D); tessellator.draw(); GL11.glShadeModel(7424 /*GL_FLAT*/); GL11.glDisable(3042 /*GL_BLEND*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); }
From source file:org.jtrfp.mtmx.tools.internal.TruckViewerConfiguration.java
License:Open Source License
@Override public void initLight() { GL11.glEnable(GL11.GL_LIGHTING);/* ww w. j ava 2s. com*/ float[] vec = new float[] { 1.0f, 1.0f, 1.0f, 1.0f }; // XXX: FloatBuffer must have 4 additional floats free FloatBuffer diffBuffer = BufferUtils.createFloatBuffer(vec.length + 4); diffBuffer.put(vec); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT_AND_DIFFUSE, diffBuffer); GL11.glEnable(GL11.GL_LIGHT0); GL11.glShadeModel(GL11.GL_FLAT); }
From source file:org.jtrfp.mtmx.tools.internal.WorldViewerConfiguration.java
License:Open Source License
@Override public void initLight() { GL11.glEnable(GL11.GL_LIGHTING);//from ww w . j a va 2 s .co m // XXX: FloatBuffer must have 4 additional floats free float[] amb = new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }; FloatBuffer ambientBuffer = EngineUtil.createFloatBuffer(amb); GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, ambientBuffer); // XXX: FloatBuffer must have 4 additional floats free float[] vec = new float[] { 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }; FloatBuffer diffBuffer = EngineUtil.createFloatBuffer(vec); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, diffBuffer); GL11.glEnable(GL11.GL_LIGHT0); GL11.glShadeModel(GL11.GL_FLAT); }
From source file:org.jtrfp.mtmx.tools.internal.WorldViewerConfiguration.java
License:Open Source License
@Override public void initView() { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity();//from w w w .jav a 2 s . c o m GL11.glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0f, 150 * IDrawer.WORLD_SCALE_XZ); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glCullFace(GL11.GL_BACK); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glEnable(GL11.GL_TEXTURE_2D); }