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
34 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
52 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
10 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
16 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, ...
0
votes
1answer
69 views

Getting the Ray position from View and Projection Matrix

I'm having some trouble calculating the direction and position of the ray from my matrices. I have tried some things such as: private Vec3 getPick(Mat4 projection, Mat4 view) { Mat4 ...
0
votes
1answer
66 views

Correct GL settings to mix 2D and 3D rendering

I'm programming a 3D game engine with 2D GUI. The GUI objects have partially transparent textures and the transparency works more or less. The sky color is rendered in transparent areas of the ...
1
vote
1answer
66 views

How to use LWJGL Vertex Buffer Objects?

I have been learning how to make a game with LWJGL for a while now by following YouTube tutorials online but I've recently been having a problem understanding Vertex Buffer Objects. I've looked at ...
0
votes
0answers
33 views

Why isn't my texture changing after calling display list?

I can't bind another texture after calling glCallList. It does nothing. However if I change texture inside the list, it works.
4
votes
1answer
163 views

Are display lists faster than VBOs?

I'm making a voxel rendering engine. My "chunks" are 32 * 32 * 256 blocks and I can render a 16 * 16 square of them (which corresponds to Minecraft's maximal render distance). I'm using VBOs holding ...
0
votes
1answer
40 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
2answers
111 views

How do I merge quads to simplify a heightmap?

I'm trying to improve my frame rates. My map has an area of 200 * 200 vertices, where each vertex has a height. 200 * 200 = 40000 vertices per frame. I'd like to create a method to simplify the ...
0
votes
0answers
46 views

how to do picking in 2d lwjgl

I searched the whole internet, but I couldn't find something useful. How to do picking (like ray picking) in lwjgl in orthographic mode (2d)? I think this is less confusing than picking in 3d, but I ...
-1
votes
2answers
54 views

GL ARB Shadow Ambient Extension is not supported

I'm trying to build a game engine with LWJGL under Java. I'm want to implement Shadowmapping, but I'm stuck with the tutorials from Oskar Veehoek (here, specifcally). When I try to use the shadow ...
0
votes
1answer
52 views

Why do I get “function not supported” exceptions for OpenGL 3.2 functions using LWJGL?

I am currently having an issue trying to initialize a frame buffer using LWJGL. When I try to call GL32.glFramebufferTexture(int, int, int, int) it throws a "Function is not supported" error. I have ...
0
votes
1answer
44 views

How to change colors of texture in lwjgl? [duplicate]

I have the following texture: The black pixels are characters, the background is transparent. How do I change the black pixels of the characters to another color? I use this texture as a bitmap for ...
0
votes
1answer
55 views

(LWJGL) Resize window content [closed]

I am having a little issue with my game trying to get the screen to draw a ton larger. I am going for a retro type of feel for my game and I believe that this would help with that. I am basically ...
1
vote
1answer
93 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
2answers
76 views

Slick2D: constructor vs. init method

What is the difference between the constructor of a BasicGameState and the init method? It appears that they are both called at the same time when the BasicGameState is registered in StateBasedGame, ...
0
votes
1answer
69 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
0answers
47 views

LWJGL Rotating is moving

I am trying to rotate my QUAD even just a little bit. I have read pages like http://www.java-gaming.org/topics/lwjgl-tutorial-series-moving-and-rotating-triangle/30679/view.html In my render() ...
1
vote
1answer
38 views

Slick2D: Initializing graphics object before game loop

I'm using the Slick2D Java game library and I want to set the scale of the graphics object that gets passed to the render method in my game loop. I'd like to do this outside the render method, so ...
-1
votes
2answers
37 views

LWJGL Jumping Down [closed]

I'm currently building a little game using LWJGL, and I got a Game class which contains my game loop, instances etc... And a Player class which contains a constructor (for x and y coords), logic ...
0
votes
1answer
133 views

How do I move the camera in 2D LWJGL openGL?

I am making a top-down rpg game with the LWJGL but I can't figure out how to make the camera follow the player. I've tryed using GLU.gluLookAt() but it seems to be designed for 3D and when I try it ...
1
vote
0answers
92 views

Shadow mapping implementation not working?

I am trying to implement Shadow Mapping in my program using Java/LWJGL/OpenGL/GLSL, but I cannot get it to work properly. Let's start off with a screenshot first, then the relevant code and lastly ...
0
votes
0answers
56 views

Window resizing doesn't work correctly

im currently having issues on resizing my game. It's a 2d Game and I want resizing to look a little(or exactly) like this: Original size: Smaller window size: My resizing function currently ...
0
votes
0answers
36 views

LWJGL Importing .obj faces properly

I've created a simple OBJ reader. I am able to draw and render the object I created without using the texture or normal coordinates just fine. However, I'm trying to use all of the face portion in ...
0
votes
1answer
118 views

LWJGL Adding Textures with VBOs

