Tagged Questions

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

6
votes
1answer
337 views

2D Polygon Triangulation

I am creating a game engine using the JBox2D physics engine. It only allows you to create polygon fixtures up to 8 vertices, To create a body with more than 8 vertices, you need to create multiple ...
5
votes
1answer
306 views

Implementing Vehicles in your game

In the game i am creating as an hobby (learning is the primal goal of it all) i plan to implement a space ship that the player can enter and use to explore it. I tried to search the internet for the ...
0
votes
1answer
149 views

Optimization with VBOs [closed]

I am currently working on a cube engine and am experiencing some issues with CPU optimization. I store all my quad VBO data inside a Block (at x,y,z of a chunk) class, which is stored inside an array ...
0
votes
2answers
277 views

LWJGL texture bleeding fix won't work

I tried a lot of things to fix texture bleeding, but nothing works. I don't want to add a transparent border around my textures, because I already got too many and it would take too much time and I ...
0
votes
1answer
450 views

Simulate camera movement in two dimensions (OpenGL)

I've been told by the folks over at Stack Overflow that there's no way to move the camera in OpenGL. I'm developing a 2D RPG with LWJGL and need to know the proper way to simulate camera movement as ...
1
vote
0answers
487 views

Weapon Class Organization [closed]

Im making a game and i want to organise my weapons, and im having a few doubts on not only the best architecture but also on how to use it properly: The First approach is to make a single Weapon ...
0
votes
0answers
128 views

Why must VBOs be “broken in?”

If I create a VBO in LWJGL of, say, 128,000 vertices, and push it to the graphics card, there's a considerable delay. This delay lasts for about 11 to 12 milliseconds. The same thing happens the ...
-1
votes
1answer
247 views

Game Engine Design for the LWJGL [closed]

I'm about to begin on the engine for the game I am making. However, I am quite uncertain how I should design it. I have heard lots about threaded games, component and asynchronous systems. I'm ...
2
votes
1answer
51 views

What measurement units are used in the return value of the getWidth method in the UnicodeFont class supplied by Slick2D?

I'm working on a small component for a game that essentially wraps the provided String so that it fits within the width of the provided rectangle. The rectangle is provided by the Slick2D library as ...
2
votes
1answer
145 views

Add vertices to “middle” of VBO

I've been playing around with VBOs as of late (mostly because my game necessitates it), and I've found the need to add new vertices to a VBO, but not necessarily at the end. The game in question is a ...
2
votes
0answers
225 views

VBO = glGenBuffers() IllegalStateException [closed]

i'm kinda noob in OpenGL but I have this problem: I get an IllegalStateException at this code: int vboVertex = glGenBuffers(); In-detail exception: Exception in thread "main" ...
1
vote
0answers
231 views

Exporting from eclipse with lwjgl using jarsplice

I am in the process of developing a 2D tilebased rpg with eclipse, lwjgl, and slick util. For some reason eclipse seems to be lagging heavily which doesnt make sense as all i have rendering is a ...
2
votes
1answer
344 views

How do I use a JBox2D ContactListener to check if my character is standing on the ground?

I want to know when my character is touching a wall or floor. I've had no luck searching for information on this. I saw a few things about ContactListeners and getContactList(), but I don't understand ...
4
votes
1answer
1k views

How do I draw a full resolution texture to a window of the same resolution?

My image is 1280x800, and my screen size is 1280x800. It should draw perfectly. I'm creating a quad the size of the screen, and setting the texture to fit the quad. But right now it draws a square ...
0
votes
1answer
263 views

Map handling - Indoors/Outdoors and loading large maps

I have two questions regarding the handling of maps. Question 1. My map will consist of outdoor enviroments as well as dungeons, houses etc. How would I go on about connecting the outdoors with the ...
1
vote
1answer
254 views

LWJGL Wait for key press in a single method

Currently I am implementing the possibility in my game to change the keyboard configuration. Therefor, I have a menu in which is a button for each action the player can do. If the player clicks on one ...
2
votes
1answer
506 views

jMonkeyEngine Pros and Cons

