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
vote
2answers
3k views

Rotating a Quad around it center

How can you rotate a quad around its center? This is what im trying to do but it aint working: GL11.glTranslatef(x-getWidth()/2, y-getHeight()/2, 0); GL11.glRotatef(30, 0.0f, 0.0f, ...
0
votes
1answer
397 views

Color Picking Troubles - LWJGL/OpenGL

I'm attempting to check which object the user is hovering over. While everything seems to be just how I'd think it should be, I'm not able to get the correct color due to the second time I draw ...
0
votes
1answer
97 views

What is a fast way to darken the vertices I'm rendering?

To make a lighting system for a voxel game, I need to specify a darkness value per vertex. I'm using GL_COLOR_MATERIAL and specifying a color per vertex, like this: glEnable(GL_COLOR_MATERIAL); ...
1
vote
1answer
244 views

Java game object pool management

Currently I am using arrays to handle all of my game objects in the game I am making, and I know how terrible this is for performance. My question is what is the best way to handle game objects and ...
0
votes
2answers
340 views

LWJGL - OpenGL - Texture shading

I want to use LWJGL to create a shader that all it does is change the color of the given texture. For example I tell it to draw the letter A using a sprite sheet then I can tell the shader to draw the ...
1
vote
1answer
355 views

Rotating a cube using jBullet collisions

How would one go about rotating/flipping a cube with the physics of jBullet? Here is my Draw method for my cube object: public void Draw() { // center point posX, posY, posZ float ...
3
votes
1answer
460 views

How can I set the rotation of a shape to the same as my image?

The way you set rotations of images is different from setting shape rotations. So how can I make the shape have the same rotation as my image? This is how my image rotates: ...
3
votes
1answer
375 views

Best way to Draw a cube for 3D Picking on a specific face

Currently I am drawing a cube for a game that I am making and the cube draw method is below. My question is, what is the best way to draw a cube and to be able to easily find the face that the cursor ...
0
votes
1answer
700 views

How can I achieve this lighting with OpenGL?

I'm currently trying to implement a type of "smooth" lighting. How can I achieve lighting which looks like this: http://dl.dropbox.com/u/1668516/concept/warp3.png Using OpenGl. I've attempted to use ...
5
votes
3answers
1k views

How Do Day Night Cycles Work?

I know that this is a vage question, but how do day night cycles work in video games? How do I get started programming one? I have researched for a while, but the only thing I saw was "unity 3-d day ...
2
votes
3answers
499 views

OpenGL Get Rotated X and Y of quad

I am developing a game in 2D using LWJGL library. So far I have a rotating box. I have done basic Rectangle collision, but it doesn't work for rotated rectangles. Does OpenGL have a function that ...
6
votes
3answers
900 views

Understanding how to create/use textures for games when limited by power of two sizes

I have some questions about the creating graphics for a game. As an example. I want to create a motorbike. (1pixel = 1centimeter) So my motorbike will have 200 width and 150 height. (200x150) But the ...
3
votes
3answers
4k views

How to render axometric/isometric tiles that are a 2d array in logic, but inclined 45º visually?

I am making a tile-based strategy game which i plan to have 2.5D visuals in an axometric/isometric fashion. Right now i'm programming it's logic and rendering it as a literal 2-dimensional array ...
3
votes
1answer
1k views

With Slick, how to change the resolution during gameplay?

I am developing a tile-based strategy game using Java and the Slick API. So far so good, but I've come to a standstill on my options menu. I have plans for the user to be able to change the ...
4
votes
5answers
2k views

Is there a cross-platform special directory I can use for game save files?

I'm developing with LWJGL and Java on a Windows 7 laptop. I've successfully set up saving to the %appdata%\gamename\saves\ or long form c:\users\user\appdata\roaming\gamename\saves\ folder by using ...
1
vote
1answer
1k views

PokeMMO. How they do it?

Well PokeMMO is a JAVA game project which basically is the original FireRed title for the GBA made online. They know this type of projects don't last long because of the copyrighted material used, but ...
-8
votes
1answer
985 views

Is the game Wakfu really fully coded in JAVA? [closed]

If so, this shows that you can develop amazing logic/graphic wise games with JAVA. I think this should be used as an example when people ask about games developed in java instead of just mincraft and ...
1
vote
2answers
645 views

LWJGL GL_QUADS texture artifact

I managed to get working LWJGL in Java, and I loaded a test image (tv test card), but I keep getting weird artifacts outside the image. Code: glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2i(10, ...
2
votes
1answer
268 views

Java getResourceAsStream as local resource

Before using LWJGL, I used the Graphic method, and there I displayed imageicons, and I had the picture file located in the resources. I used: ImageIcon tcard = new ...
2
votes
1answer
1k views

Where can I find the library for org.newdawn.slick.opengl.Texture

I started making a game in Java, and someone on stackoverflow recommended me LWJGL. I found some examples, and they worked. Later I wanted to test sprites and every example that I found that loads ...
0
votes
1answer
104 views

Menu selection wont stay on selected option

My Menu has a START and a QUIT option. I'm using a controller's D-PAD for selection. The game begins with START highlighted. When I push the down button on the D-PAD, it highlights the QUIT option. ...
1
vote
1answer
254 views

Slick2D drawString with coordinates from bottom-left corner

For OpenGL text drawing I use Slick2D library. Default Slick2D 0:0 coordinates are at upper-left corner. But in my project I use bottom-left corner for 0:0. Is it real to configure Slick2D with ...
5
votes
2answers
800 views

Disadvantages of using multiple versions of OpenGL in LWJGL?

So, I'm trying to figure out LWJGL, and my goal is to use OpenGL 3.2 (because pretty shaders are pretty). But in every tutorial I can find for LWJGL, they import a bunch of different OpenGL versions ...
2
votes
1answer
2k views

Menus for LWJGL - Swing or other?

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 ...
2
votes
2answers
1k views

No LWJGL in java.library.path

Okay, so I know I need to set the path to the native files. I can do this in Eclipse, by going to the VM arguments and using -Djava.library.path=, but when I export, it says that the VM arguments ...
1
vote
1answer
2k views

How do I play background music in Slick/LWJGL?

I'm trying to play music in the background for my opening menu, but cant seem to find a tutorial specifically on how to play a music file. Does anyone know how this can be accomplished?
0
votes
1answer
895 views

Slick2D: Changing an Image's colour to Color.white

I am working on a game where we would like the enemies to flash white when hit by a bullet. Ideally, we would like to use the same mechanism to render an Image in any colour. Our Images are all png ...
1
vote
1answer
340 views

Texture switching with a entity system

I'm using thinking of using an entity system in my game. So far I've been using Artemis with success. However, I have a question about texture switching. I read that switching textures too often is ...
1
vote
3answers
877 views

Easiest way to create a 2d game in Java? [closed]

I would like to create a 2d game in Java, but tutorials online for game libraries such as LWJGL are usually filled with errors once I compile the project. Most people do not explain very well, and ...
6
votes
2answers
5k views

How do you determine which object/surface the user's pointing at with lwjgl?

Title pretty much says it all. I'm working on a simple 'lets get used to lwjgl' project involving manipulation of a rubik's cube, and I can't figure out how to tell which side/square the user's ...
4
votes
2answers
1k views

Ray Picking Problems

I've read so many answers on here about how to do Ray Picking, that I thought I had the idea of it down. But when I try to implement it in my game, I get garbage. I'm working with LWJGL. Here's the ...
3
votes
2answers
482 views

Textures on top of other textures when using VBOs

I'm currently making a cube style game. With chunks being drawn with VBOs. I'd like to know if there is a way to create an overlay texture on top of the existing texture without the need to rebuild ...
0
votes
2answers
275 views

Matrix loading problems with jbullet and lwjgl

The following code does not load the matrix correctly from jbullet. //box is a RigidBody Transform trans = new Transform(); trans = box.getMotionState().getWorldTransform(trans); float[] matrix = new ...
-2
votes
1answer
179 views

Issues with networking in my Java game, Client crashes when I try and read from the server input

A buddy and I have been programming a code game over the last 2 weeks, it is intended to be a multiplayer game with the ability to have 2 players play against each other. I am running into an issue ...
4
votes
1answer
1k 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 ...
0
votes
1answer
1k views

How to implement HUD

I'm wondering how one could implement an HUD in LWJGL. I've seen tutorials on this, but they don't seem to work. I know the basic structure goes like this: init3d(); // 3d code init2d(); // HUD To ...
-1
votes
1answer
455 views

First person camera is somehow “magically” expanding

I'm making a first-person game, and I've gotten the camera done (modified version of Lloyd Goodall's code), but whenever I scale an object, it doesn't appear bigger, but the speed of movement seems to ...
1
vote
2answers
748 views

GL11.glTexCoord2f(1.0f, 1.0f); 1.0f screws the image up

I recently started using LWJGL in my java programs for the graphics. I'm currently working on a simple game, which I make, to get better at this kind of programming. I ran into some trouble when ...
0
votes
1answer
159 views

How should I detect whether or not to enable Anti-Aliasing?

How can I detect the speed of the user's graphics card so that I can decide whether or not to enable advanced graphics features that would slow down the app on a slow card, such as anti-aliasing? I am ...
4
votes
3answers
949 views

How can I change this isometric engine to make it so that you could distinguish between blocks that are on different planes?

I have been working on an isometric minecraft-esque game engine for a strategy game I plan on making. As you can see, it really needs some sort of shading. It is difficult to distinguish between ...
0
votes
3answers
644 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
0answers
56 views

OpenGL 2D Depth Perception [duplicate]

Possible Duplicate: 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 ...
3
votes
1answer
2k views

Can't get LWJGL lighting to work

I'm trying to enable lighting in lwjgl according to the method described by NeHe and this post. However, no matter what I try, all faces of my shapes always receive the same amount of light, or, in ...
-1
votes
2answers
509 views

LWJGL in Visual Studio (possible)?

I switched from XNA and C# to LWJGL and Java about 14 months ago. Inherently, this called for a switch in IDE. I started using eclipse because I have also done some basic Android development in the ...
1
vote
3answers
3k views

3D picking lwjgl

I have written some code to preform 3D picking that for some reason dosn't work entirely correct! (Im using LWJGL just so you know.) I posted this at stackoverflow at first but after researching some ...
4
votes
1answer
1k views

Distributing cross-platform .jar containing natives for LWJGL?

I'm making a game in Java using Slick2d, which depends on LWJGL. I can get everything to work in my development environment, but when I export it to a .jar, it needs the natives placed in the same ...
2
votes
1answer
320 views

Update single entry in GLSL array

I have an array in my vertex shader like this: uniform mat4 MeshTransforms[20]; At the moment I'm just updating the entire array of matrices like so: int meshTransforms = ...
1
vote
2answers
176 views

Controlling access to my game

I'm getting near the point where I'm going to be ready to release an alpha of my game. I'm curious as to how to implement a system where the game is un-launchable if a user name and password haven't ...
9
votes
5answers
613 views

Increasing the probability for similar tiles to generate next to each other

I'm working on a tile map system, which insofar looks like this (green is grass, air is white, stone is grey, and blue is water): It uses a simple random number generator so that there's a 45% ...
1
vote
2answers
583 views

Detecting a click on a tile

I'm making a simple tile-map system in LWJGL, and I'm trying to figure out how to detect if the mouse is clicking inside of a tile. So far no matter where I click it's always the same tile that is ...