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
8 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
55 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 ...
0
votes
1answer
88 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
36 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 ...
-1
votes
0answers
46 views

Java LWJGL Rotating pistol with camera axis

I was writing a simply height-map based game and I wanted to add some range weapons like pistol. But I am stuck on the rotating part. My rotating on x axis was good. But problem starts when I want to ...
0
votes
0answers
12 views

How to setup States in NIftyGUI and LWJGL

I think this is a simple question but I just cannot figure it out. I have a main menu that is using nifty gui and then my game which is rendered using OpenGL Code (LWJGL) I cannot figure out how to ...
-1
votes
1answer
83 views

How can I get “Good enough” collision for entities? [closed]

I am developing a Pirate ship fighting game. It's a great concept: Ships firing cannonballs, sinking each other, having to work as a team to complete the mission... But.. I've tested it with about ...
0
votes
0answers
23 views

VBO - Update Vertex data

My game will be a 2D Sidescroller and I'm working on moving objects around. Since I want to animate and move my sprites around, how do I update the vertex data? This is my current class for GUI ...
0
votes
0answers
23 views

Lwjgl Textures Overriding true type font

I am making a game in java but I recently came across a problem when I bound my textures, my true type fonts would start copying the texture and i would just see a wall of color where my words had ...
0
votes
1answer
78 views

Java JBullet Mesh collsion problem

I have a problem with JBullet mesh collsion. Everything works fine when I create a mesh from my object without scaling, but the problem starts when I want to scale the object. I also tried scaling in ...
0
votes
1answer
67 views

Java LWJGL - How can I add water to my 3d world? [closed]

The title says it all, how can I implement a simplistic water system into my game? I am using Java LWJGL and OpenGL glsl shaders. I am still fairly new to game programming, and a complete noob in the ...
0
votes
1answer
83 views

Java LWJGL - Monster follow script not working properly

