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
1answer
24 views

Flat Terrain Generation OpenGL (so close)

I am very close to rendering a flat terrain using LWJGL/OpenGL and filling up vertex/index buffers. The only issue I am having seems to be from the very first square rendered. I tried hard coding a ...
1
vote
1answer
145 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
0answers
8 views

How to setup glOrtho and Viewport

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
2answers
50 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
0answers
21 views

Display black on loading texture

While developing a game with LWJGL I hit a sudden stop with the following issue: Anytime I load a texture using Slick Util, the display stays black until i restart the application. Even when i load ...
1
vote
1answer
133 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
76 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
352 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
224 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[] = ...
1
vote
2answers
213 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 ...
1
vote
1answer
68 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
14 views

Disappearing model - vertices not rendered [closed]

I have a quad that has been drawn with OpenGL 3.2+ (using VAO's etc) but when I applied the matrices in the shader it only becomes visible between some Z values (between -0.8 and -1.25). The fact that ...
0
votes
0answers
19 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
vote
2answers
148 views

Application of classes with critical non-static fields in LWJGL

I'm going to be as specific about this question as I can. Ultimately, how is it that I apply a class that uses non-static fields in LWJGL? More specifically, I know that OpenGL is quite nearly more a ...
0
votes
0answers
31 views

glBlendFunc() makes primitively drawn quads disappear [closed]

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 ...
-1
votes
1answer
74 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
137 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 ...
0
votes
0answers
74 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
2answers
229 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 ...
2
votes
2answers
2k 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 ...
1
vote
1answer
142 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
1answer
90 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
71 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 ...
2
votes
6answers
2k views

Implementing pausing functionality

I'm working in LWJGL and trying to implement pausing when the user presses the 'P' key. Thus far I have this: boolean gamePaused = false; while(!Display.isCloseRequested()){ ...
-1
votes
1answer
84 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
578 views

LWJGL font not rendering, even with depth test and texture_2D

I'm running into an odd little problem here. I'm attempting to render a basic console over my LWJGL-based application, which should be easy enough through a decorator pattern of renderers (as in, one ...
12
votes
1answer
1k views

OpenGL - white edges on cubes

In a minecraft-like game I'm making, I get white edges on my cubes: It is much more noticeable in darker textures. The textures are being setup like this: glTexParameteri(GL_TEXTURE_2D, ...
0
votes
1answer
108 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
144 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
165 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
2answers
944 views

How to create texture coordinates for a spritesheet with lwjgl

Using lwjgl and slick-util I've been trying to use certain pieces of a spritesheet as textures. lwjgl uses glTexCoord2f(); to map coordinates to individual vertices, and the coordinates it takes in ...
0
votes
1answer
75 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
95 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
63 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
40 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
103 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 ...
1
vote
1answer
324 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 ...
2
votes
1answer
362 views

How do I use a JBox2D ContactListener to check if my character is standing on the ground?

I want to know when my character is touching a wall or floor. I've had no luck searching for information on this. I saw a few things about ContactListeners and getContactList(), but I don't understand ...
7
votes
2answers
1k views

What causes some computers to have no or slow OpenGL, and how to fix it?

I am using Java with JOGL to create OpenGL enhanced 2D graphics. The graphics operations I use are nothing fancy, and should be supported by almost any recent graphics card. For example, my game ...
0
votes
1answer
214 views

(LWJGL) Pixel Unpack Buffer Object is Disabled? (glTextImage2D)

I am trying to create a render target for my game so that I can re-render at a different screen size. But I am receiving the following error: Exception in thread "main" ...
0
votes
0answers
87 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 ...
6
votes
1answer
343 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
0
votes
1answer
193 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 ...
0
votes
1answer
49 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 ...
2
votes
3answers
4k views

Where can I find tutorials for LWJGL? [closed]

I don't know if this is against the FAQ so if you close this, it'll be no surprise. I have done research but all the tutorials I have seen have been to hard to follow; I reckon there are better ones ...
-1
votes
1answer
96 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
84 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
45 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 ...