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
663 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 ...
1
vote
1answer
3k views

Rotation of images in Slick2D

I have have a rotation problem in the Slick2d library, the image is just not rotating (ie I set a rotation but no result is shown). Here is the rotation code: if (input.IsKeyDown(Input.KEY_LEFT)) { ...
0
votes
2answers
431 views

Pong - Changing the Ball's Y location depending on where it hits the paddle

I'm making my first game in, Pong, and I'm trying to make the ball's Y increase or decrease, depending on where it impacts the paddle. After implementing the code below, the ball only goes down, but ...
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 ...
6
votes
2answers
885 views

How are dynamic blending shadows like this created?

I would like to know, how dynamic shadows, that 'blend' onto other objects, are created.
5
votes
5answers
3k 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 ...
3
votes
1answer
365 views

How do I call glVertexPointer in Java?

I'm trying to convert the following code to Java: glVertexPointer( 3, GL_FLOAT, 0, &(mesh.m_PositionBuffer[0]) ); Where mesh::mPositionBuffer is std::vector<glm::vec3>; How would I make ...
2
votes
1answer
911 views

How do I get the alpha level at a specific pixel with Slick 2D?

I know that there is the Texture.getTextureData() method, and that it returns a byte[], but I have no idea how I could use this data to find the color data at a specific pixel.
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?
4
votes
2answers
5k views

Texture antialiasing?

In my Minecraft-clone style game, blocks are textured with a border that is lighter then the block color. See picture below: To achieve this effect without the textures being blurry I use this ...
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 ...
1
vote
1answer
325 views

How do I determine if a tile is a slope based on the tile image?

In my game, every tile is a 32x32 texture. All the slopes are a 0 - 45 degree angle. I would like to determine, at the time I load the tile, if the is sloped by examining its texture/bitmap data. How ...
2
votes
1answer
802 views

Need some help implementing VBO's with Frustum Culling

i'm currently developing my first 3D game for a school project, the game world is completely inspired by minecraft (world completely made out of cubes). I'm currently seeking to improve the ...
4
votes
3answers
1k 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 ...
8
votes
2answers
591 views

What is the primary use of Vertex Buffer Objects?

From what I've read, it seems VBOs are purely for performance. I'm working on a very rudimentary learning project in lwjgl and I'm just trying to figure out what more advanced features of the library ...
1
vote
1answer
259 views

Frame Buffer Objects vs calling TexCoord2f?

I'm learning the basics of OpenGL with lwjgl currently, and following a guide I've got textured quads that can move around a scene. I've been reading about Frame Buffer Objects, and I'm not really ...
5
votes
2answers
359 views

How does this snippet of code create a ray direction vector?

In the Minecraft source code, this code is used to create a direction vector for a ray from pitch and yaw:' float f1 = MathHelper.cos(-rotationYaw * 0.01745329F - 3.141593F); float f3 = ...
3
votes
1answer
874 views

Ray picking - get direction from pitch and yaw

I am attempting to cast a ray from the center of the screen and check for collisions with objects. When rendering, I use these calls to set up the camera: GL11.glRotated(mPitch, 1, 0, 0); ...
10
votes
3answers
10k views

How can I make OpenGL textures scale without becoming blurry?

I'm using OpenGL through LWJGL. I have a 16x16 textured quad rendering at 16x16. When I change it's scale amount, the quad grows, then becomes blurrier as it gets larger. How can I make it scale ...
0
votes
3answers
7k views

Packaging Jar with External Libraries in Eclipse

I have a class called Game in the package net.aGameName and am trying to export a runnable Jar using eclipse. In the project I have two external Jar files added, lwjgl.jar and lwjgl_util.jar. When I ...
12
votes
1answer
10k views

Making a HUD/GUI with OpenGL (LWJGL)

I'm at the stage in my game development where I need to make a HUD or GUI. I've never gotten to this part, so I don't know how its done. I tried rendering a simple quad at a fixed position on the ...
4
votes
1answer
285 views

Restricting Camera Movements with OpenGL

I've been programming a game using the Java library LWJGL. I've got a little problem, though. It is a 2D game, and I'm aiming for a game like the original Civilization (I quick Google of "Civilization ...
7
votes
3answers
3k views

Rendering only what is on the screen

I am fairly new to this world, so bear with me. I have a grid of blocks in a top-down, 2d game written using Slick. The best way to think of it is the Pokemon world. Right now, I am rendering all ...
1
vote
1answer
796 views

LWJGL Rendering a 2D Object at a Certain Position On-Screen

Okay, so in LWJGL, how can I render a 2D object (maybe for like a menu, or meter that shows up on screen during the game), and have control over size and position on screen? So I can tell it what ...
-2
votes
1answer
428 views

vector collision on polygon in 3d space detection/testing?

In the 3d fps in java I'm working on, I need a bullet to be fired and to tell if it hit someone. All visual objects in the game are defined through OpenGL, so the object it can be colliding with can ...
2
votes
3answers
4k views

LWJGL glRotatef() without rotating axes?

Okay so, I noticed when you rotate around an axis, say you do this: glRotatef(90.0f, 1.0f, 0.0f, 0.0f); That will rotate things 90 degrees around the x-axis. However, it also sort of rotates the y ...
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
2answers
979 views

LWJGL Determining whether or not a polygon is on-screen

Not sure whether this is an LWJGL or math question. I want to check whether a shape is on-screen, so that I don't have to render it if it isn't. First of all, is there any simple way to do this that I ...
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 ...
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 ...
6
votes
2answers
6k 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 ...
13
votes
4answers
10k views

How to load 3D models into Java?

Using LWJGL what is the easiest way to load a 3D model to be drawn on screen? I know LWJGL doesn't have built in loading support so I am looking for a small library that would help to load ...
5
votes
1answer
1k views

What's the best way of drawing a glowing 3d line using LWJGL?

Sort of like a strip-light effect; not actually a light source, but just a polygon with glowing edges. Can this be done easily? Right now I'm contemplating drawing a line more than once with varying ...
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
783 views

Is there any way to get the HWND from a window in LWJGL?

I've started some experimentation in Java and LWJGL (via Slick), and it seems very solid. However, I have some legacy code that requires a HWND integer as a parameter. I'm not sure how I'd be able to ...