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
4answers
834 views

Opengl lighting not working

I have rendered a spinning model in LWJGL. I have calculated normals and enabled lighting. Now I make a light: float lightpos[] = {0, 0, 0, 0}; FloatBuffer lightposb = ...
-1
votes
2answers
350 views

moving from XNA to LWJGL [closed]

Hi StackOverflow people! I would like to know how easy it could be to move from XNA to using LWJGL. Just wanted to throw this out there because of the rumors that MS is shutting down XNA and having ...
6
votes
2answers
485 views

An odd performance problem rendering a simple scene (less than 14k vertices) in OpenGL using two vbos with LWJGL

Problem I have been having a strange degrading performance issue rendering a simple scene containing two "chunks" of 4x4x4 cubes each. Video of problem This is a screen capture showing my console ...
-3
votes
1answer
140 views

How to toggle something using key releases

I'm making an application using lwjgl and I'm having troubles with toggling using the same key. What I want is for the boolean to be toggled when I release the key. I have a method that returns the ...
0
votes
2answers
563 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
2k views

Resource not found: testdata/alphamap.png

I started a tutorial for java's slick 2d library, called SlickBlocks which is essentally a tetris clone. The problem is I have followed and typed in the code examples to the dot, yet when I run it I ...
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
vote
1answer
1k views

How to use OpenGL blend mode/functions to brighten/darken a texture.

Tried this code, but the texture didnot get any lighter. try { texture = TextureLoader.getTexture("png", ...
-3
votes
1answer
932 views

Slick2D TileD Map Editor Properties [closed]

So I used the following post to help me render my isometric map in Slick2D: Slick2D Isometric TiledMap Rendering Problem Big thanks and credit to arminb for the code supplied and for the fix to be ...
4
votes
2answers
772 views

Slick2D Isometric TiledMap Rendering Problem

I created a Tiled Map using the Tiled Map Editor. In the Editor it looks like this: Desired State In my java program it looks like this: Actual State My java code is: public class Game extends ...
0
votes
1answer
280 views

Changing Yaw, Pitch And Roll OpenGL

I'm using LWJGL and OpenGL 1.1 at this time and I was wondering what command is used to change the yaw, pitch and roll?
0
votes
1answer
397 views

How do I spawn enemies with a delay using threads?

Right now I have this: Thread enemySpawner = new Thread(new Runnable() { public void run() { if(world.getCurrentState() == gameState.GAME) { world.spawnEnemy(x, y); ...
2
votes
2answers
318 views

16-bit PNGs in Slick2D

I'm working on a project and I'm using some 3rd party sprites just to get it off the ground; recently I've come into a hitch. Slick2D doesn't seem to want to load my images. That is, it will warn me ...
1
vote
2answers
539 views

Collision Problems in Pacman Clone

I am working on a Pacman clone. I am using Java for the project. I have been having problems with collisions, and allowing the player to pass through objects. Note that the tile size (and player) is ...
0
votes
1answer
302 views

OpenGL first person camera orientation issues [closed]

I have a "camera" in my opengl program that I recently finished. However, I've noticed that whenever I rotate and then move again, the x, y, and z angles change. For example, when I press the "w" key, ...
3
votes
3answers
2k views

Suggest a simple Java math library for matrix operations for use with OpenGL (lwjgl) [closed]

I'm writing an OpenGL app with Java. I need to do some math for camera and frustum culling (for AABB). Could you suggest a simple and fast Java math library for that?
-1
votes
1answer
163 views

OpenGL glMatrixMode rotation

I'm stuck on trying to figure out how to rotate the viewport(or camera). So far I've figured out I need to use the function glRotatef and glMatrixMode(GL_MODELVIEW). But I have no idea how to apply ...
0
votes
1answer
510 views

Does using LWJGL and Slick2D yield promise for the future of my project? [closed]

I've been looking around the net for months now in an attempt to find the most appropriate tool for my needs. I haven't had a lot of time to devote to the creation of systems that could possibly ...
4
votes
2answers
4k views

Starting Java 2D Platformer using LWJGL [closed]

Getting started on a 2d platforming project in java. I've decided on using LWJGL and OpenGL, but I don't quite know where to start. What is typically the first thing one would work on with a ...
11
votes
1answer
743 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, ...
-1
votes
1answer
83 views

Why are only some of my objects being rendered?

Every time I create a new asteroid the previous one is no longer rendered? I did some debugging and printed out the size of Array-List 'Small' and when a new asteroid is created it doesn't go down, ...
0
votes
1answer
686 views

Trouble programming JInput for game controller

Due to lack of reasonable documentation, I have not been able to program inputs for using a game controller. The most I have ever found was how to detect if a controller is found and what it's name ...
1
vote
1answer
2k views

LWJGL - Mixing 2D and 3D

I'm trying to mix 2D and 3D using LWJGL. I have wrote 2D little method that allow me to easily switch between 2D and 3D. protected static void make2D() { glEnable(GL_BLEND); ...
1
vote
3answers
197 views

Translating an Object to a certain Vector 3 in OpenGL and Java LWJGL

So after almost two hours, I got the hang of using glTranslated() (with Java and LWJGL). If I am correct, applying glTranslated on an object moves that object with the x,y,z relative to the previously ...
1
vote
2answers
2k 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
350 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
95 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
224 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
317 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
323 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
410 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
341 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
669 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
461 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
861 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
885 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
584 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
231 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
894 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
244 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
713 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?