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

1
vote
0answers
20 views

Vbo 3d triangle opengl w/ LWJGL

So i am using lwjgl, took me about 4 hours of hard work to achieve triangle rendering and vbos, now i want to render a triangle in 3d space. I know you have to use projection matrices. But when i have ...
0
votes
0answers
20 views

Slick2D Java Applet

I created small game in Java using Slick2d library. I wanted put my game into webpage as java applet like here. I added my site to java exception site list. When i try to run page it is wrote: "An ...
0
votes
0answers
8 views

Using AWT with LWJGL on OS X

The VM argument -XstartOnFirstThread is required for LWJGL to work on OS X. Anything in the java.awt package freezes the JVM when used with the VM argument -XstartOnFirstThread. E.g. ...
1
vote
3answers
47 views

OpenGL, GLSL, Modify Background Fill via Fragment Shader

I have noticed that fragments rendered by the glClearColor() method do not pass through shaders. However, I'd like to modify these fragments using my fragment shader. Is there any way of forcing them ...
1
vote
1answer
23 views

LWJGL not streching texture to quad

I'm having problems with texturing in LWJGL. The texture is not being stretched to a quad. As you can see, the texture is not being sized to the quad, marked with pink border. The problem doesn't ...
0
votes
2answers
40 views

Setting Window Icon Using GLFW (LWJGL 3)

What's the best, cross platform, way of setting the window icon using LWJGL 3? I have a PNG image and would like to set it to the icon present in my dock (OS X) or the application bar (Linux).
1
vote
1answer
31 views

Cubemaps turn black OpenGL GLSL Java LWJGL

Recently I tried to add cubemaps to my 3D-rendering engine. The objects with a cubemap now turn completely black. This is how I load my cubemap: public static int loadCubeMap(String filename) { ...
0
votes
1answer
24 views

Processing through multiple shaders (LWJGL/Java/OpenGL)

Very simple question: Is it possible to process a vbo through different shaders? If so, how? What I want is sth like this: reflectionShader.bind(); //starts shader reflectionShader.load(some_values); ...
0
votes
0answers
37 views

LWJGL 3 - Random Sprites Don't Blend

Some of my sprites don't "Blend" in with tiles behind them Z-wise. glEnable(GL_DEPTH_TEST); Depth testing is enabled and works. glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, ...
0
votes
2answers
26 views

LWJGL True Type Fonts - Calculate width and height of box

I want to center some text on the screen. At the moment I divide the display height and width by two, and then render. But I also need the height and width of the textbox, so I can subtract it from ...
0
votes
0answers
26 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
46 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
41 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
22 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
48 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
38 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
108 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
129 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
103 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
194 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
49 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
41 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
42 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
80 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
47 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
166 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
42 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
36 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
62 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
38 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
53 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
60 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
75 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, ...
2
votes
1answer
138 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
49 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
2answers
132 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
77 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
37 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
36 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
48 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
70 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
45 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
38 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
211 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
68 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
92 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). ...