Questions tagged [lwjgl]

The Lightweight Java Game Library (LWJGL) allows access to high performance crossplatform libraries such as OpenGL, OpenCL and OpenAL to write state of the art 2D and 3D applications with Java.

The Lightweight Java Game Library (LWJGL) is an open source Java software library for computer game developers. In particular, it provides an interface for accessing OpenGL, OpenCL, OpenAL and GLFW functionality.

3245 questions
0
votes
1 answer

Strange lighting behaviour with OpenGL in LWJGL (Java)

I'm fairly new to LWJGL/OpenGL and I've come across this problem which I can't fix, whatever I try: When I draw multiple cubes to the screen, the light is the same brightness when it hits it, regardless of how far away the cube is from the 'camera'.…
user1248420
  • 57
  • 1
  • 2
  • 5
0
votes
1 answer

OpenGL Moves quads

So, i have a problem with my engine that i am working on right now: The point is, that it should generate 16x16 platform of them. This is code that creates cubes: private void render(){ …
themorfeus
  • 277
  • 1
  • 3
  • 17
0
votes
1 answer

OpenGL small vs large rectangles

Why does a 800x600 rectangle in OpenGL take so much longer time than many small rectangles? In my head I would have thought drawing 1 would be better than many. public class LWJGLtest { int screenwidth = 1024; int screenheight = 768; private Texture…
Jason Gray
  • 97
  • 5
0
votes
1 answer

How to 'send to back/front' or in other words change 'priority' of textures?

I'm making a 2D Java program with LWJGL and its OpenGL. It uses LWJGL's display. I would like one image to show above the second image on screen, but it's blocked out, I assume by default. Does LWJGL have a setting so that the image has 'priority'…
GlassZee
  • 1,117
  • 2
  • 11
  • 22
0
votes
1 answer

OpenGL with glTexCoord - Images with many tiles could get tedious?

https://i.stack.imgur.com/bRXcy.png This image is a 78*24 image of the alphabet, with each letter in a 6*6, so 52 total squares. Wouldn't using glTexCoord to get a single letter out of that image get kind of tedious? GL11.glTexCoord2f(0,0); …
GlassZee
  • 1,117
  • 2
  • 11
  • 22
0
votes
0 answers

LWJGL and GLAPP print function for printing text onscreen

I need to print text on my LWJGL OpenGL window. And I need the text to be onscreen, using screen coordinates and not on the worldspace. Any ideas on how I can do this? I saw a guide here that showcases the use of the GLApp print() function, but…
brain56
  • 2,659
  • 9
  • 38
  • 70
0
votes
2 answers

Using Key/MouseListeners on LWJGL?

I'm making a java application (not a game) that uses LWJGL and I was wondering if there was a way to add KeyListeners and MouseListeners to an application? The setup I have is I've got a JFrame and a Canvas. The JFrame has some JPanel sidebars. I've…
SpaceFace
  • 1,492
  • 3
  • 15
  • 29
0
votes
1 answer

Getting a transparent screen when trying to make something in LWJGL

I've been trying to get into LWJGL. But the things I try don't seem to work properly. First off, I installed it the way it was described here on Eclipse. It told me to test everything first, so I did that. It gave me the output expected and showed a…
Sietse
  • 707
  • 4
  • 10
0
votes
1 answer

Java - Can't seem to draw text on screen following the path of an equation

I'm constructing the basis of a game and when the character hits an NPC, I want a number to float around the player for a second or two. The problem I'm having is when I try to draw the number following a parabolic equation, all that gets drawn is…
2kan
  • 95
  • 2
  • 10
0
votes
2 answers

Best way to boost the performance of my LWJGL game?

I am putting together a small project for school that involves rendering the periodic table. I chose to use LWJGL to do this. The problem is, however, that when I render the table, the game starts out at ~30fps(capped at 60fps), and quickly…
Flafla2
  • 545
  • 7
  • 12
0
votes
1 answer

Simple cropping with lwjgl/opengl

https://i.stack.imgur.com/vX04r.png <-- example image How might I crop some quads before drawing them to the screen? What I have right now looks like the leftmost image. I'd like it to look like the rightmost one. I found some information on masking…
0
votes
1 answer

OpenAL WaveData Error

I have a problem with playing a sound using OpenAL in Java (LWJGL). Whats worse is I have no idea what the error is telling me. AL lib: ReleaseALC: 1 device not closed Now I'm sure that the file location is correct but waveFile is returning a null,…
Iggy
  • 4,767
  • 5
  • 23
  • 34
0
votes
3 answers

Java FloatBuffer size error OpenGL

working with LWJGL's implementation of OpenGL, and trying to work with the lighting functions. This requires the creation of FloatBuffers to pass to OpenGL. Relevant code follows: GL11.glClearColor(0,0,0,0); float[]…
sol_var
  • 847
  • 1
  • 9
  • 9
0
votes
1 answer

Could someone explain in-depth how to change a bufferedimage to a bytebuffer?

For OpenGL. There are many texture loaders that I could use, but what are the basics for what you need changing a bufferedimage to bytebuffer? I just don't want to copy/paste the code directly, I'd rather know what it means. For starters, what…
GlassZee
  • 1,117
  • 2
  • 11
  • 22
0
votes
0 answers

My LWJGL rendering code isn't working, I compare it aginst a working code of mine and can't find any differences renderwise

I am using LWJGL to create a game in java. However it's not rendering, I have it setup to simply render 6 planes, each facing towards the inside to surround the camera in a box, it's very simple code, and I have working code that is almost exact,…
D3_JMultiply
  • 1,022
  • 2
  • 12
  • 22
1 2 3
99
100