Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example project setup and showcase of features #8

Open
kaphula opened this issue Dec 20, 2019 · 9 comments
Open

Example project setup and showcase of features #8

kaphula opened this issue Dec 20, 2019 · 9 comments

Comments

@kaphula
Copy link

kaphula commented Dec 20, 2019

Hello,

I tried to test this SDK with Intellij IDEA community edition and Gradle, but I could not get it to run. I tried adding Gradle dependencies such as glm, jogl, and jogamp with no luck. The example given in the Readme was unable to import the gl calls and trying to open just the glfw window crashed with an error about glm library and classpaths.

It would be good to have an example project or tutorial clarifying what are the required steps and dependencies needed to get this running and to showcase why this SDK is worth using.

@bryaan
Copy link

bryaan commented Jan 11, 2020

Agreed. Examples don't work.

@elect86
Copy link
Collaborator

elect86 commented Jan 13, 2020

Assuming you probably needs just core and gl module:

["core", "gl"].each {
        implementation "${kx}.uno-sdk:uno-$it:$uno_version"
    }

Where:

  • kx = "com.github.kotlin-graphics"
  • uno_version is the version you want to use (release tag or commit id)

If you have an example I can take a look at it

@elect86
Copy link
Collaborator

elect86 commented Jan 14, 2020

Also, in case you dont have it yet, you need to add jitpack to your repositories:

    repositories {
        ...
        maven { url 'https://jitpack.io' } // as last
    }

@kaphula
Copy link
Author

kaphula commented Jan 14, 2020

Thank you. I eventually got it to work on my own but I decided to switch to pure LWJGL in the end and started a new project. When I started to look into these thing, I also were confused about the OpenGL binding libraries LWJGL and JOGL and what is their difference, so that was my bad.

Still, apart from the example of settings up a Glfw window and clearing the screen, the list of features (Plus some other small utils like:) listed on the Readme.md could use some more explanations. Pardon my lack of experience with this stuff, but for example the part:

methods for allocating very easily many different type of buffers from a lot of different data type, such as different arrays and so on.

It remains unclear to me what are these buffer allocation methods and what is their purpose. I assume they are related to the memory strategies provided by LWJGL (https://github.com/LWJGL/lwjgl3-wiki/wiki/1.3.-Memory-FAQ) when you are preparing to send vertex data to the GPU with performance in mind, but those strategies and tools are situational, and it is up to the programmer to choose the best strategy for each individual situation. Making it clear with code examples and situations what this SDK's buffer allocation methods bring to the table and why they are easier to use compared to plain LWJGL stuff would, in my opinion, do a great service for this project.

If your intention was to just share a bunch of wrapping utilies over LWJGL written on Kotlin that everyone can study and check directly from the source code on their own, well that's also fine and good, but I guess the name uno-SDK made me expect a bit more hand-holding to get a project running and things rolling on your screen with minimal effort.

I am now working directly with LWJGL and Kotlin, and by converting this tutorial's (https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/) source code files to Kotlin (selectively) has given me a very good base setup for building my own more complex graphics applications.

@ushort
Copy link

ushort commented Aug 26, 2020

Gonna have to agree, tried using this before and now trying again. The explanation on project setup is severely lacking or outdated. uno-gl seems to no longer exist. Copied straight from README.

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' } // as last
}
...
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"

    ["core", "gl"].each {
        implementation "com.github.kotlin-graphics.uno-sdk:uno-$it:0.7.8"
    }
}

Results in Could not find com.github.kotlin-graphics.uno-sdk:uno-gl:0.7.8

I've also tried other version tags such as v0.7.8 and older versions.

Considering I also ran into issues trying to setup imgui from other repo, I, unfortunately, don't think I'll be using anything from kotlin-graphics.

@elect86
Copy link
Collaborator

elect86 commented Aug 26, 2020

@kaphula (Sorry, I missed your reply)
@ushort

Your inputs are quite valuables, I'll work on that asap

However since I lack time, the documentation is, of course and unfortunately, the first aspect affected by that..

but I'm open to contributions (I mean to both of you)

@ushort, uno-gl has been removed, I'll update quickly the readme. Also which issues did you run into (with imgui)? Consider opening an issue to get attention and support

@ushort
Copy link

ushort commented Aug 26, 2020

@elect86 Understandable, just frustrating when set up doesn't work smoothly. I'll also open that issue in imgui in a bit (my fault, was missing operating system import). Thanks for fixing up README 👍

Edit: Seems like even after using awt instead of gl, gl calls are missing such as glClearColour. Seems to be because lwjgl dependencies are marked as runtime instead of compile. Unsure how to fix that.

Edit: Just manually included LWJGL dependencies myself in build.gradle. Still have this error though
Entry.kt: (14, 18): Cannot access class 'glm_.vec2.Vec2i'. Check your module classpath for missing or conflicting dependencies

Last edit: Manually included glm into build gradle which fixed it. Also had to throw in the following in order to get window.loop {} working

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
    kotlinOptions {
        jvmTarget = "11"
    }
}

Complete build.gradle: https://gist.github.com/ushort/4583f7fc45428fc7d45f60450e91a039

@elect86
Copy link
Collaborator

elect86 commented Aug 26, 2020

Yeah, I do understand the frustation and for this I'm sorry

However, is the project open?

Which gl calls are you referring to? The lwjgl vanilla or the confortable ones in gln?

Also, runtime is supposed to be used for natives only

Glad you fixed, I'm gonna solve this issue though. So that one has only to include uno and then all the depenciences are included and made available automatically

If you still use jdk8, there is a corresponding branch exactly for that ;)

@ushort
Copy link

ushort commented Aug 27, 2020

Nope don't worry about it and sadly not at the moment. I was doing vanilla LWJGL calls, e.g glClearColor. Yep only natives are supposed to be runtime but it seems uno-sdk marks all lwjgl dependencies as runtime?

Also nice will be using that branch 😛
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants