List of usage examples for org.lwjgl.opengl GL11 glDisableClientState
public static native void glDisableClientState(@NativeType("GLenum") int cap);
From source file:a1.gui.GUI_Map.java
License:Open Source License
public void DrawTiles() { int x, y, i;// www . ja va2 s . com int stw, sth; Coord oc, tc, ctc, sc; RenderedTiles = 0; Render2D.ChangeColor(); Sprite.setStaticColor(); // ? ? stw = (TILE_SIZE * 4) - 2; sth = TILE_SIZE * 2; // ? ? Coord sz = scaled_size; oc = viewoffset(sz, mc); // ? ? tc = mc.div(TILE_SIZE); tc.x += -(sz.x / (2 * stw)) - (sz.y / (2 * sth)) - 2; tc.y += (sz.x / (2 * stw)) - (sz.y / (2 * sth)); if (needUpdateView) { needUpdateView = false; for (y = 0; y < (sz.y / sth) + 13; y++) { for (x = 0; x < (sz.x / stw) + 3; x++) { for (i = 0; i < 2; i++) { // ctc = tc.add(new Coord(x + y, y - x + i)); // ? sc = m2s(ctc.mul(TILE_SIZE)).add(oc); sc.x -= TILE_SIZE * 2; // // ? drawtile(ctc, sc); } } } // ? ? if (Config.tile_grid) { for (y = 0; y < (sz.y / sth) + 2; y++) { for (x = 0; x < (sz.x / stw) + 3; x++) { for (i = 0; i < 2; i++) { ctc = tc.add(new Coord(x + y, -x + y + i)); sc = m2s(ctc.mul(TILE_SIZE)).add(oc); drawtile_grid(sc); } } } } if (render_claims) { Color col; for (ClaimPersonal claim : Claims.claims.values()) { if (Player.CharID == claim.owner_id) { col = new Color(0f, 1f, 1f, 0.25f); // if (Claims.expand_claim != null) // continue; } else col = new Color(1f, 0f, 0f, 0.25f); putClaim(claim, oc, col); } if (Claims.expand_claim != null) { col = new Color(0f, 0f, 0.8f, 0.17f); putClaim(Claims.expand_claim, oc, col); } } // updateVBO(); } Color.white.bind(); GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, tile_vbo); GL11.glVertexPointer(2, GL11.GL_FLOAT, 16, 0L); GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 16, 8L); Resource.textures.get("tiles").bind(); GL11.glDrawArrays(GL11.GL_QUADS, 0, tile_drawCount); GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); if (render_claims) { GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, claim_vbo); GL11.glColorPointer(4, GL11.GL_FLOAT, 24, 0L); GL11.glVertexPointer(2, GL11.GL_FLOAT, 24, 16L); GL11.glDrawArrays(GL11.GL_QUADS, 0, claim_drawCount); GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); } if (Config.tile_grid) { GL11.glColor4f(0.0f, 0.0f, 0.0f, 0.4f); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, tileGrid_vbo); GL11.glVertexPointer(2, GL11.GL_FLOAT, 0, 0L); GL11.glDrawArrays(GL11.GL_LINES, 0, tileGrid_drawCount); } GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0); GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupVertexData(final FloatBufferData vertexBufferData) { final FloatBuffer vertexBuffer = vertexBufferData != null ? vertexBufferData.getBuffer() : null; if (vertexBuffer == null) { GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); } else {/*from ww w . ja v a2 s .co m*/ GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); vertexBuffer.rewind(); GL11.glVertexPointer(vertexBufferData.getValuesPerTuple(), 0, vertexBuffer); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupNormalData(final FloatBufferData normalBufferData) { final FloatBuffer normalBuffer = normalBufferData != null ? normalBufferData.getBuffer() : null; if (normalBuffer == null) { GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); } else {/* ww w .j ava 2s . c o m*/ GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); normalBuffer.rewind(); GL11.glNormalPointer(0, normalBuffer); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupColorData(final FloatBufferData colorBufferData) { final FloatBuffer colorBuffer = colorBufferData != null ? colorBufferData.getBuffer() : null; if (colorBuffer == null) { GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); } else {/*from www .j a v a 2 s . co m*/ GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); colorBuffer.rewind(); GL11.glColorPointer(colorBufferData.getValuesPerTuple(), 0, colorBuffer); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupFogData(final FloatBufferData fogBufferData) { final FloatBuffer fogBuffer = fogBufferData != null ? fogBufferData.getBuffer() : null; if (fogBuffer == null) { GL11.glDisableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT); } else {//from ww w .j av a2 s . co m GL11.glEnableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT); fogBuffer.rewind(); EXTFogCoord.glFogCoordPointerEXT(0, fogBuffer); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupTextureData(final List<FloatBufferData> textureCoords) { final RenderContext context = ContextManager.getCurrentContext(); final ContextCapabilities caps = context.getCapabilities(); final RendererRecord rendRecord = context.getRendererRecord(); final TextureState ts = (TextureState) context.getCurrentState(RenderState.StateType.Texture); int enabledTextures = rendRecord.getEnabledTextures(); final boolean valid = rendRecord.isTexturesValid(); boolean isOn, wasOn; if (ts != null) { final int max = caps.isMultitextureSupported() ? Math.min(caps.getNumberOfFragmentTexCoordUnits(), TextureState.MAX_TEXTURES) : 1;// w w w. j av a2 s . c o m for (int i = 0; i < max; i++) { wasOn = (enabledTextures & (2 << i)) != 0; isOn = textureCoords != null && i < textureCoords.size() && textureCoords.get(i) != null && textureCoords.get(i).getBuffer() != null; if (!isOn) { if (valid && !wasOn) { continue; } else { checkAndSetTextureArrayUnit(i, rendRecord, caps); // disable bit in tracking int enabledTextures &= ~(2 << i); // disable state GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); continue; } } else { checkAndSetTextureArrayUnit(i, rendRecord, caps); if (!valid || !wasOn) { // enable state GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); // enable bit in tracking int enabledTextures |= (2 << i); } final FloatBufferData textureBufferData = textureCoords.get(i); final FloatBuffer textureBuffer = textureBufferData.getBuffer(); GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); textureBuffer.rewind(); GL11.glTexCoordPointer(textureBufferData.getValuesPerTuple(), 0, textureBuffer); } } } rendRecord.setEnabledTextures(enabledTextures); rendRecord.setTexturesValid(true); }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupVertexDataVBO(final FloatBufferData data) { final RenderContext context = ContextManager.getCurrentContext(); final RendererRecord rendRecord = context.getRendererRecord(); final int vboID = setupVBO(data, context); if (vboID != 0) { GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); LwjglRendererUtil.setBoundVBO(rendRecord, vboID); GL11.glVertexPointer(data.getValuesPerTuple(), GL11.GL_FLOAT, 0, 0); } else {//from w w w . ja v a 2 s. c o m GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupNormalDataVBO(final FloatBufferData data) { final RenderContext context = ContextManager.getCurrentContext(); final RendererRecord rendRecord = context.getRendererRecord(); final int vboID = setupVBO(data, context); if (vboID != 0) { GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); LwjglRendererUtil.setBoundVBO(rendRecord, vboID); GL11.glNormalPointer(GL11.GL_FLOAT, 0, 0); } else {/* w w w . j a v a 2s .c o m*/ GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupColorDataVBO(final FloatBufferData data) { final RenderContext context = ContextManager.getCurrentContext(); final RendererRecord rendRecord = context.getRendererRecord(); final int vboID = setupVBO(data, context); if (vboID != 0) { GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); LwjglRendererUtil.setBoundVBO(rendRecord, vboID); GL11.glColorPointer(data.getValuesPerTuple(), GL11.GL_FLOAT, 0, 0); } else {//from ww w. j a va 2 s .c o m GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); } }
From source file:com.ardor3d.renderer.lwjgl.LwjglRenderer.java
License:Open Source License
public void setupFogDataVBO(final FloatBufferData data) { final RenderContext context = ContextManager.getCurrentContext(); final ContextCapabilities caps = context.getCapabilities(); if (!caps.isFogCoordinatesSupported()) { return;/*from w w w. j av a2 s .c o m*/ } final RendererRecord rendRecord = context.getRendererRecord(); final int vboID = setupVBO(data, context); if (vboID != 0) { GL11.glEnableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT); LwjglRendererUtil.setBoundVBO(rendRecord, vboID); EXTFogCoord.glFogCoordPointerEXT(GL11.GL_FLOAT, 0, 0); } else { GL11.glDisableClientState(EXTFogCoord.GL_FOG_COORDINATE_ARRAY_EXT); } }