master
ブランチ master
ShaderPlayground / src / gui / manual.cc
26.2 KB、427行 生 Blame 履歴
1/*
2# 076 License
3
4Copyright (c) 076 Studio LLC
5
6Permission is hereby granted to any person obtaining a copy of the software
7Shader Playground (the "Software") to use, modify, merge, copy, publish, distribute,
8sublicense, and/or sell copies of the Software, subject to the following conditions:
9
10 1. **Origin Attribution**:
11 - You must not misrepresent the origin of the Software; you must not claim
12 you created the original Software.
13 - If the Software is used in a product, you must either:
14 a. Provide clear attribution in the product's documentation, user interface,
15 or other visible areas, **OR**
16 b. Pay the original developers a fee they specify in writing.
17 2. **Usage Restriction**:
18 - The Software, or any derivative works, dependencies, or libraries
19 incorporating it, must not be used for censorship or to suppress freedom of
20 speech, expression, or creativity. Prohibited uses include, but are not
21 limited to:
22 - Censorship of so-called "hate speech", visuals, non-mainstream opinions,
23 ideas, or objective reality.
24 - Tools or systems designed to restrict access to information or
25 artistic works.
26 3. **Notice Preservation**:
27 - This license and the above copyright notice must remain intact in all copies
28 of the source code.
29
30THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
31INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
32PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
33HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
34CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
35OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
36*/
37#include <gui/manual.hh>
38#include <database/locale.hh>
39#include <gui/guiengine.hh>
40#include <imgui.h>
41#include <imgui_markdown.h>
42
43namespace gui {
44 void Manual::Draw(Info &info) {
45 if (!info.isManual) return;
46
47 ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse;
48
49 ImGui::SetNextWindowSize({ 600, 700 }, ImGuiCond_Appearing);
50 ImGui::Begin(info.i18n->GetWord("helpmanual").c_str(), &info.isManual, flags);
51 if (GuiEngine::ShouldCloseWindowOnEscape()) info.isManual = false;
52
53 if (ImGui::BeginTabBar("ManualTabs")) {
54 if (ImGui::BeginTabItem(info.i18n->GetWord("helpmanualoverview").c_str())) {
55 m_CurPage = "index";
56 ImGui::EndTabItem();
57 }
58
59 if (ImGui::BeginTabItem(info.i18n->GetWord("helpmanualshader").c_str())) {
60 m_CurPage = "shader";
61 ImGui::EndTabItem();
62 }
63
64 if (ImGui::BeginTabItem(info.i18n->GetWord("helpmanuallua").c_str())) {
65 m_CurPage = "lua";
66 ImGui::EndTabItem();
67 }
68
69 if (ImGui::BeginTabItem(info.i18n->GetWord("helpmanualhotkey").c_str())) {
70 m_CurPage = "hotkeys";
71 ImGui::EndTabItem();
72 }
73
74 ImGui::EndTabBar();
75 }
76
77 ImGui::Separator();
78
79 ImGui::BeginChild("ManualContent", ImVec2(0, 0), 0, ImGuiWindowFlags_HorizontalScrollbar);
80
81 ImGui::MarkdownConfig mdConfig = {};
82
83 if (m_CurPage == "index") {
84 string md;
85 if (info.i18n->GetCurrentLanguage().code == "ja_JP") {
86 ImGui::TextWrapped("Shader Playgroundへようこそ!");
87 ImGui::Dummy(ImVec2(0, 10));
88 md = R"(# はじめに
89
90**Note**: For English, go to 編集 → 設定 (or press CTRL + ,), and set "言語/Language" to "English".
91
92これはShader Playgroundのマニュアルです。
93このマニュアルは、このプログラムをできるだけわかりやすく理解できるように作成されています。
94ブラウザに切り替えてページの読み込みが遅くなるのを避けるため、マニュアルをプログラム内に埋め込むことにしました。
95このテキストの上部には、このシステムの各部分の詳細に移動できる複数のタブがあります。
96このタブは全体の簡単な概要を提供します。
97
98# 基本的なUIガイド
99初回起動時、ウィンドウが数秒間空白の画面を表示することがあります。
100これはバックグラウンドでディレクトリを作成し、すべてのシーン データを保存するための新しいデータベース ファイルを作成しているためです。
101次回起動時には、すべてが即座に読み込まれます。
102
103起動直後に、ビューポートにはテクニカル諏訪子さんのGLSLチュートリアルで紹介されたシェーダーの1つが表示され、すべてが正常に動作していることを確認できます。
104このシェーダーは、チュートリアルで使用された「GLSLテスター」プログラムのデフォルト シェーダーでもあります。
105ビューポートのすぐ隣にはテキスト エディタのエリアがあります。
106そこには3つのテキスト エディタがあります:頂点シェーダー用、フラグメントシェーダー用、そしてLua用です。
107LuaはレンダリングのCPU側を制御し、シェーダーはGPU側を制御します。
108最後に、下部にはログを出力するコンソールがあります。
109
110その他の細かい詳細として、右上にFPSカウンターと日時が表示されます。
111パフォーマンスを意識したり、寝る時間になったりするのに役立ちます。
112
113新しいシェーダーを作成すると、いくつかの異なる開始点から選択できます。これらはLua APIのサンプルコードとしても機能します。
114ビューポートはリアルタイム更新されません。
115変更を確認するにはコンパイルが必要です。
116これにより、フロー状態から外れることなくプログラミング/スクリプト作成ができます。
117
118# 歴史
119Shader Playgroundは、Shadertoyのようなプログラムをオフラインで使用でき、WebGLではなくOpenGLを使い、より大きな制御を可能にするという欲求から始まりました。
120しかしLuaエンジンが実装されると、突然もっと有用なツールにしたいと思うようになりました。
121そこで、ユーザーがGPU側だけでなくCPU側でもシェーダーを作成できるAPIを実装しました。
122その後、3Dシェーダーを追加したくなり、気がつくと将来のリリースで拡張されるミニゲームエンジンになっていました。
123目標は、移植性とパフォーマンスを犠牲にせずにできるだけ完全なものにすることですが、5日間のプロジェクトとしてそれらすべてを達成するのは現実的に不可能です。
124そのため、将来のアップデートでゆっくりと確実にさらに多くの機能を追加していく予定です。)";
125 } else {
126 ImGui::TextWrapped("Welcome to Shader Playground!");
127 ImGui::Dummy(ImVec2(0, 10));
128 md = R"(# Intro
129
130**注意**: 日本語で読むには、「Edit → Settings」をクリックし(若しくはCTRL + ,を押し)、「言語/Language」から「日本語」を御選択下さい。".
131
132This is the manual for Shader Playground.
133This manual aims to make it as easy to understand this program as possible.
134We decided to embed the manual into the program to remove the need for switching to a web browser and suffer from slow page loading times.
135At the top of this text you'll see multiple tabs going into details of each part of this system.
136This tab gives a quick overview of everything.
137
138# Basic UI Guide
139Upon first start up, the window might show a blank screen for a few seconds.
140This is because in the background, it's creating directories and a new database file to store all your scene data in.
141Next time you run this program, everything will be instantly loaded.
142
143Immediately upon opening, you'll see one of the shaders demonstrated in the GLSL tutorials by Technical Suwako in the viewport, confirming that it all works.
144This shader is also the default in the program "GLSL Tester" which was used in those tutorials.
145Right next to the viewport there is an area with a text editor.
146It has 3 text editors: one for the vertex shader, one for the fragment shader, and one for Lua.
147Lua controls the CPU side of the rendering, whereas the shaders control the GPU side.
148Lastly, at the bottom there is the console that will output logs.
149
150Some smaller details are the FPS counter and date/time at the right-top.
151It allows for users to keep performance into account and also when it's finally time to sleep.
152
153Upon creating a new shader, you'll get to choose from a couple of different starting points, which also doubles as a sample code for the Lua API.
154The viewport does not update live.
155Instead, it requires a compilation to see changes.
156This allows for programming/scripting without getting kicked out of your flow state.
157
158# History
159Shader Playground started out as a desire to have a Shadertoy-like program, but that can be used offline, using OpenGL instead of WebGL, and also allow for greater control.
160But as the Lua Engine got implemented, suddenly we wanted to make it into a much more useful tool.
161So we implemented an API that lets the user make shaders not only on the GPU side, but on the CPU side as well.
162Then we wanted to add in 3D shaders, and all of the sudden we had a mini game engine that will be expanded upon in future releases.
163The aim is to make it as complete as possible without sacrificing on portability and performance, but as a 5 day project it's realistically not possible to accomplish all of that.
164This is why future updates will slowly but surely add in more features.)";
165 }
166 ImGui::Markdown(md.c_str(), md.length(), mdConfig);
167 } else if (m_CurPage == "shader") {
168 string md;
169 if (info.i18n->GetCurrentLanguage().code == "ja_JP") {
170 md = R"(# シェーダー
171現在、Shader PlaygroundはGLSLシェーダーのみをサポートしており、特にVertexシェーダーとFragmentシェーダーのみです。
172シェーダーはShader PlaygroundのバックエンドであるOpenGL 4.6と互換性がある必要があります。
173将来的にはVulkan GLSLシェーダー、NVN GLSLシェーダー(承認されたユーザーのみ)、Slangシェーダー、DirectX HLSLシェーダー(Windowsのみ)、Metalシェーダー(macOSのみ)もサポートされる予定です。
174OpenGLのコアプロファイルがサポートするものはすべてShader Playgroundでサポートされており、実際のゲームからシェーダーをそのままコピーして使用できます。
175GLSLエディタには抽象化が一切ないため、制約なく実世界のGLSLシェーダーで自由に実験できます。)";
176 } else {
177 md = R"(# Shaders
178At the moment, Shader Playground only support GLSL shaders, and specifically only Vertex and Fragment shaders.
179The shaders must be compatible with OpenGL 4.6, which is the backend of Shader Playground.
180In the future it will be extended to also support Vulkan GLSL shaders, NVN GLSL shaders (only for approved users), Slang shaders, DirectX HLSL shaders (only on Windows), and Metal shaders (only on macOS).
181Everything the core profile of OpenGL supports is supported in Shader Playground, and the shaders can be copied from real games as-is.
182There are no abstractions for the GLSL editors, which provides full freedom to experiment with real world GLSL shaders without constraint.)";
183 }
184 ImGui::Markdown(md.c_str(), md.length(), mdConfig);
185 } else if (m_CurPage == "lua") {
186 string md;
187 if (info.i18n->GetCurrentLanguage().code == "ja_JP") {
188 md = R"(# Luaエンジン
189Shader Playgroundは、基本的ながら強力なLuaスクリプトエンジンを提供しています。
190独自の標準ライブラリが付属しており、`le.`で始まります。
191このライブラリは、必要に応じてまだ開発中です。
192
193## 関数
1942つの関数があります:`Init`と`Update`。
195`Init`関数はコンパイル後の最初のフレームでのみ実行されます。
196`Update`関数は毎フレーム実行されます。
197
198## コア
199以下のAPI呼び出しは`le.`で始まります。
200* `api_version` = Lua Engine APIのバージョンを返します。
201* `log` = テキストと変数を出力します。Javascriptの`console.log()`と同様に動作します。任意のパラメータを受け取ります。
202* `sizeof` = 各種データ型のサイズを返します。パラメータとして文字列でデータ型を受け取ります。
203
204## システム
205以下のAPI呼び出しは`le.sys`で始まります。
206* `get_time` = Shader Playgroundが起動してからの総時間を返します。
207* `get_delta_time` = `get_time`のデルタ値を返します。
208* `get_timer_frequency` = Shader Playgroundのタイマー周波数を返します。
209* `get_resolution` = Shader Playgroundの解像度(ビューポートではなく)を返します。
210* `random` = 2つの整数間の乱数を返します。2つのパラメータ(両方文字列)を受け取ります。
211
212## IO
213以下のAPI呼び出しは`le.io`で始まります。
214* `get_mouse` = マウスカーソルの位置を返します。
215* `key.is_press` = 押されたキーを返します。文字列パラメータを受け取ります。
216* `key.is_release` = 離されたキーを返します。文字列パラメータを受け取ります。
217* `key.is_hold` = 押され続けているキーを返します。文字列パラメータを受け取ります。
218
219## 数学
220以下のAPI呼び出しは`le.math`で始まります。
221* `identity` = 単位行列を返します。
222* `translate` = 平行移動行列を返します。X, Y, Zの3つのfloatを受け取ります。
223* `scale` = 拡大縮小行列を返します。X, Y, Zの3つのfloatを受け取ります。
224* `rotate_x` = X軸回転行列を返します。角度の1つのfloatを受け取ります。
225* `rotate_y` = Y軸回転行列を返します。角度の1つのfloatを受け取ります。
226* `rotate_z` = Z軸回転行列を返します。角度の1つのfloatを受け取ります。
227* `rotate` = 回転行列を返します。pitch, yaw, rollの3つのfloatを受け取ります。
228* `perspective` = 透視投影行列を返します。視野角、アスペクト比、near、farの4つのfloatを受け取ります。
229* `mul` = 2つの行列を掛けた結果を返します。2つの行列を受け取ります。
230* `look_at` = LookAt行列を返します。eye, target, upそれぞれに3D軸の9つのfloatを受け取ります。
231
232## グラフィックス
233以下のAPI呼び出しは`le.gfx`で始まります。
234* `add_mesh` = 頂点、インデックス、属性を受け取り、ビューポートに2Dまたは3Dオブジェクトを描画します。
235* `get_position` = オブジェクトの現在の位置を返します。メッシュインデックスの1つの整数を受け取ります。
236* `set_position` = メッシュの位置を変更します。メッシュインデックスの1つの整数とXYZ軸の3つのfloatを受け取ります。
237* `get_rotation` = オブジェクトの現在の回転を返します。メッシュインデックスの1つの整数を受け取ります。
238* `set_rotation` = メッシュの回転を変更します。メッシュインデックスの1つの整数とXYZ軸の3つのfloatを受け取ります。
239* `get_scale` = オブジェクトの現在のスケールを返します。メッシュインデックスの1つの整数を受け取ります。
240* `set_scale` = メッシュのスケールを変更します。メッシュインデックスの1つの整数とXYZ軸の3つのfloatを受け取ります。
241* `set_uniform1` または `set_uniform_float1` = 1次元uniformを変更します。属性名の1つの文字列とX軸の1つのfloatを受け取ります。
242* `set_uniform2` または `set_uniform_float2` = 2次元uniformを変更します。属性名の1つの文字列とXY軸の2つのfloatを受け取ります。
243* `set_uniform3` または `set_uniform_float3` = 3次元uniformを変更します。属性名の1つの文字列とXYZ軸の3つのfloatを受け取ります。
244* `set_uniform4` または `set_uniform_float4` = 4次元uniformを変更します。属性名の1つの文字列とXYZW軸の4つのfloatを受け取ります。
245* `set_uniform_double1` = 1次元uniformを変更します。属性名の1つの文字列とX軸の1つのdoubleを受け取ります。
246* `set_uniform_double2` = 2次元uniformを変更します。属性名の1つの文字列とXY軸の2つのdoubleを受け取ります。
247* `set_uniform_double3` = 3次元uniformを変更します。属性名の1つの文字列とXYZ軸の3つのdoubleを受け取ります。
248* `set_uniform_double4` = 4次元uniformを変更します。属性名の1つの文字列とXYZW軸の4つのdoubleを受け取ります。
249* `set_uniform_int1` = 1次元uniformを変更します。属性名の1つの文字列とX軸の1つの符号付きintを受け取ります。
250* `set_uniform_int2` = 2次元uniformを変更します。属性名の1つの文字列とXY軸の2つの符号付きintを受け取ります。
251* `set_uniform_int3` = 3次元uniformを変更します。属性名の1つの文字列とXYZ軸の3つの符号付きintを受け取ります。
252* `set_uniform_int4` = 4次元uniformを変更します。属性名の1つの文字列とXYZW軸の4つの符号付きintを受け取ります。
253* `set_uniform_uint1` = 1次元uniformを変更します。属性名の1つの文字列とX軸の1つの符号なしintを受け取ります。
254* `set_uniform_uint2` = 2次元uniformを変更します。属性名の1つの文字列とXY軸の2つの符号なしintを受け取ります。
255* `set_uniform_uint3` = 3次元uniformを変更します。属性名の1つの文字列とXYZ軸の3つの符号なしintを受け取ります。
256* `set_uniform_uint4` = 4次元uniformを変更します。属性名の1つの文字列とXYZW軸の4つの符号なしintを受け取ります。
257* `set_uniform_vec3` = 3次元uniformを変更します。属性名の1つの文字列とXYZ軸の3つのfloatを受け取ります。
258* `set_uniform_mat4` = 4x4行列uniformを変更します。属性名の1つの文字列と1つの4x4行列を受け取ります。
259
260## キーコード
261`key.is_press`、`key.is_release`、`key.is_hold`で使用できるキーコードは以下の通りです:
262"q", "w", "e", "r", "t", "y", "u", "i", "o", "p"
263"a", "s", "d", "f", "g", "h", "j", "k", "l"
264"z", "x", "c", "v", "b", "n", "m"
265"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
266"enter", "space", "shift", "backspace"
267"up", "down", "left", "right")";
268 } else {
269 md = R"(# Lua Engine
270Shader Playground offers a basic, but powerful Lua scripting engine.
271It comes with its own standard library, which starts with `le.`.
272The library is still developing as needs grow.
273
274## Functions
275There are 2 functions: `Init` and `Update`.
276The `Init` function executes only at the first frame from compile time.
277The `Update` function executes on every frame.
278
279## Core
280The following API calls start with `le.`
281* `api_version` = returns the version of Lua Engine API.
282* `log` = prints text and variables, works similar to Javascript's `console.log()`. Takes in any parameters.
283* `sizeof` = returns the size of various data types. Takes in data types as strings as parameter.
284
285## System
286The following API calls start with `le.sys`
287* `get_time` = returns the total amount of time Shader Playground has been running.
288* `get_delta_time` = returns the delta of `get_time`.
289* `get_timer_frequency` = returns the timer frequency of Shader Playground.
290* `get_resolution` = returns the resolution of Shader Playground, NOT the viewport.
291* `random` = returns the random value between 2 integers. Takes in 2 parameters, both strings.
292
293## IO
294The following API calls start with `le.io`
295* `get_mouse` = returns the mouse cursor position.
296* `key.is_press` = returns the key pressed. Takes in string parameter.
297* `key.is_release` = returns the key released. Takes in string parameter.
298* `key.is_hold` = returns the key held. Takes in string parameter.
299
300## Math
301The following API calls start with `le.math`
302* `identity` = returns the identity matrix.
303* `translate` = returns the translation matrix. Takes in 3 floats for X, Y, and Z.
304* `scale` = returns the scale matrix. Takes in 3 floats for X, Y, and Z.
305* `rotate_x` = returns the rotation matrix on X. Takes in 1 float for angle.
306* `rotate_y` = returns the rotation matrix on Y. Takes in 1 float for angle.
307* `rotate_z` = returns the rotation matrix on Z. Takes in 1 float for angle.
308* `rotate` = returns the rotation matrix. Takes in 3 floats for pitch, yaw, and roll.
309* `perspective` = returns the perspective matrix. Takes in 4 floats for field of view, aspect, near, and far.
310* `mul` = returns the result of 2 matrices multiplied together. Takes in 2 matrices.
311* `look_at` = returns the look at matrix. Takes in 9 floats for eye, target, and up of each 3D axis.
312
313## Graphics
314The following API calls start with `le.gfx`
315* `add_mesh` = takes in vertices, indices, and attributes to then render either a 2D or 3D object in the viewport.
316* `get_position` = returns the current position of an object. Takes in 1 integer for the mesh index.
317* `set_position` = modifies the position of a mesh. Takes in 1 integer for the mesh index and 3 floats for the XYZ axis.
318* `get_rotation` = returns the current rotation of an object. Takes in 1 integer for the mesh index.
319* `set_rotation` = modifies the rotation of a mesh. Takes in 1 integer for the mesh index and 3 floats for the XYZ axis.
320* `get_scale` = returns the current scale of an object. Takes in 1 integer for the mesh index.
321* `set_scale` = modifies the scale of a mesh. Takes in 1 integer for the mesh index and 3 floats for the XYZ axis.
322* `set_uniform1` or `set_uniform_float1` = modifies a 1D uniform. Takes in 1 string for the attribute name and 1 float for the X axis.
323* `set_uniform2` or `set_uniform_float2` = modifies a 2D uniform. Takes in 1 string for the attribute name and 2 floats for the XY axis.
324* `set_uniform3` or `set_uniform_float3` = modifies a 2D uniform. Takes in 1 string for the attribute name and 3 floats for the XYZ axis.
325* `set_uniform4` or `set_uniform_float4` = modifies a 2D uniform. Takes in 1 string for the attribute name and 4 floats for the XYZW axis.
326* `set_uniform_double1` = modifies a 1D uniform. Takes in 1 string for the attribute name and 1 double for the X axis.
327* `set_uniform_double2` = modifies a 2D uniform. Takes in 1 string for the attribute name and 2 doubles for the XY axis.
328* `set_uniform_double3` = modifies a 2D uniform. Takes in 1 string for the attribute name and 3 doubles for the XYZ axis.
329* `set_uniform_double4` = modifies a 2D uniform. Takes in 1 string for the attribute name and 4 doubles for the XYZW axis.
330* `set_uniform_int1` = modifies a 1D uniform. Takes in 1 string for the attribute name and 1 signed int for the X axis.
331* `set_uniform_int2` = modifies a 2D uniform. Takes in 1 string for the attribute name and 2 signed ints for the XY axis.
332* `set_uniform_int3` = modifies a 2D uniform. Takes in 1 string for the attribute name and 3 signed ints for the XYZ axis.
333* `set_uniform_int4` = modifies a 2D uniform. Takes in 1 string for the attribute name and 4 signed ints for the XYZW axis.
334* `set_uniform_uint1` = modifies a 1D uniform. Takes in 1 string for the attribute name and 1 unsigned int for the X axis.
335* `set_uniform_uint2` = modifies a 2D uniform. Takes in 1 string for the attribute name and 2 unsigned ints for the XY axis.
336* `set_uniform_uint3` = modifies a 2D uniform. Takes in 1 string for the attribute name and 3 unsigned ints for the XYZ axis.
337* `set_uniform_uint4` = modifies a 2D uniform. Takes in 1 string for the attribute name and 4 unsigned ints for the XYZW axis.
338* `set_uniform_vec3` = modifies a 3D uniform. Takes in 1 string for the attribute name and 3 floats for the XYZ axis.
339* `set_uniform_mat4` = modifies a 4D uniform. Takes in 1 string for the attribute name and 1 4x4 matrix.
340
341## Key codes
342The following key codes are supported for use with `key.is_press`, `key.is_release`, and `key.is_hold`:
343"q", "w", "e", "r", "t", "y", "u", "i", "o", "p"
344"a", "s", "d", "f", "g", "h", "j", "k", "l"
345"z", "x", "c", "v", "b", "n", "m"
346"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
347"enter", "space", "shift", "backspace"
348"up", "down", "left", "right")";
349 }
350 ImGui::Markdown(md.c_str(), md.length(), mdConfig);
351 ImGui::Markdown(md.c_str(), md.length(), mdConfig);
352 } else if (m_CurPage == "hotkeys") {
353 string md;
354 if (info.i18n->GetCurrentLanguage().code == "ja_JP") {
355 md = R"(# ホットキー
356Shader Playgroundは、ほとんどの操作にホットキーを提供しています。
357
358## UI
359CTRL + Tab = ウィンドウの切り替え
360ビューポート上で右クリック = クリア色の変更
361F1 = このマニュアルを開く
362CTRL + , = 設定ウィンドウを開く
363CTRL + H = 「Shader Playgroundについて」ウィンドウを開く
364Escape = 現在のポップアップウィンドウおよび/またはモーダルを閉じる
365
366## シーン
367CTRL + N = 新しいシーンを作成
368CTRL + O = 既存のシーンを開く
369CTRL + S = 現在のシーンを保存
370CTRL + Shift + S = 現在のシーンを別名で保存
371
372## ビルド
373F5 = シェーダーとLuaコードをコンパイル
374
375## エディタ
376CTRL + Z = 元に戻す
377CTRL + Y = やり直し
378CTRL + X = 切り取り
379CTRL + C = コピー
380CTRL + V = 貼り付け
381CTRL + D = 複製
382CTRL + A = 全て選択)";
383 } else {
384 md = R"(# Hotkeys
385Shader Playground offers hotkeys for most operations.
386
387## UI
388CTRL + Tab = switch between windows
389Right click on viewport = change clear color
390F1 = open this manual
391CTRL + , = open settings window
392CTRL + H = open "About Shader Playground" window
393Escape = close current popup window and/or modal
394
395## Scenes
396CTRL + N = create new scene
397CTRL + O = open an already existing scene
398CTRL + S = save current scene
399CTRL + Shift + S = save current scene under a different name
400
401## Building
402F5 = compile shaders and Lua code
403
404## Editor
405CTRL + Z = undo
406CTRL + Y = redo
407CTRL + X = cut
408CTRL + C = copy
409CTRL + V = paste
410CTRL + D = duplicate
411CTRL + A = select all)";
412 }
413 ImGui::Markdown(md.c_str(), md.length(), mdConfig);
414 }
415
416 ImGui::EndChild();
417 ImGui::End();
418 }
419
420 /////////
421
422 void Manual::renderMarkdown(cstr text) {
423 ImGui::PushTextWrapPos(ImGui::GetContentRegionAvail().x);
424 ImGui::TextUnformatted(text);
425 ImGui::PopTextWrapPos();
426 }
427} // namespace gui