xlib_playground

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 4a6efce433ac52ebc9fadb760192409701d6c1f2
parent 1c42784c3c3c5db42e097593e2de647fda0e27c5
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Fri, 16 Dec 2022 15:16:32 +0900

add fps section

Diffstat:
Mnote.html | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/note.html b/note.html @@ -8,11 +8,18 @@ <h2>初期設定</h2> <p>ディスプレイを開き、ウィンドウを作成する。tsodingの動画が分かりやすかった。</p> <p>適当な四角形のものを表示し、その位置を時間の関数として動かしてみる。</p> +<p>文字を表示。<code>XDrawString</code></p> + +<h2>キーボード入力</h2> <p>キーボードの入力を受け付けるようにする。入力によって四角形の位置や速度を変化させる。</p> <p>ここまでできればかなりなんでもできるようになる。</p> -<p>文字を表示。<pre><code>XDrawString</code></pre></p> + +<h2>FPSの固定</h2> +<p>前のフレームからの経過時間を計測して1/FPSを越えるまで待機させる。このときに<code>nanosleep</code>を使うとなぜか上手くいかなかった。OSに処理をブロックされる為か?とりあえず<code>while</code>ループの中でひたすら時刻を読んでいるのだが、これでいいんかな。リソールの無駄遣いではないんかな。</p> <h2>メニューの実装</h2> +<p>メニューとゲームの推移を実装した。</p> + <h2>参考</h2> <ul>