Hello Guest

Recent Posts

Pages: [1] 2 3 ... 10
1
Vulkan / Re: Loader issues using maven / gradle
« Last post by spasi on Today at 08:11:00 »
Great, thanks!
2
Vulkan / Re: Loader issues using maven / gradle
« Last post by abcdef on Today at 05:38:37 »
This issue doesn't happen with gradle 6.3 (just so happened I was on the last version that didn't work)

It was this issue that was resolved and it mentions lwjgl3 in it as the use case (so looks like the issue has been seen by someone else)

https://github.com/gradle/gradle/issues/11825
3
Vulkan / Re: Loader issues using maven / gradle
« Last post by abcdef on Today at 05:22:44 »
Ignore the fact that I am selecting multiple classifiers, it doesn't work with one either.

Turns out this could be a gradle.issue

https://github.com/gradle/gradle/issues/1487
4
Vulkan / Re: Loader issues using maven / gradle
« Last post by spasi on August 11, 2020, 15:07:15 »
Because it's cleaner this way. This is the repository of LWJGL artifacts: https://repo1.maven.org/maven2/org/lwjgl/. One folder for each binding + the LWJGL core. If you enter GLFW for example, you'll see this: https://repo1.maven.org/maven2/org/lwjgl/lwjgl-glfw/3.2.3/. Everything related to GLFW is in there.

Also, I'm not aware of any technical reason that artifacts with classifiers can't get resolved transitively.

However, I'd like to point out that the LWJGL native artifacts are not meant to be used like that. You end up downloading all natives, but only using a subset of them (the matching platform/arch ones). The platform cannot be resolved at the library level of course, so you need to do it at the top/application level. Also, when running on Java 9+ and using modules, having the same native module for multiple platforms in the module path will create conflicts. The module-info class for a particular module is exactly the same in all native jars.
5
Oh, well when I said," it just doesn't feel right,"  I was scared of writing all this mimicking code and being wrong with my understanding.  When I said modern, it seems that everywhere I turn the new OpenGL is using the newer pipe line and it is said to be modern.

On the other hand, I have been trying to do this forever, and now I am understanding how it works, thanks for the reassurance!   8)

Josheirm

6
OpenGL / Re: A closer model that does not rotate when a farther model is rotated.
« Last post by KaiHH on August 10, 2020, 19:44:44 »
From my research I am thinking that we used to us glPushMatrix and glPopMatrix.
The (legacy) OpenGL matrix stack can be used to model the transformations and renderings of your objects as a scene graph traversal. glPushMatrix() saves the current state of the matrix of the current matrix mode, whereas glPopMatrix() restores it to where it was before the most recent call to glPushMatrix().
If you want to use the (legacy) OpenGL matrix stack, then:
Code: [Select]
glMatrixMode(GL_MODELVIEW);
// setup view/camera matrix
// ...
// visit one object (here the one that is rotated)
{
  glPushMatrix();
  glTranslatef(...); // <- translate object to its position
  glRotatef(...); // <- rotate it
  // issue draw call for first object (glDraw* or glBegin/glEnd)
  glPopMatrix();
}
// visit the other object
{
  glTranslatef(...); // <- translate the other object to its respective position
  // issue draw call for first object (glDraw* or glBegin/glEnd)
  glPopMatrix();
}

If you don't want to use the (legacy) OpenGL matrix stack, then you simply have to mimic the effect of those (legacy) OpenGL matrix stack functions, that is: Upload a modelview matrix with translation and rotation before drawing the first object, and upload a new modelview matrix with just translation before drawing the second object.

So, when we popped the stack with the unchanged matrix the model would not rotate too.
This sentence is too vague and unclear, what exactly you mean by that.

However, it just doesn't seem right to me.
What exactly do you mean by that? You have not provided any context/code to interpret this statement of yours: Do you mean that your approach works but you don't think it should and it does not "feel" right? Or does anything not work? And if not, what exactly does not work?

I have found a modern way to do this, but how do I not rotate the model?
It's also unclear what exactly you mean by "modern way" and what exactly you've found. Can you clarify?
7
Vulkan / Re: Loader issues using maven / gradle
« Last post by abcdef on August 10, 2020, 18:01:49 »
Is there a reason you went the classifier approach with maven for the native jars? I'm not sure it works that well with heirachical dependencies.
8
OpenGL / A closer model that does not rotate when a farther model is rotated.
« Last post by josheirm on August 10, 2020, 15:57:30 »
I am trying to rotate a model and I want another model that is closer to me  to not rotate.  From my research I am thinking that we used to us glPushMatrix and glPopMatrix.  So, when we popped the stack with the unchanged matrix the model would not rotate too.  However, it just doesn't seem right to me.  I have found a modern way to do this, but how do I not rotate the model?  I enjoy LWJGL and am so happy that there is a forum!   8)

Thank you,

Josheirm
9
Vulkan / Re: Loader issues using maven / gradle
« Last post by abcdef on August 10, 2020, 15:29:11 »
This is the output on the top level project from gradle without the natives in the dependencies

The gradle version is 6.2.2