I have written a script to be set off whenever a player is within a distance of the monster. The script checks if the x position is greater than or less than the players x, and same for the z. (y is ...
0
votes
2answers
93 views

How does rendering with Swing compare to rendering with openGL?

[summary: Is the performance of Swing at least in the same dimension as openGL [through LWJGL]? If yes, what percentage would you give it? What possible other problems can I expect from Swing in the ...
0
votes
1answer
67 views

Java LWJGL - How can I click to interact with objects?

I want to be able to click on a monster to walk to him and start attacking him. The part that doesnt make sense to me is the conversion between the mouse position, and the actual terrain position. ...
1
vote
1answer
109 views

VBO -> How should it be done?

I'm very new to OpenGL/LWJGL. I'm reading a lot of VBOs. I'm sorry if I can't concretise my concern, but i'll try it: Why should I use VBOs? Whats the difference between using VBOs and glBegin() ...
0
votes
1answer
38 views

Edit VBO data or create a new one?

I have a question: if I have a VBO, and I have to change all the data inside it (because of resizing, ...), would it be more efficient to delete the old one and create a new one (and reallocate the ...
0
votes
2answers
116 views

Resizing a Framebuffer Object (ie: its attachments) on Screen Resize

I have been experimenting with some post-processing effects and I have been using FBOs to store stuff. The problem is, I attempt to resize them when I change resolution. I get no errors, however the ...
0
votes
1answer
31 views

Slick2D Graphics Misaligned

I'm working through a game in Slick2D and am now focusing on a lot of the graphical end. It's going pretty well other than a couple of issues with alignment. An image illustrating both of these issues ...
2
votes
2answers
47 views

How do find the right GLxx object for a given function in LWJGL?

I'm just starting to learn the fundamentals of OpenGL via LWJGL. Every OpenGL function is implemented as a method on a GLxx class. The xx corresponds to the version of the spec when that function was ...
0
votes
1answer
30 views

LWJGL Stencil shadow problem

I've a problem with shadow (Stencil). So when i draw the shadow they looks good, but when the object to draw is underground his shadow is wrongly rendered. My game is do with LWJGL/GL11. Normal ...
0
votes
2answers
56 views

How to setup glOrtho and Viewport [duplicate]

When setting up a window I set 6 variables in my render class int windowWidth; // the width of the window int windowHeight; //the height of the window int dimL; // the coordinate of ...
1
vote
1answer
85 views

Why would OpenGL ignore GL_DEPTH_TEST setting?

I cannot figure out why some of my objects are being rendered on top of each other. I have Depth testing on. glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Do I need to draw by order of what is ...
0
votes
0answers
34 views

LWJGL 3 crashing on nglDrawArrays

I have 2 classes I'm trying to use to render a triangle, and it's crashing on nglDrawArrays, the error is in the native code, and the only information I'm getting from the JVM is a native error ...
-1
votes
1answer
87 views

Why Is My AABB Collision Detection Not Working

I am going to be making a 3D game and I need to be able to test for accurate collision. I was able to get bounding sphere collision working (too inaccurate to be used for the whole game), but AABB ...
0
votes
3answers
324 views

Calculating Projectile Movement

I'm having some trouble putting together a method that will constantly move a "bullet" in the same direction accurately. Here is what I have so far public Vector3f moveFromPosition(Vector3f location, ...
0
votes
0answers
17 views

Projectile Motion in lwjgl with java [duplicate]

I was trying to make a game with a bow and arrow using lwjgl but I couldent get the arch right. I have a function called projectile that is updated once a frame for each arrow. my frame cap is at 60 ...
1
vote
2answers
302 views

How do I ensure my skybox is always in the background, with OpenGL?

I created a skybox in OpenGL (through LWJGL), but the only way I found to render it behind all objects was to make it very big. This leads to ugly edges between the 6 skybox planes. Optimally, I ...
0
votes
1answer
123 views

Fade into splash screen on game load

I'm using Slick2D and LWJGL for my StateBasedGame and I was wondering if there was a way to enter into my splashscreen on application load using a transition? I tried using: this.enterState(SPLASH, ...
0
votes
2answers
88 views

LWJGL Framebuffer Texture Problem

I am trying to get a terrain rendering system I wrote a while ago with LWJGL. This terrain rendering system is quite simple: a quad mesh is split as the camera moves closer to it, each time a new quad ...
1
vote
1answer
160 views

How could I implement 3D player collision with rotation in LWJGL?

I have a problem with my current collision implementation. Currently for player collision, I just use an AABB where I check if another AABB is in the way of the player, as shown in this code. (The ...
0
votes
1answer
159 views

NiftyGUI - Text isn't rendering

I am trying to create a gui with nifty on top of lwjgl. I've already had some problems during the Nifty setup, however now Nifty is set up and running correctly but for text rendering. Here is my xml ...
0
votes
0answers
166 views

Proper way to load pixel art textures for 2D graphics

I am working on developing a game using LWJGL which is the java bindings for OpenGl. I have just finished the code for loading and animating sprite sheets using a png and xml file. When the texture ...
0
votes
1answer
289 views

lwjgl and slick util text over textured quad

So, I load a TrueTypeFont like this: private TrueTypeFont trueTypeFont; try { InputStream inputStream = ResourceLoader.getResourceAsStream("assets/fonts/main.ttf"); Font ...
0
votes
1answer
98 views

Loading non-square textures, from a 256x256 spritesheet in lwjgl(JAVA)

so I'm doing lwjgl, so far I have the loading of 16x16 textures from a 256x256 spritesheet all working, using this code to get the location of the textures: public Vector2f[] calculateUVMapping(int ...
0
votes
0answers
126 views

JBullet quaternion to Euler angle conversion causes strange flipping behavior

I am making a game using JBullet (a Java port of C++'s Bullet library) for the physics and LWJGL for the graphics. However, JBullet measures angles in quaternions and LWJGL uses Euler or ...
0
votes
1answer
83 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 ...
2
votes
2answers
71 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 ?
0
votes
1answer
77 views

When and how to apply affine translations to vertices of a mesh with LWJGL

So, I have a rigid body class, containing a list of vertices and a 4x4 transformation matrix. At the moment, I'm applying the transformation matrix to each vertex individually, and am unable to revert ...
0
votes
0answers
65 views

Slick2D changing image's color with drawFlash and using alpha

I have an image, where I have a round soft white feathered ball in the center of it. I plan to use it for my lighting in my 2D game. I could not find any proper way to drawing lighting with many ...
0
votes
0answers
149 views

Slick2D/LWJGL Drawing coloured lights problem

I am using the Slick2D engine. I've followed this snippet for creating light sources. I have followed step step, added what is actually important for me, and tested it and the lighting effects ...
0
votes
0answers
89 views

How to render multiple VBOs in LWJGL

I'm still trying to grasp the understanding of VBOs. When you create the floatbuffer, I was told if you keep adding to the put, you would get more points for a shape with more points. My problem is, I ...
1
vote
1answer
182 views

Collision between player and heightmap

Im programming a small project, an opengl height map. It is build of triangles, which points are fit to the right y position (read out of an image). The player is represanted by a cuboid. (p1, p2, ...
0
votes
0answers
91 views

Using VBOs for the begginer

I've spent the past 10 hours trying to understand this and couldn't get any good help. I whatched a youtube video on VBOs and have whatched it many times and tried many things, but I STILL DON'T GET ...
0
votes
0answers
65 views

(LWJGL)How would a game patch work

I made a game in java that I plan on selling some day. When I do eventually release it,I want people to receive patches instead of buying it again. How does a game patch work, and where the heck do I ...
0
votes
1answer
286 views

LWJGL/Java - Implementing a writeable text box?

I would like to create a writeable text box where a user can input text into it. A nice "send" button that the person could click to send the text to the server would also be nice. I currently haven ...
2
votes
2answers
285 views

How to achieve a Gaussian Blur effect for shadows in LWJGL/Slick2D?

I am currently trying to implement shadows into my game, and after a lot of searching in the interwebs I came to the conclusion that drawing hard edged shadows to a low resolution pass combined with a ...
0
votes
1answer
55 views

Slick UnicodeFont displays in different location depending on the screen size?

I am using the Slick2D library to draw text. The text draws perfectly, however it is in the wrong location! I could easily draw it in the correct location, however the problem is that the "correct ...
-1
votes
1answer
106 views

What is “immediate mode” in LWJGL?

I am not sure what "immediate mode" is in the context of LWJGL. I think it's when you use gluPerspective() function?
-1
votes
1answer
133 views

Get stick analogue XY position using Jinput in lwjgl

I want to capture the movement of the analogue stick of the gamePad. is there any equivalent function to this? public void mouseMoved(MouseEvent mouseEvent) { mouseEvent.getX(); //return the X ...