Skip to content

Lesson One, ported to Kotlin #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

elect86
Copy link

@elect86 elect86 commented Aug 6, 2017

Hi,

I ported to Kotlin the first Lesson.

If it's fine, I'll go on with the others one :)

@elect86
Copy link
Author

elect86 commented Sep 20, 2017

Hi,

any feedbacks?

@learnopengles
Copy link
Owner

Hi, sorry, I'm not getting emails for any of these for some reason. I'll make a note to review everything and then get back to you.

@elect86
Copy link
Author

elect86 commented Oct 13, 2017

No problems, thanks! :)

@learnopengles
Copy link
Owner

Hi, it generally looks good. Would it be possible to put the implementation under its own folder; i.e. android/kotlin/ ? That way the base lessons would stay in Java and follow the website, and we would have both implementations in parallel without having to add too much complexity to the code itself.

@learnopengles
Copy link
Owner

@elect86

I.e. /android/AndroidOpenGLESLessons
/android/AndroidOpenGLESLessonsKotlin <-- The Kotlin commits would go here.

There's also another PR that wants to add NDK support so this will help to keep things more separated and self-contained.

@elect86
Copy link
Author

elect86 commented Nov 1, 2017

Hi, yeah

Sorry but I don't have so much time at the moment, I'll address this asap

@learnopengles
Copy link
Owner

No worries at all, it was lingering for quite a while on my side too :)

@elect86
Copy link
Author

elect86 commented Nov 14, 2017

Hi,

I tried to understand what you asked, so you want me to double all the files at the same level of AndroidOpenGLESLessonsCpp?

Because given the full compatibility between Java and Kotlin in my opinion it wouldn't have much sense since it's possible to implement Kotlin by simply creating a kt file on the same side of java and choose the corresponding render based on preferences.

But if you prefer that way, I can do it anyway

@learnopengles
Copy link
Owner

Hi @elect86, it does mean more duplication, but I want the java code to remain in relatively close sync with the site and focused on one implementation which makes it easier for a newbie to pick up. You don't have to duplicate everything, only the lessons you actually ported so in this case that would be only lesson 1.

@learnopengles
Copy link
Owner

Basically I want someone looking through or trying to compile the Java project to not have to worry about either Kotlin or the NDK if their environment doesn't support either one for whichever reason (although I'm aware that Kotlin is now "official" :)).

It'd be better to just duplicate only the code and not the resources but I'm not sure right now of a way to do that without complicating the build or requiring users to be aware of those dependencies, so just duplicating everything seems to be the way to isolate things.

@elect86
Copy link
Author

elect86 commented Nov 15, 2017

I guess then in this case what you should do is simply using different branches:

  • java
  • webgl
  • ndk
  • kotlin

If you are so keen on keeping the java code in close sync with the website and you don't want the user to care about the other 3 options, whatever he chooses, than a branch for each thematic shall be just perfect

@learnopengles
Copy link
Owner

Hmm... branching can work but can also introduce its own complexity. I'm fine with the duplication for now! :)

@elect86
Copy link
Author

elect86 commented Nov 16, 2017

Ok, I'll do as you prefer

I'll be back when I'm done ^^

@learnopengles
Copy link
Owner

Nice :) I'll wait for it -- no rush!

@elect86
Copy link
Author

elect86 commented Nov 20, 2017

Can you create a copy of that? Because I'm not so sure how to do that..

I tried and then I converted the class to Kotlin as I also did in the past, but whenever I try to run it, it crashes without a reason:

Unfortunately, Learn OpenGL ES Tutorial has stopped

Idea doesnt show any error about it.. consoles are clear

Edit: maybe I fixed it..

@learnopengles
Copy link
Owner

Oh hmm? Is it OK now?

@elect86
Copy link
Author

elect86 commented Nov 21, 2017

Do you want me to keep exactly the same names? Or can I rename mModelMatrix to modelMatrix?

Shall I also allocate the matrices just once and reuse or can I allocate new ones every onDrawFrame?

@learnopengles
Copy link
Owner

Probably better to allocate the matrices just once and reuse, and the rename is OK with me!

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

Successfully merging this pull request may close these issues.

2 participants