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
votes
0answers
18 views

How do I add collisions to my 3D game made in LWJGL / OpenGL [Java]? [on hold]

I spent 4 hours trying to figure out how I can add collisions to my game and simply could not find ANYTHING. I have absolutely no clue what to start with. What is the simplest way of adding super ...
0
votes
0answers
24 views

glBlendFunc() makes primitively drawn quads disappear

i have experienced some issues with glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);. Having this invocation in OpenGL init code makes stuff drawn with the following methods ...
0
votes
0answers
11 views

Configuring eclipse exporting - export res folder into jar's /res [migrated]

NOTE: I use new File(...) instead of getResourceAsStream(...) so i can then easily make it to Slick's Texture class. I'm having a trouble with exporting my resources folder in eclipse. This is my ...
-1
votes
1answer
69 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
0answers
111 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
16 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
150 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
79 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
64 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 ...
0
votes
1answer
108 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
101 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
137 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
128 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
69 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
87 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
65 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
2answers
48 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
61 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
37 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
90 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
71 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
125 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
86 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
58 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
163 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 ...
1
vote
2answers
207 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
44 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
92 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
80 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 ...
-1
votes
1answer
82 views

How do I put different textures on different walls? LWJGL

So far I have it so you are running around in a box, but all of the walls are the same texture! I've loaded up other textures for the walls (I want the walls a different texture than the floor) but it ...
0
votes
2answers
44 views

glViewport like camera

I'm using glViewport as a camera of sorts, but I'm not quite sure how it works. For example when I change do: glOrtho(0, 800, 600, 0, -1, 1); glViewport(0, 0, 400, 200); It makes the viewing area ...
0
votes
1answer
87 views

How to make a sidescrolling effect in lwjgl

I use the following methods and the screen moves away from the player. glTranslatef(h.x - width/2, h.y - hieght/2, 0); if ((Keyboard.isKeyDown(Keyboard.KEY_D))) { h.x += 10; ...
0
votes
1answer
60 views

Blending issue with framebuffer

I'm trying to get some particles to work properly - they should blend among themselves but not with the background color. For this I'm using additive blending, textures with premultipled alpha and set ...
0
votes
2answers
69 views

Why does my side-scroller character move in the wrong direction?

I'm trying to understand why my rectangle moves in the opposite direction I want it to. I have a float for translation: glTranslatef(translate_x, 0, 0); if ...
-1
votes
1answer
81 views

How to load resources in LWJGL [duplicate]

I've been searching for days. When I export and create my fat jar it loads and disappears. It can't find my images. This is what it all looks like. I used something like this to load them: File a; ...
1
vote
4answers
276 views

Are VBOs only for OpenGL 3.x?

Are VBOs only for OpenGL 3.x? I'm using immediate mode and I know it's bad, slow, and deprecated. But then I looked at display lists but they are deprecated too. I guess the VBO is the only one left ...
0
votes
1answer
89 views

(LWJGL) Exporting Textures with JarSplice [duplicate]

I have another game that uses rectangles instead of textures and works just fine. when I run this I get this error: Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. ...
0
votes
1answer
77 views

Jagged text + additive blend in openGL

I am having some trouble understanding how openGL blend modes work. At first I was using glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and it all looked fine except that I couldn't use any ...
0
votes
0answers
59 views

How to create a 2D overlay over a 3D game? (LWJGL/OpenGL) [duplicate]

GameDev! I would like to create a 2D overlay over a 3D world, using LWJGL (Java version of OpenGL), to show information to the player, for example, a chat box, health bar, selected cannonball type, ...
1
vote
1answer
272 views

Shadow map: depth texture always returns 0

I'm implementing a shadow map for the sun light in my voxel engine using a depth texture attached to a framebuffer. But when I sample the depth texture during the normal pass, the value returned is ...
1
vote
1answer
293 views

What alternatives are there for creating Keyboard/Mouse controls in LWJGL?

So I'm currently working my way through openGL tutorials, using LWJGL to do all my work in. However as I get to the part on how to access Keyboard and Mouse events in this library, I stumble across ...
0
votes
0answers
226 views

Adding 2d hud/gui to a 3d game engine which has no 2d features

I have been following the 3d game engine tutorial series made by theBennyBox for a few months now, and have finally decided to create a game with it. My problem is that it is a 3d only engine which ...
0
votes
1answer
179 views

App using LWJGL can't find display mode extension on Linux

I'm running LWJGL app on Ubuntu virtual machine with no phisical graphic card. I set up Xvfb and Mesa3D but it fails with exception java.lang.ExceptionInInitializerError: null at ...
1
vote
1answer
131 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
112 views

Why does my character move up forever when he jumps with this code?

I've been doing some stupid stuff in Slick2D+LWJGL and I've run into a problem. I press the UP arrow and my character continues to go up until I let go :/ Here's the code: if ...
0
votes
1answer
284 views

LWJGL Resize window and glTranslate breaking screen resolution

I'm trying to make a 2D Tile RPG game with LWJGL but I'm having a problem with the display resizing. I want the user to be able to re-size the window to whatever size they want just by expanding it ...
0
votes
1answer
108 views

LWJGL - Keyboard.next() not firing

I am trying to make a class which will handle all of my inputs, however Keyboard.next() isn't returning true. Here is my code. while(Keyboard.next()) { if(Keyboard.getEventKey() == ...
0
votes
2answers
72 views

Clamping large content to smaller area

I'm using OpenGL (with LWJGL) in Java, but the question is language independent. I have some region (a rectangle for simplicity), and, let's say, a big tiled map which I want to show in this area. ...
0
votes
0answers
29 views

Slick util TiledMap stops all other drawing

Im trying to add tile maps to my game. Before I added the tile map, I had 3 quads being drawn for testing purposes, but after adding the tile map, the quads are no longer drawn. private static void ...
0
votes
1answer
28 views

lwjgl slick textures and glTexParameter

How to make textures fill all area as it is specified? I'm getting small gaps if the texture is smaller than area example: gl_quads setup like these: -1f, 1f, 0, -0.98f, 1f, 0, -0.98f, -1f, 0, ...