display.c
来自「乒乓球游戏程序」· C语言 代码 · 共 42 行
C
42 行
/*----------------------------------------------------------------
* display.c -- display routines
*----------------------------------------------------------------
* This module takes care of everything relating to the
* screen display.
*/
#include <allegro.h>
#include "display.h"
#include "gamevars.h"
/* display_init:
* Called once, at the start of the game.
*/
void display_init() {
if (set_gfx_mode (GFX_AUTODETECT, 320, 200, 0, 0) < 0)
abort();
clear (screen);
rect (screen, 0, 0, 319, 199, 7);
}
/* display_shutdown:
* Called after the game; should undo everything ~_init does.
*/
void display_shutdown() {
}
/* display_update:
* This is called every cycle, to update the screen display.
*
* Note that it is a slow routine; display routines tend to
* be slow, and this one includes a vsync.
*/
void display_update() {
vsync();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?