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.
3
votes
2answers
437 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
157 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
176 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);
...
0
votes
0answers
129 views
LWJGL Mouse Input [closed]
I have this mouse function in my LWJGL program:
public void mouseInput(){
int mouseX = Mouse.getX();
int mouseY = 600 - Mouse.getY();
int mouseDX = 0, mouseDY = 0;
int lastX = 0, ...
0
votes
0answers
675 views
Issues playing audio with Slick 2D [closed]
Started trying to learn Slick 2D a few days ago and have enjoyed it so far. The only problem is I can't seem to be able to get audio to play. I have tried going through the documentation examples, ...
0
votes
1answer
209 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, ...
-1
votes
1answer
96 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
243 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 ...
11
votes
1answer
374 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, ...
2
votes
2answers
531 views
OBJ model loaded in LWJGL has a black area with no texture
I have a problem with loading an .obj file in LWJGL and its textures.
The object is a tree(it's a paid model from TurboSquid, so I can't post it here,but here's the link if you want to see how it ...
-1
votes
1answer
74 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, ...
2
votes
2answers
200 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
1answer
578 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
88 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 ...
0
votes
2answers
462 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
0answers
38 views
Nifty default controls prevent the rest of my game from rendering
I've been trying to add a basic HUD to my 2D LWJGL game using nifty gui, and while I've been successful in rendering panels and static text on top of the game, using the built-in nifty controls (e.g. ...
0
votes
0answers
63 views
HowTo Enable jBullet DebugMode
I would like to render the physics world of jBullet to debug some issues in my game, and I am not finding too much on enabling the debugDraw method of jBullet. Do I need to write my own debugDraw ...
0
votes
1answer
87 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
145 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
216 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
932 views
LWJGL Text Rendering
Currently in my project I am using LWJGL and the Slick2D library to render text onto the screen. Here is a more specific example:
Font f = new Font("Times New Roman",Font.BOLD,18);
font = new ...
1
vote
1answer
178 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
197 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:
...
0
votes
1answer
244 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 ...
3
votes
1answer
237 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
365 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
799 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
316 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 ...
5
votes
3answers
599 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 ...
0
votes
0answers
192 views
Implementing Lighting OpenGL 2D Quads with Textures
Lets say I have a grid of tiles 64x64 and I want to implement lighting using opengl.
I draw the grid with 2D quads that are binded with textures. How would I implement source lighting and stuff like ...
-7
votes
1answer
539 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
1answer
949 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 ...
2
votes
1answer
132 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 ...
1
vote
2answers
415 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
341 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
94 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. ...
3
votes
2answers
398 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 ...
1
vote
1answer
875 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 ...
0
votes
1answer
455 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 ...
0
votes
1answer
946 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
0answers
108 views
OGL lighting issues [closed]
All that seems to be working is ambient light. My room is just dark with no lights in it. I'm not sure if it's relevant, but I'm using LWJGL. Here's my code:
glEnable(GL_LIGHT0);
...
0
votes
1answer
515 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
3answers
719 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 ...
4
votes
2answers
828 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 ...
1
vote
1answer
264 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 ...
3
votes
2answers
285 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 ...
2
votes
3answers
2k views
Where can I find tutorials for LWJGL?
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 ...
0
votes
2answers
198 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
151 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 ...
2
votes
1answer
568 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 ...