I want to know some good reasons to use jMonkeyEngine for a Java 3d game development tool instead of just creating a game with LWJGL myself? I want to know a good reason I should choose this tool. ...
1
vote
2answers
207 views

Map logical coordinates to graphical for walking

I'm having a problem with mapping logical coordinates to graphical ones when my character is walking. I've been able to map them without the graphical walking in between, i.e it just "jumps" from one ...
0
votes
0answers
232 views

LWJGL Mouse picking when camera rotated

I have third person camera in my game and I have mouse picking which works not so good. It works good only when yaw rotation is lesser than ~75 if yaw is greater than 75 then it fails.. Here is video ...
0
votes
1answer
189 views

Textures not rendering with VBOs

After having used display lists for my programs since I started learning OpenGL, I've finally decided to switch to VBOs after experiencing a considerable amount of lag when I started work on a new ...
1
vote
2answers
256 views

LWJGL - If I use VBOs what can I do about separate textures?

So basically this is my problem: I am creating a game that needs a texture for each object. Now I would use a sprite sheet but the textures are different sizes. I am using VBOs and I need to some how ...
1
vote
1answer
139 views

(Java + Slick) How to rotate the Graphics (g) around the X-Axis?

I already tried it by using GL11.glRotatef(45, 1, 0, 0), but the result looks like this:
-2
votes
3answers
960 views

LWJGL vs Slick2D vs OpenGL. What is the difference?

I was wondering what the difference was between LWJGL, Slick2D, and OpenGL. If I'm not mistaken LWJGL is a library and it has the methods and such, but what are the other two for and how do they use ...
3
votes
1answer
220 views

Minimizing amount of comparisons for collisions?

In my 'Terraria' based game I am having lag issues. The cause of the lag is as follows: Every update loop through all the tiles in the world: If the rectangle that was passed as an arg intersects ...
1
vote
1answer
140 views

AI and rendering to screen

I'm using LWJGL, however I'm a bit confused on what to do. I'm trying to write an AI simulation, however I'm stuck at this problem. I have one camera, and I plan to move the camera to the mob ...
3
votes
1answer
311 views

Odd blending result (semi-transparent 2d quad over 3D scene)

I'm working on a GUI library for my game, and I'm having problems with my blending. I have a 3D scene, which I render with glDrawArrays. In the fragment shader the alpha color is hardcoded 1.0f ...
2
votes
2answers
1k views

LWJGL multiple keyboard/mouse input checks

As in many game libraries such as LWJGL, you can check mouse/keyboard events with Mouse.isButtonDown or Keyboard.IsKeyDown. I want to check for button/key presses, not if it's currently pressed down ...
1
vote
1answer
505 views

Quaternions, Axis Angles and Rotation Matrices. Which of these should I use for FP Camera?

After 2 weeks of reading many math formulas and such I know what is a Quaternion, an Axis Angles and Matrices. I have made my own math libary (Java) to use on my game (LWJGL). But I'm really confused ...
1
vote
3answers
361 views

Why does my collision implementation cause my player to “bounce” when a collision occurs?

I have a player polygon and I check to see if it's colliding with my tiled map with this method: public static boolean playerCollisionWith() { for(int i = 0; i < Blockmap.entities.size(); i++) ...
1
vote
0answers
210 views

Why do my LWJGL fonts have dots and lines around them?

When we render fonts there are weird dots and lines around the text. I have no idea why this would happen. Here is an image of what it looks like: Our font class looks like this: package ...
0
votes
1answer
38 views

Can LWJGL support multiple displays

Can LWJGL support multiple displays either as separated windows or as part of an AWT Window?
2
votes
1answer
752 views

How to modify VBO data

I am learning LWJGL so i can start working on my game. In order to learn LWJGL I got the idea to implement the map builder so I can get comfortable with graphics programming. Now, for the map ...
1
vote
1answer
283 views

Packing jar files into library jar files

Firstly, this question is not about packing a simple jar file (e.g. lwjgl) into a runnable jar file. I know how to do this using JarSplice. So if I have a game which uses JInput, I will pack my game ...
-1
votes
1answer
153 views

Multithreading in lwjgl getting rid of sleep.

