[ÀÌÀü] ¸ñÂ÷ [´ÙÀ½]
¶óÀ̺귯¸®¸¦ µ¿ÀûÀ¸·Î ·ÎµåÇÏ°í ÃʱâÈÇϱâ À§Çؼ´Â SDL_Init() ¸¦ »ç¿ëÇÑ´Ù. ÀÌ ÇÔ¼ö´Â È°¼ºÈÇÏ°íÀÚ ÇÏ´Â ºÎºÐ¿¡ ÇØ´çÇÏ´Â Ç÷¡±×µéÀ» ÃëÇÑ´Ù. : SDL_INIT_AUDIO SDL_INIT_VIDEO SDL_INIT_CDROM SDL_INIT_TIMER ¶óÀ̺귯¸®ÀÇ »ç¿ëÀ» ¸¶ÃÆÀ¸¸é SDL_Quit() ¸¦ ÅëÇØ ¶óÀ̺귯¸®¸¦ Á¤¸®ÇÑ´Ù.
¶óÀ̺귯¸®¸¦ µ¿ÀûÀ¸·Î ·ÎµåÇÏ°í ÃʱâÈÇϱâ À§Çؼ´Â SDL_Init() ¸¦ »ç¿ëÇÑ´Ù. ÀÌ ÇÔ¼ö´Â È°¼ºÈÇÏ°íÀÚ ÇÏ´Â ºÎºÐ¿¡ ÇØ´çÇÏ´Â Ç÷¡±×µéÀ» ÃëÇÑ´Ù. :
¶óÀ̺귯¸®ÀÇ »ç¿ëÀ» ¸¶ÃÆÀ¸¸é SDL_Quit() ¸¦ ÅëÇØ ¶óÀ̺귯¸®¸¦ Á¤¸®ÇÑ´Ù.
#include <stdlib.h> #include "SDL.h" main(int argc, char *argv[]) { if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError()); exit(1); } atexit(SDL_Quit); ... }