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
My frontend framework for 2D game, TECH UNIVERS...
Search
Tengu712
July 14, 2023
Programming
230
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
My frontend framework for 2D game, TECH UNIVERSITY LT Summit, July 9, 2023
Tengu712
July 14, 2023
More Decks by Tengu712
See All by Tengu712
Simplest Vulkan Tutorial in Japanese
tengu712
0
3.1k
Other Decks in Programming
See All in Programming
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
不幸な GC
chencmd
0
890
AIとGame Jamで、ゲームを完成させた話
takahirosaeki
0
110
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
Press start. Python's next generation.
willingc
PRO
3
320
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
120
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
120
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1k
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
We Have a Design System, Now What?
morganepeng
55
8.3k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
A Soul's Torment
seathinner
7
3.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
930
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
Designing for humans not robots
tammielis
254
26k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Google's AI Overviews - The New Search
badams
0
1.6k
Transcript
2Dゲーム向けフロントエンドフレームワークの 制作 天狗 (RICORA) 1
簡単な自己紹介 東京理科大学 創域理工学部 情報計算科学科 四年生 言語・言語処理系好き OSを作ってみたい 設計者になりたい コンパイラを作っては辞めて、ゲームを作っては辞めて 2
制作物 2Dゲーム向けフロントエンドフレームワーク「Shooting Star」 Rust製 パブリックドメイン 少ない依存 LinuxとWindowsで動作 Rust向けライブラリ「sstar」としてcrates.ioに公開。 https://crates.io/crates/sstar 3
実践例 (事前準備) 1. VulkanSDKをインストール 2. LinuxならlibX11をインストール 3. cargoで新しいプロジェクトを作成 4. Cargo.tomlのdependenciesにsstarを追記
[dependencies] sstar = { version = "0.1.8", features=["with-default-shaders"] } 4
実践例 (コード) use sstar::{ app::{graphics::Position, SStarApp}, vulkan::PushConstant, }; fn main()
{ let mut app = SStarApp::new("Sample", 640.0, 480.0, 10); let mut pc = PushConstant { scl: [200.0, 200.0, 1.0, 0.0], ..Default::default() }; while app.update() { pc.rot[0] += 0.01; app.draw(pc.clone(), Position::Center); app.flush(); } app.terminate(); } 5
実践例 6
Shaders Resources Shooting Star Default Shaders bitmap Vulkan Window Manager
Game Program window vulkan GPU XInput /dev/input/js0 get input render load attach keyboard gamepad Linux Windows システム構成 7
TTF Text1 Text2 Text3 Rasterize Text1 Text2 Text3 Textures Texture
Atlas Render and Collect 文字描画 8
依存 RustのSTLだけではOS付近のレイヤーは叩けないので、 library use Vulkan GPUを用いたレンダリング処理 X11 ウィンドウ生成、キー入力判定(Linux) WindowsAPI ウィンドウ生成、キー入力判定(Windows)
stb_image pngデコーダ stb_truetype ttfラスタライザ 9
ビルド時依存 Rust FFIを用いればクレート以外の外部ライブラリとリンクできる。 「bindgen」でシグネチャ(以下のような宣言)を自動生成。 extern "C" { fn foreign_function(); }
stbライブラリはヘッダーファイルで提供される。 「cc」でstbをincludeしたCファイル(以下)からオブジェクトファイルを生成。 #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #define STB_TRUETYPE_IMPLEMENTATION #include "stb_truetype.h" 10
なぜ作ったの? Q: この世には沢山の良いフレームワークがあるでしょ? A: 個人開発なんだから好きに作らせてくれ! 外部ライブラリは便利だが負債になる。トレードオフ。 楽に速く開発する 自由度が減る・管理が複雑になる 11
ライセンス周りの面倒臭さ ライセンスは法解釈。 大きいフレームワークは大量の依存。 すべて読む必要がある 億劫 12
MIT ケース1 MITライセンスされたアプリがある。 このアプリをサーバーに置く。 ユーザからのクエリをアプリに投げて、結果を返す。 アプリの再頒布はないが、サーバに複製し、サービスの一環として利用している。 アプリのライセンス表示義務が生じる。 13
MIT ケース2 MITライセンスされたアプリがある。 このアプリ専用のエミュレータを作る。 ユーザにはアプリを含まずに頒布する。 エミュレータはアプリに強く依存する。 サービスとして成立するにはアプリが必須。 アプリを「利用している」と考えられなくもない。 14
面倒くさいので 権利を主張しないなら、 パブリックドメインで配布してほしいです。 15