lwjgl

LWJGL Window with Transparent Background?

拜拜、爱过 提交于 2019-12-03 17:28:02
I would like to create a window such that there is no "black background" area, but instead you see through to any other windows that are open, etc. That is, render the scene and only the scene, leaving no frame and no background area. I've read about a method that involves rendering to a hidden OpenGL window and buffering it in memory, creating a transparent layered window, and copying from memory to the transparent window. Obviously this is very cpu/memory intensive, so I was wondering if there was any better ways of doing it, within Java and LWJGL? karlphillip This is something that can only

LWJGL 3.2.0+ fonts

眉间皱痕 提交于 2019-12-03 09:31:40
I've been working with lwjgl for some time, and recently I've decided to switch from fixed function pipeline to shaders. So, the first thing when I'm starting my program, I set the ContextAttrib(3, 2) so I will be using GL 3.2+. The problem is that when I switch on higher version of GL a lot of functions become unsupported. Before switching to higher GL, I've used Slick's font (TrueTypeFont) to render the text I needed, but now the drawString method of TrueTypeFont has an unsupported function within itself. I've tried to google for solution, but nothing came up. Does anyone know if it is

Slick2D vs Straight LWJGL

给你一囗甜甜゛ 提交于 2019-12-03 04:18:40
I've been delving into game programming with Slick2D, and I've began to wonder if in the long run, knowing LWJGL would be more helpful. On one hand, Slick2D is fast and simple, but it seems LWJGL is more adaptable in the sense that it has both 2D and 3D capabilities. For someone who is intermediate in java, and wants to make games, would it be worth the additional effort to learn LWJGL right off the bat? I don't think the two are really related. I mean, I know Slick is built on top of LWGJL, but that's not what I'm getting at here. Slick exists to take advantage of the hardware graphics and

Changing OpenGL Version In LWJGL

最后都变了- 提交于 2019-12-02 18:22:23
问题 So i've been wondering how to change the openGL version in lwjgl.. I know i can change the version with PixelFormat and ContextAttribs as being said on the wiki http://lwjgl.org/wiki/index.php?title=Version_selection But that only can take me down to 3.2 minimum what if i want to take it even lower? like maybe 2.1 or even 1.1? Is there any way to do this? 回答1: Well, the logic behind OpenGL context versions can be a bit confusing. But it does make sense when seeing it in the historical context

LWJGL Texture is flipped upside down when displayed

 ̄綄美尐妖づ 提交于 2019-12-02 12:26:43
I followed a tutorial for reading a picture and creating a texture out of it, however, it shows up flipped upside down when rendered. The image is power of two. Main class public class Main { public static void main(String args[]) throws IOException{ Main quadExample = new Main(); quadExample.start(); } public void start() throws IOException { try { Display.setDisplayMode(new DisplayMode(1280,720)); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } // init OpenGL GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, 1280, 0, 720, -1,

Free Flight Camera - strange rotation around X-axis

风格不统一 提交于 2019-12-02 10:46:43
So I nearly implemented a free-flight camera using vectors and something like gluLookAt. The movement in all 4 directions and rotation around the Y-axis work fine. For the rotation around the Y-axis I calculate the vector between the eye and center vector and then rotate it with the rotation matrix like this: Vector temp = vecmath.vector(center.x() - eye.x(), center.y() - eye.y(), center.z() - eye.z()); float vecX = (temp.x()*(float) Math.cos(-turnSpeed)) + (temp.z()* (float)Math.sin(-turnSpeed)); float vecY = temp.y(); float vecZ = (temp.x()*(float) -Math.sin(-turnSpeed))+ (temp.z()*(float

GLSL point light shader moving with camera

风格不统一 提交于 2019-12-02 10:16:14
问题 I've been trying to make a basic static point light using shaders for an LWJGL game, but it appears as if the light is moving as the camera's position is being translated and rotated. These shaders are slightly modified from the OpenGL 4.3 guide, so I'm not sure why they aren't working as intended. Can anyone explain why these shaders aren't working as intended and what I can do to get them to work? Vertex Shader: varying vec3 color, normal; varying vec4 vertexPos; void main() { color = vec3

The Projection Matrix Does More than Scaling, Right?

不想你离开。 提交于 2019-12-02 09:41:44
问题 As I have it understood, a projection matrix scales a polygon depending on how far away or close it is from the camera. Though I might be completely wrong. My question is, how does the projection matrix "know" to show the sides of the following cube, as the camera moves, when the matrix is only supposed "scale" polygons? Notice in the image, the cube is off to the right side of the screen, by moving the camera to the left. If the camera is moved in the opposite direction (to the right) in

Changing OpenGL Version In LWJGL

浪子不回头ぞ 提交于 2019-12-02 07:46:47
So i've been wondering how to change the openGL version in lwjgl.. I know i can change the version with PixelFormat and ContextAttribs as being said on the wiki http://lwjgl.org/wiki/index.php?title=Version_selection But that only can take me down to 3.2 minimum what if i want to take it even lower? like maybe 2.1 or even 1.1? Is there any way to do this? Well, the logic behind OpenGL context versions can be a bit confusing. But it does make sense when seeing it in the historical context: Back in the day, there were no special "context version" hints. There was just one way to create a context

OpenGLException: Cannot use offsets when Array Buffer Object is disabled.. On a line after calling glEnable(GL_ARRAY_BUFFER)?

青春壹個敷衍的年華 提交于 2019-12-02 05:48:40
问题 I keep getting this exception: Exception in thread "main" org.lwjgl.opengl.OpenGLException: Cannot use offsets when Array Buffer Object is disabled at org.lwjgl.opengl.GLChecks.ensureArrayVBOenabled(GLChecks.java:93) at org.lwjgl.opengl.GL11.glVertexPointer(GL11.java:2680) at Joehot200.TerrainDemo.render(TerrainDemo.java:2074) at Joehot200.TerrainDemo.enterGameLoop(TerrainDemo.java:3266) at Joehot200.TerrainDemo.startGame(TerrainDemo.java:3490) at StartScreenExperiments.Test2.resartTDemo