Code: [Select]
runtimeClasspath - Runtime classpath of source set 'main'.
+--- my:core:1.0
+--- my:resource:1.0
|    \--- my.core:1.0
+--- my:viewer.assets:1.0
+--- my:application.lwjgl:1.0
|    +--- org.lwjgl:lwjgl-bom:3.2.3
|    |    +--- org.lwjgl:lwjgl:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-glfw:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-openal:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-opengl:3.2.3 (c)
|    |    \--- org.lwjgl:lwjgl-vulkan:3.2.3 (c)
|    +--- org.lwjgl:lwjgl -> 3.2.3
|    +--- org.lwjgl:lwjgl-glfw -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-openal -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-opengl -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-vulkan -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- my:core:1.0
|    \--- my:resource:1.0 (*)

Here is the output when it is added

Code: [Select]
runtimeClasspath - Runtime classpath of source set 'main'.
+--- my:core:1.0
+--- my:resource:1.0
|    \--- my:core:1.0
+--- my:viewer.assets:1.0
+--- my:application.lwjgl:1.0
|    +--- org.lwjgl:lwjgl-bom:3.2.3
|    |    +--- org.lwjgl:lwjgl:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-glfw:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-openal:3.2.3 (c)
|    |    +--- org.lwjgl:lwjgl-opengl:3.2.3 (c)
|    |    \--- org.lwjgl:lwjgl-vulkan:3.2.3 (c)
|    +--- org.lwjgl:lwjgl -> 3.2.3
|    +--- org.lwjgl:lwjgl-glfw -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-openal -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-opengl -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- org.lwjgl:lwjgl-vulkan -> 3.2.3
|    |    \--- org.lwjgl:lwjgl:3.2.3
|    +--- my:core:1.0
|    \--- my:resource:1.0 (*)
+--- org.lwjgl:lwjgl-bom:3.2.3 (*)
+--- org.lwjgl:lwjgl -> 3.2.3
+--- org.lwjgl:lwjgl-glfw -> 3.2.3 (*)
+--- org.lwjgl:lwjgl-openal -> 3.2.3 (*)
\--- org.lwjgl:lwjgl-opengl -> 3.2.3 (*)

and this  is the dependency from my.application.lwjgl and the gradle code

Code: [Select]
runtimeClasspath - Runtime classpath of source set 'main'.
+--- org.lwjgl:lwjgl-bom:3.2.3
|    +--- org.lwjgl:lwjgl:3.2.3 (c)
|    +--- org.lwjgl:lwjgl-glfw:3.2.3 (c)
|    +--- org.lwjgl:lwjgl-openal:3.2.3 (c)
|    +--- org.lwjgl:lwjgl-opengl:3.2.3 (c)
|    \--- org.lwjgl:lwjgl-vulkan:3.2.3 (c)
+--- org.lwjgl:lwjgl -> 3.2.3
+--- org.lwjgl:lwjgl-glfw -> 3.2.3
|    \--- org.lwjgl:lwjgl:3.2.3
+--- org.lwjgl:lwjgl-openal -> 3.2.3
|    \--- org.lwjgl:lwjgl:3.2.3
+--- org.lwjgl:lwjgl-opengl -> 3.2.3
|    \--- org.lwjgl:lwjgl:3.2.3
+--- org.lwjgl:lwjgl-vulkan -> 3.2.3
|    \--- org.lwjgl:lwjgl:3.2.3
+--- my:core:1.0
\--- my:resource:1.0
     \--- my:core:1.0

Code: [Select]
dependencies {
    implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
    implementation "org.lwjgl:lwjgl"
    runtimeOnly "org.lwjgl:lwjgl::natives-windows"
    runtimeOnly "org.lwjgl:lwjgl::natives-linux"
    runtimeOnly "org.lwjgl:lwjgl::natives-macos"
    implementation "org.lwjgl:lwjgl-glfw"
    runtimeOnly "org.lwjgl:lwjgl-glfw::natives-windows"
    runtimeOnly "org.lwjgl:lwjgl-glfw::natives-linux"
    runtimeOnly "org.lwjgl:lwjgl-glfw::natives-macos"
    implementation "org.lwjgl:lwjgl-openal"
    runtimeOnly "org.lwjgl:lwjgl-openal::natives-windows"
    runtimeOnly "org.lwjgl:lwjgl-openal::natives-linux"
    runtimeOnly "org.lwjgl:lwjgl-openal::natives-macos"
    implementation "org.lwjgl:lwjgl-opengl"
    runtimeOnly "org.lwjgl:lwjgl-opengl::natives-windows"
    runtimeOnly "org.lwjgl:lwjgl-opengl::natives-linux"
    runtimeOnly "org.lwjgl:lwjgl-opengl::natives-macos"
    implementation "org.lwjgl:lwjgl-vulkan"
    implementation 'my:core:1.0'
    implementation 'my:resource:1.0'
}
[/code[
10
Vulkan / Re: Loader issues using maven / gradle
« Last post by spasi on August 10, 2020, 11:12:25 »
Afaik runtime scoped dependencies are transitive and should be resolved in the top level project. Does it work if you change the scope to compile? Also, what's the output of mvn dependency:tree?

The Vulkan bindings need natives on macOS only (the MoltenVK binary which implements Vulkan over Metal).
Pages: [1] 2 3 ... 10