- “Dépôt”
- Dépôt nu
- Dépôt avec copie de travail
- “Working tree” / “Copie de travail” / “Dossier de travail”
- “Index”
- “Commit”
- “Log”
- “Diff”
- “Remote”
git init NOUVEAU_DOSSIER
git clone URL NOUVEAU_DOSSIER
git add FICHIER
git commit
git commit FICHIER
git status -s
git diff
git diff --cached
git diff FICHIER
git diff --cached FICHIER
git log
git log FICHIER
git push
git pull
git pull REMOTE BRANCH
- Comprendre et maîtriser les commandes de base (et leurs options):
pwd
cd
et son option-
ls
et ses options-l
et -a=mkdir
rmdir
rm
cat
echo
- Comprendre la signification des éléments de contruction des chemins vers fichiers et dossiers:
/
en début de chemin/
ailleurs dans un chemin~
.
ou./
..
ou../
*
- Et leurs usages couplés tels que:
cd ~
oucd
cd ../
cd -
mkdir dossier
cd dossier/
mkdir dossier && cd dossier/
rmdir dossier/
rm -r dossier/
ls
ls -l
ls -a
ls -al
ls ~
ls ../
ls ../dossier/
ls *.cpp
- L’utilité de la touche
TAB
dans le Shell
Le frame rate est la vitesse, ou le taux, de rafraîchissement de l’écran d’un jeu.
Il s’exprime soit
- en Hz: par exemple 50Hz pour 50 images par secondes
- en ms (millisecondes): par exemple 20ms (= 1/50Hz)
#include <SDL2/SDL.h>
... func(int frame_rate_ms, ...) {
int frame_delay;
Uint32 frame_start;
// Start the main game loop:
do {
// Begin of current frame:
frame_start = SDL_GetTicks();
// Check for pressed keyboard keys:
...
// Next iteration of the game:
...
// Render the game:
...
// Compute elapsed time since the begin of current frame:
frame_delay = frame_rate_ms - (SDL_GetTicks() - frame_start);
// Wait for some time in order to stabilise frame rate to ~20ms:
if (frame_delay > 0)
SDL_Delay(frame_delay);
} while (...);
...
}
#include <SDL2/SDL.h>
... func(int frame_rate_ms, int snake_speed_fpc, ...) {
int frame_delay;
Uint32 frame_start;
// Start the main game loop:
Uint32 iter = 0;
do {
// Begin of current frame:
frame_start = SDL_GetTicks();
// Check for pressed keyboard keys: <--- IMPORTANT: Le clavier est toujours "lu" à 50Hz!
...
// Make the game to evolve / snake to move, only every =snake_speed_fpc= frames:
if (iter % snake_speed_fpc == 0) {
// Next iteration of the game:
...
}
// Render the game:
this->Draw();
// Compute elapsed time since the begin of current frame:
frame_delay = frame_rate_ms - (SDL_GetTicks() - frame_start);
// Wait for some time in order to stabilise frame rate to ~20ms:
if (frame_delay > 0)
SDL_Delay(frame_delay);
// Print a warning if the game is too slow with respect to the frame rate:
if (frame_delay > frame_rate_ms)
printf("WARNING: frame rate drop: %d ms\n", frame_delay - frame_rate_ms);
// Check for Quit event:
SDL_PollEvent(&event);
iter++;
} while (!(event.type == SDL_QUIT));
...
}
Par exemple chez moi:
frame_rate_ms
= 20snake_speed_fpc
= 7 (le jeu évolue toutes les 7 frames)
Cf. howto-uml-setup.org.