Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
using-play-cljc.pdf
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Niyarin
November 28, 2019
420
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
using-play-cljc.pdf
Niyarin
November 28, 2019
More Decks by Niyarin
See All by Niyarin
Scheme用nREPLの開発(エラー出力の改善)
niyarin
0
190
bel lispの紹介
niyarin
0
800
nanopass-compiler-frameworkを使ってみました
niyarin
0
500
Gorgos-parser-combinator-written-in-scheme
niyarin
0
430
outputting-beautiful-s-expression
niyarin
0
430
Serialisp
niyarin
1
740
Mongo DBとS式検索
niyarin
0
360
goodbye-python-repl
niyarin
0
400
SchemeのEphemeronとWeak Pairの説明
niyarin
0
1.1k
Featured
See All Featured
Site-Speed That Sticks
csswizardry
13
1.5k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
ラッコキーワード サービス紹介資料
rakko
1
5.1M
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
610
Abbi's Birthday
coloredviolet
4
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Ruling the World: When Life Gets Gamed
codingconduct
0
380
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
330
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
KATA
mclloyd
PRO
35
16k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
Transcript
Clojureで昔のAndroid用ゲーム を 書き直そうとしている話 Niyarin
古いAndroid Appが動かなくなった(1) AndroidAppが流行りだった時代のプロダクトが動かなくなった ・動かないよという内容のメールをもらったことで知った。存在を忘れていた。
古いAndroid Appが動かなくなった(2) 流行りではなくなったのでライブラリは開発が止まっていた → ライブラリのWebページも消滅していた アプリのソースコードも紛失した(たぶん、SSDのフォーマットでこの世界から消えた) → Clojureで書き直そうと思った
Lispでゲームを書いて人気取りをしよう Land of Lisp (ConradBarski) Realm of Racket (Conrad Barski達)
Common LispでSTGを作りますがなにか? (usamimi.info) Clojureによる、初めての関数型プログラミング(gpsoft) カジュアルな言語入門系記事は初心者にうれしいかもれしれない 参考)
ゲーム/Android用のライブラリの選択 思ったほど選択肢があるわけではなかった。 Clojure on Android 現在開発されておらず、立ち上がりも遅い(らしい) play-clj :libGDXベース ◦ AndroidとDesktop用に出力できる
☓ 開発が終了している play-cljc :Webgl,Openglベース ◦ 開発が終わっていない ☓ Android用バイナリは直接出力できない
Play-cljcでAndroid ・js,htmlファイルを出力してくれる (初期状態でそのままビルドした結果↓) これをWebViewに貼れば目的は達成できそう
WebViewにそのまま貼るだけでよいのか ◦画像表示がローカル同一オリジンポリシーエラーで うまくいかない ・サーバーにおいたり、開発時だとブラウザの設定 変更が必要なやつ D/MyApplication: Uncaught SecurityError: Failed to
execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded
WebViewにそのまま貼るだけでよいのか ・許可周りの設定を加えたりすることで動かすことはできた。 → このままいってもよさそうなのであとは実装するだけ。 webView.getSettings().setDomStorageEnabled(true); webView.getSettings().setAllowFileAccessFromFileURL s(true); webView.getSettings().setAllowUniversalAccessFromFil eURLs(true); webView.setWebViewClient(new WebViewClient());
ちょっとだけPlay-cljcに触れてみた ・ライブラリは標準的なゲームライブラリに近い ・2D 3Dの両対応 ・OpenGLの手続きが呼べる ・Clojureの要素でシェーダーが書ける機能もある
まとめなど ◦Play-cljcはjsを出力できるので、webviewに貼ればAndroidアプリとして出せそう ・js+htmlだと割と長いことメンテしなくても良さそう ◦みなさんも放置しているAndroidアプリがあれば、確認したほうが良いですよ ・Clojureで書き直そうとはいいませんが ◦Clojure Advent Calendar 2019で追加情報、進捗とか書けるとよいかなと思っている