The Lightweight Java Game Library (LWJGL) provides access to high performance, cross-platform libraries OpenGL and OpenAL. Additionally LWJGL provides access to controllers such as Gamepads, Steering wheel and Joysticks.

learn more… | top users | synonyms

0
votes
0answers
15 views

GLFW - Event Polling System

I need some help on design. I'm making an event polling system, where a window is notified of events as they happen. I handle events at a system level in my GLFW backend, by using callbacks. ...
0
votes
1answer
26 views

glGenArrays - This functionality is not available

Whenever I call glGenVertexArrays(), I get the following exception: Exception in thread "main" java.lang.IllegalStateException: This functionality is not available. at ...
0
votes
0answers
27 views

Modern OpenGL Sprite Drawing - Not Rendering

I'm trying to render sprites based of this tutorial, in LWJGL. Here's what I have so far, with descriptions of what class I use: Transformable2D is a class that holds transform matrices meant for ...
0
votes
1answer
17 views

Triangle data structure not working for LoD algorithm

I would like to implement a LoD algorithm to my 3D game in order to simplify meshes at certain distances from the player. My meshes are created / loaded using a VBO, so the vertex data is stored in a ...
0
votes
0answers
15 views

GLFW/LWJGL black screen flicker issue

Im having a problem with creating a borderless fullscreen window in LWJGL using GLFW. It creates the (in this case black - as intended) window, however when the focus changes (f.e. tabbing int/out), ...
0
votes
1answer
39 views

Rendering a texture with OpenGL

I have an image (100x200 px) painted with Paint.NET and saved as a .png with 32-bits color depth. How can i render this image using OpenGL 1.1 (with the LWJGL binding) or higher inside the display? I ...
0
votes
0answers
36 views

Texture artifacts depending on texture size

I get some strange artifacting with textures depending on their size. I run OpenGL 3.3 with an GTX 580 so it should definitely support non power of two textures. I've narrowed down the problem ...
0
votes
1answer
61 views

Opengl Best VAO model for voxel engine

I make a voxel engine on LWJGL 3 (OpenGL binding for JVM). I store all object data in world class. World is subdivided into 32*32*32 chunks. Chunks use octree storage. The main part of all my ...
0
votes
1answer
101 views

OpenGL How to render a voxel based world scene with many objects

I am working on a voxel game engine using OpenGL binding for JVM languages (scala is my case) - LWJGL 3 for OpenGL version 4.5 . Currently I'm stuck with chunk rendering (32*32*32 blocks). To render ...
3
votes
1answer
95 views

How to render a curved horizon when rendering terrain far away

For games with long view distance, it might look at bit weird when you fly high above the ground and the horizon is all flat. So, how can I make a crumb/bend effect, when I fly high above the ...
1
vote
2answers
185 views

Swing GUI for games (performance)

I'm developing a game in Slick2D and I'm trying to make GUI. I've already tried TWL library, but it seems to me a bit complicated and it doesn't cover what I need. In my own implementation of GUI ...
0
votes
0answers
43 views

LWJGL - First time trying to implement shadow mapping

It's my first time when I implementing shadow mapping. My problem is shadows don't work in any way. First I just render all of the object to a FBO with simple shader. shadowMapGenerator.vs: #version ...
1
vote
1answer
37 views

LWJGL: loading textures of various types

I googled around a bit and nobody seems to have asked this question. I have images in multiple color formats (all of them are PNGs). Most of them are ARGB but my bitmap fonts are gray scale, and I ...
1
vote
1answer
40 views

Certain random content rendering differently

On the main menu of my game there is (obviously) several buttons. 2 of which, in different positions on different screens, render a different colour to the rest. As you can see below, "New game" ...
1
vote
1answer
43 views

How can I rotate a quad around it's center?

My code is: GL11.glPushMatrix(); // rotate around center GL11.glTranslatef(-200/2, -200/2, 0); GL11.glRotatef(30, 0.0f, 0.0f, 1); GL11.glTranslatef(200/2, 200/2, 0); // draw quad ...
1
vote
1answer
76 views

How can I blend up to 3 textures on a polygon without blend maps?

For my voxel game I need to blend up to 3 textures in the same polygon. It would be preferable if I could specify a texture id for each vertex, but other solutions are accepted as well. Here's an ...
0
votes
0answers
41 views

