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
13
votes
3 answers

How can I check if an object(s) are in front of the camera?

I have got some trees, which are greatly lagging the game, so I would like to check if the trees are in front of the camera or not. I have had some help from the Mathematics forum, and also had a look at This link to help me convert pitch/yaw to…
Joehot200
  • 1,070
  • 15
  • 44
13
votes
2 answers

Calculating the Viewing Frustum in a 3D Space

I have drawn diagram after diagram of how to calculate the bounding points of the viewing frustum in a three-dimensional space. To start, I have a two sets of data containing three values each: the xyz coordinates of the camera and the rotation…
CoderTheTyler
  • 839
  • 2
  • 11
  • 30
13
votes
1 answer

Camera Pitch/Yaw to Direction Vector

What I'm trying to do is cast a ray from my camera. I know the camera's x, y and z coordinates, as well as its pitch and yaw. I need to calculate its direction vector so I can pass it to my raytracing algorithm. The camera's up vector is (0, 1, 0).…
RunasSudo
  • 483
  • 2
  • 4
  • 13
11
votes
5 answers

No OpenGL context found in the current thread, how do I fix this error?

I'm working on a card game, and currently have a good foundation but I'm running into an error when I run it in eclipse. I'm also using slick 2d. Here is the error from the console. Exception in thread "main" java.lang.RuntimeException: No OpenGL …
Hayden Holligan
  • 1,822
  • 2
  • 19
  • 26
10
votes
2 answers

How to implement flat shading in OpenGL without duplicate vertices?

I am trying to render 3D prisms in LWJGL OpenGL with flat shading. For example, I have a cube indexed as following: I only have 8 vertices in the vertex buffer, which I have indexed as above. Is there any way to implement flat normal shading on…
Sibh
  • 393
  • 1
  • 4
  • 12
10
votes
2 answers

Variable size array GLSL

I am working on creating shaders for an OpenGL/Java engine that I am building. I have searched for a while, but I cannot find a way to have an array of variable size. I know that I can create a statically sized one like: uniform vec3…
Nick Clark
  • 1,414
  • 2
  • 16
  • 24
10
votes
3 answers

LWJGL Tutorials

Does anyone know of any good Light Weight Java Game Library tutorials geared towards beginners in OpenGL? I have noticed there are some on youtube but they only cover the basics on creating a window and redering 2D quads to the screen, and are often…
lilroo
  • 2,928
  • 7
  • 25
  • 34
9
votes
7 answers

When I run the .jar, I get a "No lwjgl in java.library.path" error

I'm making a basic game in Java using the LWJGL Library via Netbeans. I've created a library with the lwjgl, lwjgl_util, and jinput .jar's, and I added -Djava.library.path=C:\LWJGL\native\windows to the "Run" category in the project's…
9
votes
1 answer

Is GLFW designed to use without LWJGL (in java)?

I know LWJGL is just a wrapper for OpenGL. It's a java library designed to use the lower level OpenGL functions in the java language. As far as I understand now, GLFW is just a library which makes it possible to create better windows to display the…
user2190492
  • 1,174
  • 2
  • 9
  • 37
9
votes
1 answer

How to render text in modern OpenGL with GLSL

I want to render text in LWJGL by using modern OpenGL (rendering with VBO and shader) but I have no idea how to do it.
Thomas Flynn
  • 361
  • 2
  • 4
  • 12
8
votes
2 answers

GLSL #version gives syntax error (LWJGL on Mac)

Specifying the GLSL version gives a syntax error when using LWJGL. I haven't tried to reproduce this issue outside LWJGL. This is happening on multiple Macs running Lion. I've gotten both vertex and fragment shaders to work without using #version.…
rlkw1024
  • 6,455
  • 1
  • 36
  • 65
8
votes
2 answers

Class name conflict importing new package (java)

First of all, I am a new to java, so my question might be stupid but i still need an answer :) I have a class that handle display matters. I have named it "Display", but the problem is : I need to import a class called org.lwjgl.opengl.Display. Of…
Cornelius
  • 378
  • 1
  • 2
  • 12
8
votes
1 answer

Libgdx desktop does not run - WARNING: An illegal reflective access operation has occurred

I'm following this tutorial (http://www.kilobolt.com/day-2-setting-up-libgdx.html). But in step 18 where I run the project as a java application, I get the following errors: I've tried looking around but found no solution for the errors i had. Any…
LTM
  • 527
  • 1
  • 9
  • 18
8
votes
2 answers

LWJGL: Opening window causes program to crash

I am attempting to make a simple game in Java / LWJGL. I was following a tutorial that was made on windows and I'm using a mac. I copied his code for opening up a window character for character and the program crashed instantly giving me a very long…
Adraria
  • 93
  • 1
  • 6
8
votes
2 answers

LWJGL Display class can't be found

I have installed LWJGL into a Java project, and I can't import the Display class. import org.lwjgl.opengl.display; Gives a cannot be resolved error. DisplayMode and other classes are also missing. I can not find any of them in the broswer.
CaffeineToCode
  • 830
  • 3
  • 13
  • 25