java - Trouble with slick.util and lwjgl textures -
so i've started making simple 2-d java game using jlwgl , slick-util. ran problem when trying load in textures place on tiles. using slick util try , load textures in. method using so.
public static texture loadtex(string path, string filetype) { texture tex = null; inputstream in = resourceloader.getresourceasstream(path); try { tex = textureloader.gettexture(filetype, in); } catch (ioexception e) { e.printstacktrace(); } return tex; } i set variable "t" store variable check if texture loading works.
texture t = loadtex("res/grass64.png","png"); i use glquads method draw textured square.
public static void drawquadtex(texture tex, float x, float y, float width, float height) { tex.bind(); gltranslatef(x, y, 0); glbegin(gl_quads); gltexcoord2f(0, 0); glvertex2f(0, 0); gltexcoord2f(1, 0); glvertex2f(width, 0); gltexcoord2f(1, 1); glvertex2f(width, height); gltexcoord2f(0, 1); glvertex2f(0, height); glloadidentity(); glend(); } calling drawquadtex...
drawquadtex(t,0,0,64,64); i encountered error:
"exception in thread "main" java.lang.nosuchmethoderror: org.lwjgl.opengl.gl11.glgetinteger(iljava/nio/intbuffer;)v "
i'm not sure quite going on. assistance appreciated first attempt @ java that's not simple school assignment. if need post else, please let me know.
the slick-util library part of slick2d, deprecated , no longer compatible recent lwjgl versions such 1 appear using. why getting error.
Comments
Post a Comment