Vertex Skinning OpenGex Incorrect Transformations

I'm following the formula here, I'm using LJWGL, OpenGl, OpenGex, and Blender: I implemented the code and it works but there is a few things. First, there is a gap between the two bones, or on each ...
2
votes
2answers
163 views

Unknown length of primitive array

For my Voxel like game I need to generate terrain meshes from an array of ids. Because of that I have no idea how big the final vertex array will be. Currently I'm doing like this: generate mesh and ...
0
votes
0answers
38 views

LWJGL OpenGL Spotlight half-showing

Problem: Only half of the light is showing. Lighting Inilization code: glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); glEnable(GL_NORMALIZE); ...
0
votes
0answers
32 views

How can I render several rectangles efficiently? (LWJGL)

I'm working with OpenGL3+ rendering and I am coming from OpenGL1.5. In GL1.5 I had rendered things like this: public class GraphicsDead { int vboVertexHandle; int vboColorHandle; public ...
1
vote
1answer
61 views

How can I manipulate a single pixel with LWJGL?

This is a very simple question. Is there a way to manipulate a single pixel? Here's an example of what I want in pseudo-code: while(gameIsOn) { renderAllObjects(); setPixel(x,y,r,g,b); } ...
0
votes
1answer
34 views

LWJGL Lighting advice / fix

Problem: The spotlight I've set up with OpenGL won't light up anything behind it, no matter what values I set for GL_SPOT_DIRECTION float[] LightDir = new float[]{0,0,-1,0}; float[] ...
1
vote
1answer
50 views

Drawing text with Slick

I've been trying to draw a text to the display using Slick. However, when ever I draw the TrueTypeFont to the screen, it draws it reversed upside down and also, it makes the whole display turn black. ...
0
votes
0answers
57 views

OpenGL camera scrolling too fast

I'm using the code from this tutorial but in Java and LWJGL. The problem is I want the player to click and drag around the world with the mouse. I tried adding the mouse dx (velocity) to the camera ...
0
votes
1answer
61 views

Free camera rotation in 3D space

I'm using a view matrix to do camera movement and rotation. viewMatrix = new Matrix4f(); viewMatrix.setIdentity(); Matrix4f.rotate((float) Math.toRadians(rx), new Vector3f(1,0,0), viewMatrix, ...
1
vote
0answers
110 views

Drawing fonts with LWJGL3 with OpenGL

I'm very sorry if this question has already been answered, but since I've been struggling with this for many days I thought I'd give it a shot here. My goal is to somehow render some text on the ...
0
votes
0answers
22 views

JBullet - Object is colliding at the wrong location!

I'm trying to make archers walk on my ship. I create the ship mesh like this: { Model mesh = null; try { mesh = OBJLoader.loadModel(new File("res/ship.obj")); } ...
0
votes
1answer
46 views

AABBs in lwjgl 2.9.3

I think I have succeeded in making an aabb out of 6 quads in opengGL but how would i get it to stay with its centre-point at the centre-point of all objects. I know it is easy for one object how would ...
1
vote
1answer
117 views

Rotating a swinging sword in LWJGL gives wierd results

I'm making a 2d top down game in Java using LWJGL(OpenGL, essentially). I recently tried adding a swinging sword mechanism. My coordinate system is set to the bottom left FOR ALL objects. The rotation ...
1
vote
2answers
76 views

Making an organized rendering class [closed]

I'm using LWJGL (opeengl wrapper for Java) and Don't know how to make a renderer class for OpenGL. So In Immediate mode rendering I'd do a method like this to draw quadralaterals. public static void ...
0
votes
0answers
31 views

LWJGL Using .setIntialBackground and Drawing Textures?

I have been trying to create a game with LWJGL, however I have recently discovered that changing the background color using Display.setInitialBackground() with glClear and trying to draw a texture at ...
0
votes
0answers
35 views

JBullet - Two RigidBodies will not collide

I am adding two ships into my collision world. (The green dots are the collision shape (an ObjectArrayList) that I am passing to the ConvexHullShape) However they don't seem to collide. In fact, ...
2
votes
1answer
47 views

JBullet - How can I make my object float on the water?

