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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tengu712
July 14, 2023
Programming
240
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.2k
Other Decks in Programming
See All in Programming
見えないものを探る要求要件定義に必要な基本的思考 / invisible-requirement-thinking
minodriven
15
7.7k
最近”作らせてる” ローカルAIアプリの話
akit37
0
200
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
390
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
460
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
120
R8 の設定見直しでアプリサイズ削減
andpad
0
190
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
450
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
1
2.2k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
21
21k
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
4.9k
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.4k
Featured
See All Featured
Paper Plane
katiecoart
PRO
4
54k
Git: the NoSQL Database
bkeepers
PRO
433
67k
30 Presentation Tips
portentint
PRO
1
420
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
290
Raft: Consensus for Rubyists
vanstee
142
7.7k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
770
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Cost Of JavaScript in 2023
addyosmani
55
10k
エンジニアに許された特別な時間の終わり
watany
109
250k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
510
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