Git Product home page Git Product logo

lwjgl3-tutorial's People

Contributors

darkweird avatar silvertiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lwjgl3-tutorial's Issues

Prepare for the official LWJGL 3.0 release

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:

  • Update the snapshot branch for the release (Already merged, every enhancement will go directly to the master branch)
    • New OpenGL initialization code (Fixed with 096566d)
    • Remove AWT dependency
      • Use STBImage for loading textures (Fixed with 7fdc0db)
      • Use STBTrueType for loading fonts (Moved to Issue #4)
      • Replace java.awt.Color with own class or Vector4f (Fixed with 6439734)
    • Use LWJGL's GLFW struct classes (Fixed with b5ec0c2)
    • Replace GL_TRUE/GL_FALSE with the GLFW equivalent where necessary (Fixed with 9abbab7)
    • Optional: Use LWJGL's configuration class (Added hint to the Setup tutorial)
    • Optional: Let LWJGL's SharedLibraryLoader do the loading instead of unpacking the natives with Ant (Added with bb2da61)
    • Optional: Use jemalloc for allocating Buffers (Added hint to the Rendering tutorial)
  • Merge snapshot into master (Merged with 8aba12a)
  • Rewrite affected parts of the tutorial

A problem about z value in vertices data

In 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.

How can you resize a texture?

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?

compiling from windows command line

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.

Remove AWT dependency

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.

Add alpha support for textures

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.

Setup wiki page snippet doesn't compile (wrong import)

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.");
    }
}

Vulkan Support

Is there a chance that Vulkan will be supported in this tutorial?

typo (propably?)

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?

"Rendering" tutorial mysteriously isn't working

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

Bug in Renderer.drawTextureRegion() with vertices size

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?

Is the Text tutorial outdated?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.