I'm trying to use JBullet for a ship PVP game. I've got two ships which are meant to rest on the water. Obviously these ships will be colliding, but the problem I have currently is "water" ...
0
votes
0answers
68 views

Hard time implementing AABB collision into a platformer

I have AABB collision working fine. The problem is I can't get it to work with a platformer style game. The collision makes the player move a bit static when colliding and the gravity wont work with ...
0
votes
1answer
41 views

Opengl textures change color of everything

Whenever I render textures, all shapes get the color of the texture. I'm not sure why, but I think it's something to do with the way I render textures. Here's what I use to draw textures: public void ...
0
votes
0answers
36 views

Opengl camera handling

I normally do parallax scrolling with x and y which works, but I'd like to make a camera class instead so I can rotate as well. Right now the camera is set to the player's position but doesn't scroll. ...
0
votes
0answers
145 views

How to toggle fullscreen with lwjgl

I'm using glfw in lwjgl-3 to try to create a toggleFullscreen method. However it always gives me errors. I saw this question Toggle Fullscreen at Runtime but it didn't help because glfwOpenWindow() ...
0
votes
1answer
63 views

Handling collision with LWJGL rectangles

I'm testing collision with other rectangles so I can implement it into my current project. The problem is the rectangle starts at the right x and y, but I'm not sure where exactly they are. I'm pretty ...
-1
votes
1answer
37 views

Scrolling is going too fast

I used delta based off the LWJGL tutorials and it works (I get 16 or 17 delta) but everything is scrolling nonstop. Here's how I render things: public class Game { int camX; int camY; ...
0
votes
0answers
83 views

Trouble with Raycast Selection using OpenGL

I am currently having trouble with a custom model editor in which I want to implement model selection (eventually featuring face selection to have something like "click-and-drag" to extend the cubes). ...
-1
votes
1answer
148 views

What is the difference between .obj files and Collada files? [closed]

I am currently making a game in java using LWJGL 2.9 and I am wondering what the difference between the .obj format and .dae format is. Currently I can load .obj files and would like to load .dae ...
0
votes
0answers
16 views

Stack matrix affecting shooting mechanics

I attempted to make a scroller game using parallax scrolling in LWJGL. Everything is fine but I'm having trouble with the matrix stack and the bullets. So basically when I shoot the bullet it moves ...
0
votes
1answer
70 views

How can I split up a large model into an octree codewise?

For collision detection, I am attempting to split up a large model into an octree. If we take this black thing thing to be the ship (104,000 vertices): Then I would like to split up the faces I ...
0
votes
0answers
26 views

LWJGL: getDisplayModes() on Linux with two monitors

When calling getDisplayModes() on a Linux machine with two monitors I only get one single resolution, that is, the current resolution set on the main monitor. However, calling xrandr directly gives me ...
5
votes
2answers
297 views

How does glRotate affect the axes of the global coordinate system?

I am currently playing around with 3D transformations applied on a 2D context in LWJGL, to later be implemented in my game. So I managed to set up LWJGL well enough (scaling, translating, scaling and ...
1
vote
1answer
46 views

Slick2D crashes on Image.getGraphics() on some machines

On some machines, creating a new Image and calling getGraphics() on it causes lwjgl to enter into some kind of faulty state that crashes when swapping buffers. Any idea what causes this and how to ...
1
vote
1answer
76 views

How to distort graphics in a wave-like way?

I saw a certain graphics distortion effect on multiple games over time and am interested in doing it in 2D. It is like a wave-like texture distortion, I am not entirely sure what it is called ...
1
vote
1answer
140 views

FBO and VBO for performance

I discovered VBO's recently and changed my code to use them instead of immediate mode. Now I'm rendering 25000 squares and it's really slowing down my FPS. If I drew all the squares VBO's to an FBO, ...
1
vote
1answer
119 views

OpenGL/GLSL/LWJGL return value from shader

I'm trying to do some bone animation. I don't want the whole skeleton to be loaded to the GLSL shader every time, even tough it's not needed, because one vertex is parented to one bone, not more. My ...
0
votes
0answers
12 views

How can I implement a “horizontal desynced colors” effect in LWJGL? [duplicate]

My plan is to achieve analog video effects like RGB channel desynchronisation. I'd like to have something like this (I hope you get the idea): Left: White dot; Right: The same dot, but mind the ...