I'm currently trying to texture a cube, but I am having no luck determining what the next step should be. I can load an .obj model from Blender into my LWJGL program just fine, and I can even make a ...
0
votes
1answer
48 views

How can I create a cross-fade between two quads?

I have two quads, and I would like to have each one of them on the screen for 5 seconds, then fade to the next one. How could this be done? My code: package net.makerimages.Unacrawl.stateSys; ...
0
votes
0answers
84 views

LWJGL Translation Problems with Matrix4f Class

I've just implemented a simple 3D Camera into my current game program using matrices and shaders. (I've basically just implemented the simple camera found here: ...
0
votes
1answer
108 views

LWJGL Camera Rotation Issues

I am quite new to LWJGL and OpenGL and I am trying to create an FPS camera. I had no problem with 2D stuff, so I decided to step things up and try and make some things in 3D. I have this 3D camera ...
0
votes
1answer
142 views

2D Tiled Map - Small tiles or big tiles with pixel-precise movement

I am using Java - LWJGL - Slick2D . I have tried to do a proper collision detection with 32 x 32 tile size but failed three times. I just cant get it to work! I found a youtube video that was using ...
1
vote
1answer
112 views

Telling my shader when to use which Texture

So I've just managed to get Texturing via GLSL shaders to work and i can pass a sampler2d textureHandler + my uv coordinates into my shader to specify the texture to be displayed on my Tiles. Now im ...
4
votes
3answers
731 views

How do I render a PNG with transparency in LibGDX?

I'm building a simple tic-tac-toe example with LibGDX. I have simple images: cross, circle and board, all pngs created with GIMP with a transparent background. How can I render them as a Texture with ...
0
votes
0answers
38 views

Should tiles in a tile-based game draw themselves? [duplicate]

I'm a beginner in game programming, and I want to start with Java (in which I have a strong background I think) and LWJGL. I want to create tile-based games. Let's say I have an object named Tile, ...
0
votes
2answers
102 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 ...
0
votes
2answers
102 views

How can I access LWJGL's Keyboard from a thread other than the graphics thread?

I'm loving LWJGL, but have been running into a number of odd problems with it. Most of it seems to deal with the fact that OpenGL is a state-machine and was only ever meant to be accessed from a ...
0
votes
1answer
215 views

LWJGL Collision Detection

I cannot find LWJGL collision detection with a camera and walls. Like making it to where you can not walk through walls and other different shaped rectangular prisms and cubes. How do I set up LWJGL ...
0
votes
1answer
149 views

Break a learning barrier with Java + LWJGL [closed]

I have been coding with Java and LWJGL for some time. I mainly use thebennybox's tutorials, but I can't always remember the 3D rendering. But even when I have a 3D rendering models, planes, cubes, ...
1
vote
2answers
81 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
1answer
123 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
1answer
185 views

How does the fragment shader get data from the vertex shader?

How can any interactions between these two shaders work? I mean the vertex shader sends a vertex's color to the fragment shader, but that's only one fragment, what about all the other ones between the ...
1
vote
1answer
127 views

What is the difference between shader uniforms and attributes in OpenGL?

I don't fully understand the differences between uniforms and attributes. To be honest, I probably haven't even used attributes. Can uniforms change for each vertex? I mean to calculate the vertex's ...
0
votes
1answer
223 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 ...
0
votes
1answer
75 views

Lwjgl or opengl double pixels

I'm working in java with LWJGL and trying to double all my pixels. I'm trying to draw in an area of 800x450 and then stretch all the frame image to the complete 1600x900 pixels without them getting ...
0
votes
0answers
40 views

Java / LWJGL / Slick2D resource loading

For now, all I want to do is import a PNG image so I can slice it up later, but no variation of "/Grid/IMages/cell.png" actually leads to my image. I've been stuck on this for a few hours, which is ...
2
votes
1answer
341 views

RTS Voxel Engine using LWJGL - Textures glitching

I'm currently working on an RTS game engine using voxels. I have implemented a basic chunk manager using an Octree of Octrees which contains my voxels (simple square blocks, as in Minecraft). I'm ...
1
vote
2answers
88 views

StringBuffer behavior in LWJGL

Okay, I've been programming in Java for about ten years, but am entirely new to LWJGL. I have a specific problem whilst attempting to create a text console. I have built a class meant to abstract ...
0
votes
1answer
213 views

LWJGL - Continuous key press event without delay

I am checking for key presses and then based on the keys pressed I am moving a square around the screen. I am setting booleans for the keys WASD. But , Whenever I try to keep the key down , it takes a ...
-1
votes
1answer
136 views

OpenGL - zNear and zFar Parameters

I am trying to figure out what each parameter does. In the meantime I am playing around with glOrtho . I have already understood how everything works except zNear and zFar .
1
vote
1answer
93 views

lwjgl request display close when undecorated

I want to create a custom titlebar/border for my display/window so I set the corresponding system property to "true" but how do I send a close request to the window manually to react to the ...