caps is null in GL15

Started by jbills, April 01, 2012, 21:23:22

Previous topic - Next topic

jbills

I am new to lwjgl and Opengl, so please tell me if I am being stupid, but when I attempt to use glGenBuffer in GL15 I get a NullPointerException. When I look at it, the variable that is null is caps. Am I doing something wrong, or is this a bug?

matheus23

try to check your OpenGL version, with
System.out.println(GL11.glGetString(GL_VERSION));

Just after creating your display.
If somthing less then 1.5 is print, your Drivers / Graphics Card does not support OpenGL Version 1.5.
My github account and currently active project: https://github.com/matheus23/UniverseEngine

kappa

Quote from: matheus23 on April 02, 2012, 09:15:57
try to check your OpenGL version, with
System.out.println(GL11.glGetString(GL_VERSION));

Just after creating your display.
If somthing less then 1.5 is print, your Drivers / Graphics Card does not support OpenGL Version 1.5.

Another way you can check if OpenGL 1.5 is supported is using the following

if(GLContext.getCapabilities().OpenGL15) {
    // OpenGL 1.5 supported
}

jbills

Quote from: kappa on April 02, 2012, 09:38:05
Quote from: matheus23 on April 02, 2012, 09:15:57
try to check your OpenGL version, with
System.out.println(GL11.glGetString(GL_VERSION));

Just after creating your display.
If somthing less then 1.5 is print, your Drivers / Graphics Card does not support OpenGL Version 1.5.

Another way you can check if OpenGL 1.5 is supported is using the following

if(GLContext.getCapabilities().OpenGL15) {
    // OpenGL 1.5 supported
}

I have tried that last version, but I think it is a problem with GLContext. I asked this question on stackexchange, and one of the answers was that GLContext was not thread safe as it claimed. The entire answer can be found here: http://stackoverflow.com/a/9970535/771790

jbills

Nevermind. I was being stupid. I was trying to run gl commands before creating a window. Sorry.