jvm-graphics-labs / hello-triangle

Simple sample showing a complete rendering of a triangle, in Java and Kotlin
MIT License
46 stars 14 forks source link

glm and uno-sdk dependencies #4

Open SingingBush opened 5 years ago

SingingBush commented 5 years ago

I have a maven project that is a collection of various JOGL examples and have been trying to get some of your code working in it.

I've added the maven equivalent of the jitpack stuff in your build.gradle to my pom as per the following:

    <repositories>
        <repository>
            <!-- for kotlin-graphics (elect86) dependencies -->
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.elect86</groupId>
            <artifactId>glm</artifactId>
            <version>471c2fd5d2002696e2721dde19fded16c01fab78</version>
        </dependency>
        <dependency>
            <groupId>com.github.elect86</groupId>
            <artifactId>uno-sdk</artifactId>
            <version>0161a60cd1f9393d419f01660d225a81e0bd45e3</version>
        </dependency>
    </dependencies>

but it doesn't resolve those jars. I've also tried using com.github.kotlin-graphics as it seems there's been a change in username but I still can't resolve them so am unable to import:

import glm.mat.Mat4x4;
import glm.vec._2.Vec2;
import glm.vec._3.Vec3;
import uno.debug.GlDebugOutput;
import uno.glsl.Program;

Would it be possible to either place all required code in this repo or to publish any other dependencies in maven central.

SingingBush commented 5 years ago

After changing the dependencies to the latest tags:

        <dependency>
            <groupId>com.github.kotlin-graphics</groupId>
            <artifactId>glm</artifactId>
            <version>0.9.9.0-build-12</version>
        </dependency>
        <dependency>
            <groupId>com.github.kotlin-graphics</groupId>
            <artifactId>uno-sdk</artifactId>
            <version>0.7.5</version>
        </dependency>

I managed to at least resolve the dependencies but it looks like the Kotlin source has not been written in a way that makes nice to call from Java. I can get the glm stuff working for example but the imports are pretty ugly:

import glm_.mat4x4.Mat4; // instead of glm.mat_.Mat4x4;
import glm_.vec2.Vec2; // instead of glm.vec._2.Vec2;
import glm_.vec3.Vec3; // instead of glm.vec._3.Vec3;

I'm having no such luck with the classes that are supposed to be in uno-sdk though.