Java Code Examples for org.lwjgl.opengl.GL11#glTexEnvf()
The following examples show how to use
org.lwjgl.opengl.GL11#glTexEnvf() .
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: LightningRenderer.java From tribaltrouble with GNU General Public License v2.0 | 6 votes |
private static void render(RenderQueues render_queues, Lightning lightning) { if (Globals.isBoundsEnabled(Globals.BOUNDING_PLAYERS)) { RenderTools.draw(lightning, 1f, 1f, 1f); } GL11.glBindTexture(GL11.GL_TEXTURE_2D, render_queues.getTexture(lightning.getTexture()).getHandle()); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glBegin(GL11.GL_QUADS); List particles = lightning.getParticles(); for (int i = particles.size() - 1; i >= 0; i--) { StretchParticle particle = (StretchParticle)particles.get(i); render2DParticle(particle); } GL11.glEnd(); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); }
Example 2
Source File: GUIRoot.java From tribaltrouble with GNU General Public License v2.0 | 6 votes |
protected final void renderGeometry() { getDelegate().render2D(); Skin.getSkin().bindTexture(); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glColor3f(1f, 1f, 1f); GL11.glBegin(GL11.GL_QUADS); // MUST END IN POSTRENDER! // render forced delegates for (int i = 0; i < delegate_stack.size() - 1; i++) { CameraDelegate delegate = (CameraDelegate)delegate_stack.get(i); if (delegate.forceRender()) { delegate.render(); } } }
Example 3
Source File: BlendLighting.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
public final void setup() { GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glColor3f(r, b, g); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glEnable(GL11.GL_TEXTURE_2D); bindAlpha(); GLState.activeTexture(GL13.GL_TEXTURE0); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_ONE); }
Example 4
Source File: Renderer.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
public final static void initGL() { VBO.releaseAll(); GL11.glFrontFace(GL11.GL_CCW); GL11.glCullFace(GL11.GL_BACK); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPixelStorei(GL11.GL_PACK_ROW_LENGTH, 0); GL11.glPixelStorei(GL11.GL_PACK_SKIP_PIXELS, 0); GL11.glPixelStorei(GL11.GL_PACK_SKIP_ROWS, 0); GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); GL11.glPixelStorei(GL11.GL_PACK_SWAP_BYTES, 0); GL11.glPixelStorei(GL11.GL_UNPACK_ROW_LENGTH, 0); GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_PIXELS, 0); GL11.glPixelStorei(GL11.GL_UNPACK_SKIP_ROWS, 0); GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); GL11.glPixelStorei(GL11.GL_UNPACK_SWAP_BYTES, 0); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glShadeModel(GL11.GL_SMOOTH); // GL11.glAlphaFunc(GL11.GL_GREATER, Globals.ALPHA_CUTOFF); // Setup landscape texture coordinate gen GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL); GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); GLState.activeTexture(GL13.GL_TEXTURE0); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPointSize(7.0f); clearScreen(); GL11.glClearDepth(1.0); }
Example 5
Source File: ShadowRenderer.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
protected static void setupShadows() { VBO.releaseIndexVBO(); GL11.glEnable(GL11.GL_BLEND); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glDepthFunc(GL11.GL_EQUAL); GLStateStack.switchState(GLState.VERTEX_ARRAY); GL11.glEnable(GL11.GL_TEXTURE_GEN_S); GL11.glEnable(GL11.GL_TEXTURE_GEN_T); // Workaround, See comment in renderShadow GL11.glMatrixMode(GL11.GL_TEXTURE); }
Example 6
Source File: ShadowRenderer.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
protected static void resetShadows() { // Workaround, See comment in renderShadow GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_TEXTURE_GEN_S); GL11.glDisable(GL11.GL_TEXTURE_GEN_T); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glDisable(GL11.GL_BLEND); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); }
Example 7
Source File: Sprite.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
private final void doSetup(FloatBuffer color, int tex_index, boolean respond, boolean modulate_color) { int gl_flags = setupBasic(); GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures[tex_index][TEXTURE_NORMAL].getHandle()); if (modulate_color) { GL11.glAlphaFunc(GL11.GL_GREATER, 0f); GL11.glEnable(GL11.GL_BLEND); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); } else if (Globals.draw_light && lighted) { gl_flags = gl_flags | GLState.NORMAL_ARRAY; GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GL11.glEnable(GL11.GL_LIGHTING); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_DIFFUSE, color); } GL11.glColor4f(color.get(0), color.get(1), color.get(2), color.get(3)); if (!modulate_color && (hasTeamDecal() || respond)) { gl_flags = gl_flags | GLState.TEXCOORD1_ARRAY; setupTeamDecal(); if (respond) { GL11.glBindTexture(GL11.GL_TEXTURE_2D, respond_texture.getHandle()); } else { GL11.glBindTexture(GL11.GL_TEXTURE_2D, textures[tex_index][TEXTURE_TEAM].getHandle()); } GLState.clientActiveTexture(GL13.GL_TEXTURE1); texcoords.texCoordPointer(2, 0, 0); GLState.clientActiveTexture(GL13.GL_TEXTURE0); } GLStateStack.switchState(gl_flags); }
Example 8
Source File: Sprite.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
public final void reset(boolean respond, boolean modulate_color) { if (!modulate_color && (hasTeamDecal() || respond)) { resetTeamDecal(); } if (modulate_color) { GL11.glDisable(GL11.GL_BLEND); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); } else if (Globals.draw_light && lighted) { GL11.glDisable(GL11.GL_LIGHTING); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); } resetBasic(); }
Example 9
Source File: Sky.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
private final void setupSky() { float time = LocalEventQueue.getQueue().getTime(); float speed_scale = 0.01f; float outer_dx = SKYDOME_SPEED_OUTER[0] * time*speed_scale; float outer_dy = SKYDOME_SPEED_OUTER[1] * time*speed_scale; float inner_dx = SKYDOME_SPEED_INNER[0] * time*speed_scale; float inner_dy = SKYDOME_SPEED_INNER[1] * time*speed_scale; GL11.glBindTexture(GL11.GL_TEXTURE_2D, clouds[GeneratorClouds.INNER].getHandle()); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_BLEND); GL11.glTexEnv(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_COLOR, color); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glTranslatef(outer_dx, outer_dy, 0); GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glBindTexture(GL11.GL_TEXTURE_2D, clouds[GeneratorClouds.OUTER].getHandle()); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glTranslatef(inner_dx, inner_dy, 0); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_BLEND); GL11.glTexEnv(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_COLOR, color); GLStateStack.switchState(GLState.VERTEX_ARRAY | GLState.COLOR_ARRAY | GLState.TEXCOORD0_ARRAY | GLState.TEXCOORD1_ARRAY); sky_vertices.vertexPointer(3, 0, 0); sky_tex0.texCoordPointer(2, 0, 0); sky_colors.colorPointer(3, 0, 0); GLState.clientActiveTexture(GL13.GL_TEXTURE1); sky_tex1.texCoordPointer(2, 0, 0); GLState.clientActiveTexture(GL13.GL_TEXTURE0); }
Example 10
Source File: Sky.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
private final void resetSky() { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glLoadIdentity(); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL); GLState.activeTexture(GL13.GL_TEXTURE0); GL11.glLoadIdentity(); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); GL11.glMatrixMode(GL11.GL_MODELVIEW); }
Example 11
Source File: GUIRoot.java From tribaltrouble with GNU General Public License v2.0 | 5 votes |
public final void renderTopmost() { if (Globals.draw_status) status.render(0, getWidth(), 0, getHeight()); GL11.glEnd(); // Started in renderGeometry() GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); if (cursor_object.getCursorIndex() != CURSOR_NULL) { cursors[cursor_object.getCursorIndex()].setActive(); if (getModalDelegate() != null || getDelegate().renderCursor()) { cursors[cursor_object.getCursorIndex()].render(LocalInput.getMouseX(), LocalInput.getMouseY()); } } else PointerInput.setActiveCursor(null); }
Example 12
Source File: IslandGenerator.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
private final static Texture[][] blendTextures(OffscreenRendererFactory factory, int chunks_per_colormap, BlendInfo[] blend_infos, int alpha_size, int structure_size, int scale) { boolean use_pbuffer = Settings.getSettings().usePbuffer(); boolean use_fbo = Settings.getSettings().useFBO(); OffscreenRenderer offscreen = factory.createRenderer(TEXELS_PER_CHUNK, TEXELS_PER_CHUNK, new PixelFormat(Globals.VIEW_BIT_DEPTH, 0, 0, 0, 0), Settings.getSettings().use_copyteximage, use_pbuffer, use_fbo); GL11.glColor4f(1f, 1f, 1f, 1f); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0f, TEXELS_PER_CHUNK, 0, TEXELS_PER_CHUNK, -1f, 1f); GL11.glMatrixMode(GL11.GL_TEXTURE); GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); GL11.glDisable(GL11.GL_TEXTURE_GEN_S); GL11.glDisable(GL11.GL_TEXTURE_GEN_T); GL11.glLoadIdentity(); GLState.activeTexture(GL13.GL_TEXTURE0); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); GL11.glDisable(GL11.GL_TEXTURE_GEN_S); GL11.glDisable(GL11.GL_TEXTURE_GEN_T); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); float alpha_texel_size = 1f/(alpha_size*scale); float structure_texel_size = 1f/structure_size; float structure_texels_per_chunk_border = Globals.TEXELS_PER_CHUNK_BORDER*structure_texel_size; float structure_offset = TEXELS_PER_CHUNK*structure_texel_size - 2*structure_texels_per_chunk_border; float structure_length = structure_offset + 2*structure_texels_per_chunk_border; float alpha_texels_per_chunk_border = Globals.TEXELS_PER_CHUNK_BORDER*alpha_texel_size; float alpha_offset = TEXELS_PER_CHUNK*alpha_texel_size; float alpha_length = alpha_offset + 2*alpha_texels_per_chunk_border; Texture[][] chunk_maps = new Texture[chunks_per_colormap][chunks_per_colormap]; FloatBuffer coordinates = BufferUtils.createFloatBuffer(4*3); coordinates.put(new float[]{0f, 0f, 0f, TEXELS_PER_CHUNK, 0f, 0f, TEXELS_PER_CHUNK, TEXELS_PER_CHUNK, 0f, 0f, TEXELS_PER_CHUNK, 0f}); coordinates.rewind(); FloatBuffer structure_tex_coords = BufferUtils.createFloatBuffer(4*2); FloatBuffer alpha_tex_coords = BufferUtils.createFloatBuffer(4*2); GLStateStack.switchState(GLState.VERTEX_ARRAY | GLState.TEXCOORD0_ARRAY | GLState.TEXCOORD1_ARRAY); GL11.glVertexPointer(3, 0, coordinates); GL11.glTexCoordPointer(2, 0, structure_tex_coords); GLState.clientActiveTexture(GL13.GL_TEXTURE1); GL11.glTexCoordPointer(2, 0, alpha_tex_coords); GLState.clientActiveTexture(GL13.GL_TEXTURE0); for (int y = 0; y < chunk_maps.length; y++) { for (int x = 0; x < chunk_maps[y].length; x++) { chunk_maps[y][x] = new Texture(TEXELS_PER_CHUNK, TEXELS_PER_CHUNK, GL11.GL_LINEAR_MIPMAP_NEAREST, GL11.GL_LINEAR, GL12.GL_CLAMP_TO_EDGE, GL12.GL_CLAMP_TO_EDGE, Globals.NO_MIPMAP_CUTOFF); int mip_scale = 1; int mip_level = 0; int mip_size = TEXELS_PER_CHUNK; while (mip_size >= 1) { GL11.glLoadIdentity(); GL11.glScalef(1f/mip_scale, 1f/mip_scale, 1f); GL11.glEnable(GL11.GL_BLEND); for (int i = 0; i < blend_infos.length; i++) { blend_infos[i].setup(); float structure_offset_u = x*structure_offset - structure_texels_per_chunk_border; float structure_offset_v = y*structure_offset - structure_texels_per_chunk_border; float alpha_offset_u = x*alpha_offset - alpha_texels_per_chunk_border; float alpha_offset_v = y*alpha_offset - alpha_texels_per_chunk_border; structure_tex_coords.put(0, structure_offset_u).put(1, structure_offset_v); structure_tex_coords.put(2, structure_offset_u + structure_length).put(3, structure_offset_v); structure_tex_coords.put(4, structure_offset_u + structure_length).put(5, structure_offset_v + structure_length); structure_tex_coords.put(6, structure_offset_u).put(7, structure_offset_v + structure_length); alpha_tex_coords.put(0, alpha_offset_u).put(1, alpha_offset_v); alpha_tex_coords.put(2, alpha_offset_u + alpha_length).put(3, alpha_offset_v); alpha_tex_coords.put(4, alpha_offset_u + alpha_length).put(5, alpha_offset_v + alpha_length); alpha_tex_coords.put(6, alpha_offset_u).put(7, alpha_offset_v + alpha_length); GL11.glDrawArrays(GL11.GL_QUADS, 0, 4); blend_infos[i].reset(); } /*if (mip_level == 0) offscreen.dumpToFile("colormap-" + x + "-" + y);*/ offscreen.copyToTexture(chunk_maps[y][x], mip_level, Globals.COMPRESSED_RGB_FORMAT, 0, 0, mip_size, mip_size); mip_scale <<= 1; mip_level++; mip_size >>= 1; } } } boolean succeeded = offscreen.destroy(); if (!succeeded) { /* for (int y = 0; y < chunk_maps.length; y++) for (int x = 0; x < chunk_maps[y].length; x++) chunk_maps[y][x].delete();*/ return null; } else return chunk_maps; }
Example 13
Source File: BlendLighting.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
public final void reset() { GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_REPLACE); GLState.activeTexture(GL13.GL_TEXTURE0); }
Example 14
Source File: Sprite.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
public final static void setupTeamDecal() { GLState.activeTexture(GL13.GL_TEXTURE1); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_BLEND); }
Example 15
Source File: Sprite.java From tribaltrouble with GNU General Public License v2.0 | 4 votes |
public final static void resetTeamDecal() { GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_DECAL); GL11.glDisable(GL11.GL_TEXTURE_2D); GLState.activeTexture(GL13.GL_TEXTURE0); }
Example 16
Source File: TrueTypeFont.java From ForbiddenMagic with Do What The F*ck You Want To Public License | 4 votes |
public static int loadImage(BufferedImage bufferedImage) { try { short width = (short)bufferedImage.getWidth(); short height = (short)bufferedImage.getHeight(); //textureLoader.bpp = bufferedImage.getColorModel().hasAlpha() ? (byte)32 : (byte)24; int bpp = (byte)bufferedImage.getColorModel().getPixelSize(); ByteBuffer byteBuffer; DataBuffer db = bufferedImage.getData().getDataBuffer(); if (db instanceof DataBufferInt) { int intI[] = ((DataBufferInt)(bufferedImage.getData().getDataBuffer())).getData(); byte newI[] = new byte[intI.length * 4]; for (int i = 0; i < intI.length; i++) { byte b[] = intToByteArray(intI[i]); int newIndex = i*4; newI[newIndex] = b[1]; newI[newIndex+1] = b[2]; newI[newIndex+2] = b[3]; newI[newIndex+3] = b[0]; } byteBuffer = ByteBuffer.allocateDirect( width*height*(bpp/8)) .order(ByteOrder.nativeOrder()) .put(newI); } else { byteBuffer = ByteBuffer.allocateDirect( width*height*(bpp/8)) .order(ByteOrder.nativeOrder()) .put(((DataBufferByte)(bufferedImage.getData().getDataBuffer())).getData()); } byteBuffer.flip(); int internalFormat = GL11.GL_RGBA8, format = GL11.GL_RGBA; IntBuffer textureId = BufferUtils.createIntBuffer(1);; GL11.glGenTextures(textureId); GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId.get(0)); 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.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); //GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_NEAREST); //GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR); //GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR); //GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_NEAREST); GL11.glTexEnvf(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE); GLU.gluBuild2DMipmaps(GL11.GL_TEXTURE_2D, internalFormat, width, height, format, GL11.GL_UNSIGNED_BYTE, byteBuffer); return textureId.get(0); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } return -1; }