Hello Guest

Re: Woes trying to get to grips with new-fangled stuff (SOLVED!)

  • 2 Replies
  • 4666 Views
After a bit of a break from programming, I have started a new FPS-type project going.  Was making nice headway, able to walk around a simple scene made of several areas with basic portal entity culling (rather pleased with myself for managing to work that out).  It then came to my attention that the code I was using (glBegin()/glEnd() stuff) is now old hat, I should be using these VBO and shader thingies instead.  It feels like I've been kicked down several flights of stairs... ouch.  :o

So I have to start over, trying to compile example code (TheQuadColoredExample), but it won't compile, just throws up a load of this:-

Code: [Select]
D:\Java\cruithne3753\games\TheQuadExampleColored.java:79: cannot find symbol
symbol  : method create(org.lwjgl.opengl.PixelFormat,org.lwjgl.opengl.ContextAttribs)
location: class org.lwjgl.opengl.Display
Display.create(pixelFormat, contextAtrributes);
      ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:135: glGenBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to ()
vboId = GL15.glGenBuffers();
           ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:142: glGenBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to ()
vbocId = GL15.glGenBuffers();
            ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:152: glGenBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to ()
vboiId = GL15.glGenBuffers();
            ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:174: glBindAttribLocation(int,int,java.nio.ByteBuffer) in org.lwjgl.opengl.GL20 cannot be applied to (int,int,java.lang.String)
GL20.glBindAttribLocation(pId, 0, "in_Position");
   ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:176: glBindAttribLocation(int,int,java.nio.ByteBuffer) in org.lwjgl.opengl.GL20 cannot be applied to (int,int,java.lang.String)
GL20.glBindAttribLocation(pId, 1, "in_Color");
   ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:233: glDeleteBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to (int)
GL15.glDeleteBuffers(vboId);
   ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:237: glDeleteBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to (int)
GL15.glDeleteBuffers(vbocId);
   ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:241: glDeleteBuffers(java.nio.IntBuffer) in org.lwjgl.opengl.GL15 cannot be applied to (int)
GL15.glDeleteBuffers(vboiId);
   ^
D:\Java\cruithne3753\games\TheQuadExampleColored.java:271: glShaderSource(int,java.nio.ByteBuffer) in org.lwjgl.opengl.GL20 cannot be applied to (int,java.lang.StringBuilder)
GL20.glShaderSource(shaderID, shaderSource);
   ^
10 errors

I'm using LWJGL 2.8.5, the jar files are dated 04/11/2012 (or 11/04/2012 if you're American!), JDK is 1.6.0_24... I'm sure this should be pretty up to date, how come there are different sets of function call parameters??!!

Thanks
Matt
« Last Edit: March 21, 2013, 18:48:08 by Cruithne3753 »

Re: Woes trying to get to grips with new-fangled stuff
« Reply #1 on: March 21, 2013, 16:58:04 »
I would double-check that you are using the version of LWJGL that you think you are using. The overloads for glGenBuffers, etc. were added a while ago (way before 2.8.5).
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Re: Woes trying to get to grips with new-fangled stuff (SOLVED!)
« Reply #2 on: March 21, 2013, 18:47:11 »
(Slaps head!)   Just realised I had a folder with LWJGL source code extracted to it which had been there a couple of years, it was shadowing the JARS!  Deleted it, it now compiles and runs!

Thanks for that pointer!

Matt