pasobtokyo.blogg.se

Pure java lwjgl
Pure java lwjgl







  1. #Pure java lwjgl drivers
  2. #Pure java lwjgl mac

The LWJGL site points you at the :maven-nativedependencies-plugin that will pull down all of the native dependencies for all projects that have them and put them in a suitable place. What I was not expecting to be easy was to get the native components working. Even getting LWJGL pulled in as a dependency was really easy – they publish their artifacts to Central so they just turn up with the correct dependency. All you need to do is to configure the maven-compiler-plugin to have a source and target of 1.8. (That’s a rant for another time).īuilding a Java 8 project in Maven is really easy. For me, this meant Maven – because I like Maven, and because all of the other build systems for Java just fall short in various ways. Ok, so, since I’ve restarted in Java using LWJGL, the first hurdle that I had to get past was a decent build system. Thankfully I’m not currently interested in any extensions so this is much less of a problem, and I’m not sure exactly what OpenGL version I want to target – quite possibly it will end up being 3.1 purely because of my laptop, but we’ll have to see…

#Pure java lwjgl mac

If I don’t request the Core Profile then I get access to all of the extensions that are available by the drivers, but on the Mac I only get access to OpenGL 2.1 as base. I’ve also discovered that if I request the Core Profile then I don’t get access to any extensions at all, which is what you’d expect. If I request OpenGL 3.2 and don’t request the Core Profile then I get a context that supports OpenGL 2.1 instead. When I tested this on a Mac running OS X 10.9, I discovered that if I request OpenGL 3.2 and request the Core Profile then I get a context that supports OpenGL 4.4.

#Pure java lwjgl drivers

The call to glGetString(GL_VERSION) returns the fact that 3.2 is available, even though the drivers can actually support much more than that. In this case though, if I request OpenGL 3.2 then what I get is OpenGL 3.2. My Linux desktop on the other hand, which has an NVidia GTK 460 is capable of OpenGL 4.4, so if I request a newer version I get an exception earlier because there is no newer version yet. On my Linux laptop, which has an Intel graphics chip and is only capable of OpenGL 3.1, if I request OpenGL 3.2 then I get an LWJGLException thrown from Display.create. Worse than that, the way that this reacts in different situations is different. Unfortunately, in order to find out what OpenGL version is available you need to have already created a Display, which means you don’t know what OpenGL versions are available to use until it’s too late. When using LWJGL, in order to request the OpenGL version you want to use you need to set up a ContextAttribs object correctly and pass it in to the call to Display.create() when you create the display to use.









Pure java lwjgl