I'm trying to use multithreading in my game. However, I can't seem to get rid of the sleep. If I don't it's a blank screen, as there is no time for the computer to actually render the triangleMob as ...
0
votes
0answers
78 views

Lwjgl camera causing movement to be mirrored

I'm having a problem in that everything is rendered and the movement is fine. However, everything seems to be mirrored. In the sense that the TriangleMob should move towards me, but it doesn't instead ...
2
votes
0answers
320 views

OpenGL: Attempt to allocate a texture too big for the current hardware [closed]

I'm getting the following error: java.io.IOException: Attempt to allocate a texture to big for the current hardware at ...
0
votes
0answers
200 views

Problem adding texture to VBO with png texmap in OpenGL

I was doing a VBO and able to load all the data of OBJ file but now I have problem adding texture to it. what i did is that I use the slick library to get the texture file and bind it to the VBO ...
2
votes
1answer
247 views

GLSL Multiple Uniform Structs

I'm developing a lighting system for my voxel game, and I have to send multiple (alot, say up to 200) lights to my shader program. Those lights contain the following data: Position (vec3) Color ...
5
votes
1answer
2k views

GLSL Light (Attenuation, Color and intensity) formula

I'm implementing point lights in my Voxel engine, and I'm really struggling to get a good flow of light, from 100% near the light source to 0% at the light radius. I have 5 arguments for the ...
2
votes
1answer
145 views

Manual GLU.gluUnproject

Before I used GLU.gluUnproject to calculate my picking ray in my OpenGL game. Recently I switched to my own calculated matrices, and now I can forget the gluUnproject. How can I calculate the picking ...
1
vote
1answer
747 views

How to use JBullet in LWJGL? [closed]

I have got a problem, because I wan't to add collision detection to my 3d game, which I am developing in Java, using the Lightweight Java Game Library (LWJGL). I have googled a bit, and I have found ...
0
votes
1answer
1k views

How can I implement infinite scrolling by scrolling the background's texture, not the quad? [duplicate]

I'm writing a 2D platformer game on Java with LWJGL. I'm doing this just for the sake of learning and not the result itself, so when I decided to implement scrolling I did it two ways I could invent ...
0
votes
0answers
130 views

Depth Test not working properly on Nvidia

So, I send a Development Test of my in-dev game to some friends, and they found out that the Depth Test in OpenGL does not work on Nvidia. I use my own matrices and sent them to the shader, and at ...
2
votes
1answer
166 views

OpenGL Calculate Matrices

Im trying to switch from the glTranslate etc to my own Matrices, but for some reason it does not work. Here are my 2 functions to create the view- and projection matrix: public Matrix4f ...
-3
votes
2answers
1k views

Terrain Generation - Advanced [closed]

I need to generate terrain. Easy enough you might say, but I need to create Biomes if you will(Can't link of another name) lakes. Trees and on a height map. So I have really no idea how to use a ...
0
votes
2answers
932 views

Screen or World Coordinates to tile Coordinates

I have Plane made of tiles in opengl. I start drawing them at (0, 0, -20) after that i do my translations so that the view is rotated somewhat similar to an isometric (kind of) perspective. I'd now ...
-1
votes
1answer
378 views

Slick2D and TileD [closed]

I've been learning Java for a while, and with my aims of being a game developer later in life, I've came across Slick2D+lwjgl and following tutorials and making some little things. However; I don't ...
0
votes
1answer
201 views

Would it be inefficient to call LWJGL from C++?

I like LWJGL, but Java? Not so much. I recently found out a way to call Java methods from C++. But would this be inefficient? I mean, calling a C/C++ DLL from Java, just to be called back again into ...
1
vote
1answer
545 views

Can't get Depth testing to work (cube faces shine through)

I'm making my first steps with OpenGL with LWJGL. I am currenlty constructing a... wait for it... CUBE. Quite creative... Up to now i made it to three of its faces and thats where the Problems began. ...
1
vote
1answer
1k views

Drawing in 3D with LibGDX

Is there any way to simply draw in 3D, just like you would draw with ShapeRenderer or SpriteBatch? All I want is to draw circles that are in x.y.z coordinates, so some circles are far away from view ...