lwjgl

Java swing gui and lwjgl

早过忘川 提交于 2019-12-02 02:07:39
问题 A simple question: Is it possible to view gui of java Swing library and lwjgl 3D scene in the same window without using any additional gui libraries? How? 回答1: You can use the method Display.setParent(java.awt.Canvas) to put the LWJGL display on a canvas. You can then incorporate this canvas into your Swing GUI. Please note that there may be slight performance issues with said approach. 来源: https://stackoverflow.com/questions/11334693/java-swing-gui-and-lwjgl

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

蓝咒 提交于 2019-12-01 23:47:23
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(Test2.java:55) at StartScreenExperiments.Test2.main(Test2.java:41) However, the array buffer object IS

Creating a maximized lwjgl window

假如想象 提交于 2019-12-01 22:34:19
问题 How can i create a lwjgl window maximized or make an already created display maximized programmatically? Note: im not asking how to set full-screen mode for the display. 回答1: Display.setResizable(true) this will enable the maximize button. 回答2: I used the LWJGL sample from the website, it gets the possible displaymodes and set it to the best one in fullscreen. Just create anoother class and use this code! public class DisplayConfig { //This is the Class that lets us switch between full screen

Creating a maximized lwjgl window

社会主义新天地 提交于 2019-12-01 20:06:42
How can i create a lwjgl window maximized or make an already created display maximized programmatically? Note: im not asking how to set full-screen mode for the display. Display.setResizable(true) this will enable the maximize button. I used the LWJGL sample from the website, it gets the possible displaymodes and set it to the best one in fullscreen. Just create anoother class and use this code! public class DisplayConfig { //This is the Class that lets us switch between full screen //and window mode. public void setDisplayMode(int width, int height, boolean fullscreen){ //If the display mode

Java bitmap font: blitting 1-bit image with different colors

懵懂的女人 提交于 2019-12-01 18:12:44
I'd like to implement a simple bitmap font drawing in Java AWT-based application. Application draws on a Graphics object, where I'd like to implement a simple algorithm: 1) Load a file (probably using ImageIO.read(new File(fileName)) ), which is 1-bit PNG that looks something like that: I.e. it's 16*16 (or 16*many, if I'd like to support Unicode) matrix of 8*8 characters. Black corresponds to background color, white corresponds to foreground. 2) Draw strings character-by-character, blitting relevant parts of this bitmap to target Graphics . So far I've only succeeded with something like that:

OpenGL - Power Of Two Textures

谁都会走 提交于 2019-12-01 14:12:28
OpenGL uses power-of-two textures. This is because some GPUs only accept power-of-two textures due to MipMapping. Using these power-of-two textures causes problems when drawing a texture larger than it is. I had thought of one way to workaround this, which is to only use the PO2 ratios when we're making the texture smaller than it actually is, and using a 1:1 ratio when we're making it bigger, but will this create compatibility issues with some GPUs? If anybody knows whether issues would occur (I cannot check this as my GPU accepts NPO2 Textures), or a better workaround, I would be grateful.

Can't get LWJGL to run using IDEA and SBT

梦想的初衷 提交于 2019-12-01 04:48:30
I've been scratching myself in the head for a little over an hour with this, nothing on Google seems to be able to give me a decisive answer. I'm using IntelliJ IDEA 13.1.3 with the scala and sbt plugins, Scala 2.11.1 , and SBT 0.13 Thinking I was clever I added the Maven repository for LWJGL to my build.sbt libraryDependencies += "org.lwjgl.lwjgl" % "lwjgl" % "2.9.1" Only to later find out that I need to [ point the compiler to the LWJGL natives ]. Now here's the problem: Asking SBT to download libraries, doesn't put them in any of the project's directories, making the pointing to the

Why isn't this a square? LWJGL

五迷三道 提交于 2019-12-01 04:26:30
I have a basic LWJGL window set up and I am trying to draw a square using the glBegin(GL_QUADS) method. Square square = new Square(25, 25, 25) , is the way I am calling my Square class to draw the square... but it is a rectangle. When I call it I pass in all 25's as the parameters. the first two are the starting coordinates and the last 25 is the side length, as seen below. What am I doing wrong to produce a rectangle? public Square(float x,float y,float sl) { GL11.glColor3f(0.5F, 0.0F, 0.7F); glBegin(GL11.GL_QUADS); glVertex2f(x, y); glVertex2f(x, y+sl); glVertex2f(x+sl, y+sl); glVertex2f(x

Why isn't this a square? LWJGL

依然范特西╮ 提交于 2019-12-01 02:06:04
问题 I have a basic LWJGL window set up and I am trying to draw a square using the glBegin(GL_QUADS) method. Square square = new Square(25, 25, 25) , is the way I am calling my Square class to draw the square... but it is a rectangle. When I call it I pass in all 25's as the parameters. the first two are the starting coordinates and the last 25 is the side length, as seen below. What am I doing wrong to produce a rectangle? public Square(float x,float y,float sl) { GL11.glColor3f(0.5F, 0.0F, 0.7F)

Creating a BufferedImage causes GLFW in the LWJGL to lock up (Java)

我的未来我决定 提交于 2019-12-01 01:39:46
There is a link to download the project below. The project already contains the LWJGL. Just open it with eclipse and tell me I'm not going crazy I'm experimenting with the LWJGL for the first time and have managed to get the sample code on the LWJGL website to work. The odd thing is, if I create an instance of a BufferedImage anywhere in the program, it causes the whole thing to lock up. I've managed to narrow it down to the ColorModel class (which is used by BufferedImage) but can't figure out why it is happening. I'll attach a zip file with my eclipse project to this post which demonstrates