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
222 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() ...
1
vote
0answers
48 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).
4
votes
1answer
2k views

Create the right pom.xml for LWJGL and Slick Project (Maven)

Can somebody tell me whats wrong with my pom.xml file? At this point I get this error if I start my *.jar file: C:\Users\Michael\git\freezing-robot\target>java -jar ...
1
vote
0answers
23 views

Create texture atlas from loaded textures - OpenGL LWJGL Java [duplicate]

In my program I have objects with different textures, that are in the same vbo. I cant have an array of samplers in my shaderprogram, so i have to use a texture atlas. I have seen some ways to make a ...
3
votes
1answer
148 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
4answers
863 views

OpenGL 2D Depth Perception

I have a 2D RPG game written in Java using LWJGL. All works fine, but at the moment I'm having trouble deciding what the best way to do depth perception is. So , for example, if the player goes in ...
0
votes
3answers
566 views

How can I move a created Image in Slick2D?

I want a image to follow the mouse, and I use Image class of Slick 2D: public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException { mouseImage = new ...
1
vote
0answers
24 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 ...
3
votes
1answer
2k views

Using gluUnProject to transform mouse position to world coordinates (LWJGL)?

I have a little LWJGL application and I have been trying to figure out how to successfully use the GLU.gluUnProject function in order to transform a given point on the screen (mouse position) to world ...
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
10 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
50 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
24 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 ...
2
votes
2answers
87 views

Add Objects in LWJGL without using glTranslationf function

It is possible to add an object in LWJGL without using translation function (glTranslatef) ? and if it is possible does this improve somehow performance ?
1
vote
1answer
239 views

Structure gameobjects and call events

I'm working on a 2D tile based game in which the player interacts with other game objects (chests, AI, Doors, Houses etc...). The entire map will be stored in a file which I can read. When loading the ...
0
votes
1answer
119 views

How can I make an soundsystem with slick?

My Question would be , how can I develop an easy-to-use Soundsystem under slick-util? Under the function a.playAsSoundEffect(1, 1, true, x, y, z); it allready works to create a static ...
1
vote
1answer
591 views

LWJGL SlickUtil Texture Binding

I am making a 3D game using LWJGL and I have a texture class with static variables so that I only need to load textures once, even if I need to use them more than once. I am using Slick Util for this. ...
0
votes
1answer
49 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 ...
1
vote
1answer
303 views

LWJGL: Camera distance from image plane?

Let me paste some code before I ask the question... public static void createWindow(int[] args) { try { Display.setFullscreen(false); DisplayMode d[] = ...
2
votes
2answers
3k views

Menus for LWJGL - Swing or other? [closed]

Okay so I want to create a main menu which includes several buttons and text fields, is there a built in library for LWJGL or would I use normal Swing and start a thread of the application? Its a 2D ...
0
votes
1answer
113 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 ...
1
vote
1answer
32 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) { ...
1
vote
2answers
133 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 ...
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 ...
0
votes
1answer
26 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
39 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
28 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
30 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
50 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
42 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
18 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
23 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
0answers
61 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
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
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
105 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
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
42 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
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
81 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
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, ...
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
167 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); ...
1
vote
1answer
48 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
67 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
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 ...
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[] ...