silvertiger / lwjgl3-tutorial Goto Github PK
View Code? Open in Web Editor NEWTutorial for the Lightweight Java Game Library (LWJGL) 3
License: MIT License
Tutorial for the Lightweight Java Game Library (LWJGL) 3
License: MIT License
Until now the tutorial used the alpha version 3.0.0a of LWJGL and the snapshot of the beta version 3.0.0b in the snapshot
branch.
Since the official release of LWJGL 3.0 will come soon and the API freeze is discussed, it is time to rework some parts of the tutorial.
Currently the following tasks need to be done:
snapshot
branch for the releasemaster
branch)
SharedLibraryLoader
do the loading instead of unpacking the natives with Antjemalloc
for allocating BuffersIn your tutorial Rendering, I found a problem. Your origin code is
vertices.put(-0.6f).put(-0.4f).put(0f).put(1f).put(0f).put(0f);
vertices.put(0.6f).put(-0.4f).put(0f).put(0f).put(1f).put(0f);
vertices.put(0f).put(0.6f).put(0f).put(0f).put(0f).put(1f);
vertices.flip();
then I changed the z value:
vertices.put(-0.6f).put(-0.4f).put(2.0f).put(1f).put(0f).put(0f);
vertices.put(0.6f).put(-0.4f).put(2.0f).put(0f).put(1f).put(0f);
vertices.put(0f).put(0.6f).put(2.0f).put(0f).put(0f).put(1f);
vertices.flip();
this is a simple triangle with color.But when i changed the vertices data's z value to 2.0f, then there was nothing. With a lot of tests, I found the z only chooses value that varies from -1.0f to 1.0f. Why this happened? Even I used a modelMatrix to translate it's z axis value, it still happened. If you know the reason, please tell me.
I am having some issues trying to resize and image, i tryed to use the glScalef but it gives this error: A function that is not available in the current context was called.
Should I use this function? And so how and where do I use it?
Hi there, I'm having a hard time trying to figure out how to compile+run the simple examples from:
https://www.lwjgl.org/guide and https://github.com/SilverTiger/lwjgl3-tutorial/wiki/Setup#test-your-setup
After downloading lwjgl and extracting the jar files, it looks like I can compile TestSetup with:
javac -classpath C:\Users\Nick\Downloads\lwjgl\jar TestSetup.java
I can't seem to figure out how to run the code. I think it would be worthwhile to clarify this in the documentation on:
https://github.com/SilverTiger/lwjgl3-tutorial/wiki/Setup
since it only discusses setting up an IDE.
For context, this is my first time revisiting Java since college.
Currently the font loading is done by using java.awt.Font. Since LWJGL provides some STB libraries it would be great to use STBTrueType
and STBEasyFont
, so that you don't need the JVM argument -Djava.awt.headless=true
.
just like the titile
Hi,
One small suggestion from my side for this very helping tutorial would be to change the color vec3 to a vec4 so that textures can have an alpha value applied too. The Color class has an alpha member (and getter/setter) already but it is not used by the Renderer at all. I tried to change this myself but apparently I wasn't able to do it right.
Unless I'm doing something wrong, the class org.lwjgl.Sys
does not exist in the specified version (3.0.0b). This code works for me:
import org.lwjgl.Version;
public class Schematic {
public static void main(String[] args) {
System.out.println("LWJGL Version " + Version.getVersion() + " is working.");
}
}
Is there a chance that Vulkan will be supported in this tutorial?
In your tutorial you state:
int vao = glGenVertexArrays();
glBindVertexArrays(vao);
But I cant find glBindVertexArrays in any GL** class.
Only glBindVertexArray
Did you mean that or do I fail to understand some basics?
I seem to have run into a problem during the "Rendering" part of the tutorial. As far as I can tell, I've done everything as you did (except I used JOML, but I can't see a difference between your Matrix4f() implementation and its) but I can't seem to actually render anything to the screen. I've been scratching my head over this for a few days and I can't for the life of me figure out what I'm doing differently that would break anything. My code so far is on my repository and I was wondering if you'd be willing to take a look at it to try to see if you can figure it out, perhaps?
Thanks,
Sarah
In line 352 you check if the space in vertices buffer is not enought and if so you flush it.
if (vertices.remaining() < 7 * 6) {
/* We need more space in the buffer, so flush it */
flush();
}
But, the threshold is 7 * 6
. Shouldn't it be 8 * 6
or vertices.remaining() <= 7 * 6
?
I have been using your tutorials to learn and they are very helpful, so thank you very much for writing them.
I was wondering if there exists a better way for using Fonts in LWJGL, by using the STB bindings in Build #49?
Will you be making a tutorial for NanoVG
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.