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
1
vote
1 answer

OpenGL use a specific texture per model

Last question I asked was about how to draw different models in OpenGL. I got that covered, but now I'm stuck at doing textures. Once again I can easily get textures to work, as long as I only ever use one texture. The class that loads the…
René Jensen
  • 451
  • 3
  • 20
1
vote
1 answer

My Java Slick game Jar file will not open

I have made a simple GUI using slick and lwjgl, I am using eclipse and have imported my jars, natives and images to my Java build path, I export my code as a jar file and get a jar file on my desktop, I try open it with SE Binary and it loads for a…
Rahul Khosla
  • 349
  • 9
  • 21
1
vote
3 answers

Overiding a method wont work

I am trying to make my own engine but I need some help. I am currently doing the level system. The level class extends the render class and the level class overides the Render classes render method. Finally the render class is called from the main…
1
vote
1 answer

Organizing code in LWJGL

I'm making a simple tic tac toe game as an exercise in LWJGL. When I write methods to draw the board squares and pieces such as the x and o pieces, should I put them in one graphicsLib class that can then be called by the various objects such as the…
sakurashinken
  • 3,940
  • 8
  • 34
  • 67
1
vote
1 answer

VBO Java LWJGL with Mouse+Keyboard

I've got a problem with VBO and Keyboard+Mouse input. For example if i move my mouse the cube don't stops to rotate and is even going faster, the same with keyboard ive testing it on 3 computers Heres my code: Game.class package…
1
vote
1 answer

GLSL struct uniform locations return -1

I'm trying to create some sort of basic lighting system. I have this struct set up: struct Light { vec3 position; vec4 diffuse; vec4 ambient; bool enabled; }; And then i define 4 disabled lights: uniform Light light0 = Light(vec3(0.0, 0.0,…
Unknownloner
  • 107
  • 8
1
vote
2 answers

LWJGL skewed texture

I was trying to use a texture with LWJGL, turns out that RBG-pngs are somewhat skewed. Example: Original picture/Texture The loading code is 98% of the lwjgl wiki space invaders example.. Texture.java: public int target, textureID, height, width,…
Jan Weber
  • 137
  • 13
1
vote
1 answer

Passing structs containing size_t from Java to OpenCL

One of the arguments for CL12.clCreateImage() is a ByteBuffer containing this struct. I will be using the method described in OpenCL kernel arguments to pass the struct but am not certain what to use for the arguments that are of type size_t. From…
vandale
  • 3,600
  • 3
  • 22
  • 39
1
vote
1 answer

Robot keep mouse in window

I have a fps "camera", and just recently managed to set up mouse movement to rotate the angle of viewing. The one problem with the camera is that the mouse can leave the window and the angles will not rotate anymore. I know I can use a robot method…
user1650305
1
vote
1 answer

OpenGL Mouse Input

I have this mouse function in my OpenGL program: public void mouseInput(){ int mouseX = Mouse.getX(); int mouseY = 600 - Mouse.getY(); int mouseDX = 0, mouseDY = 0; int lastX = 0, lastY = 0; mouseDX = mouseX - lastX; mouseDY…
user1650305
1
vote
4 answers

Textures not binding in OpenGL (LWJGL/Slick-util)

I have a problem with what seems to be binding the textures to a shape. When I do so, I get a white shape of the correct dimensions, the color given to it by Color.white.bind(). GraphicsManager.java package com.jackwilsdon.spectrun; import…
Jack Wilsdon
  • 6,706
  • 11
  • 44
  • 87
1
vote
1 answer

OpenGL shaders not working?

I've made a class in Java using LWJGL which imports shaders and enables them and disables them so when they are enabled I get some cool effects. The problem is that every time I initialize my class it crashes and it's apperenly due to a…
user1939871
1
vote
1 answer

LWJGL OpenGL Display

When you try to close a display, generally I use Mouse.destroy(); Keyboard.destroy(); AL.destroy(); Display.destroy(); System.exit(0); But now I want to create a new one to replace it. I have a launcher program that has the start button. It…
sandspro
  • 72
  • 1
  • 7
1
vote
1 answer

Eclim disregards native library path when launching Java program

I'm using Eclim and Vim for Java development. I'm trying to set up the LWJGL so I can program OpenGL stuff with Java. So, when I run :Java from Vim to run a lwjgl test program I made, Eclim gives: Exception in thread "main"…
Alex Ozer
  • 459
  • 5
  • 14
1
vote
0 answers

OpenGL(java) update light?

I am currently learning OpenGL using lwjgl. I created a Box that is built of vertices. I also created a light class that should set the parameters of the light and finally enable the light. I could get the light working but there is one problem.…
Florian
  • 5,918
  • 3
  • 47
  • 86