Hi !
I'm writing a piece of code in order to render my model using VBOs and this :
vbos = BufferUtils.createIntBuffer(mats.size()*2); //mats.size() = 2
ARBVertexBufferObject.glGenBuffersARB(vbos);
throws a NullPointerException at org.lwjgl.opengl.ARBBufferObject.glGenBuffersARB(ARBBufferObject.java:59);
This line is :
long function_pointer = caps.ARB_buffer_object_glGenBuffersARB_pointer;
Is it something strange with GLContext.getCapabilities() ? Because this line throw a NullPointerException too :
if(GLContext.getCapabilities().GL_ARB_vertex_buffer_object){
// ...
}
I don't know what to do :-\
Thanks a lot for your help !
have you created the display or pbuffer first?
Yes, I guess...
I have a createWindow() function :
private void createWindow() throws Exception {
Display.setFullscreen(fullscreen);
DisplayMode d[] = Display.getAvailableDisplayModes();
for (int i = 0; i < d.length; i++) {
if (d[i].getWidth() == 640
&& d[i].getHeight() == 480
&& d[i].getBitsPerPixel() == 32) {
displayMode = d[i];
break;
}
}
Display.setDisplayMode(displayMode);
Display.setTitle(windowTitle);
Display.create();
}
yes, but are you sure that the method has been called first?
Oh, no :-[
You're right ! I called my function first in order to do some tests...
Thank you for the solution, Matzon ;)