[ÀÌÀü] ¸ñÂ÷ [´ÙÀ½]

Simple DirectMedia Layer API »ç¿ëÇϱâ

¶óÀ̺귯¸® ÃʱâÈ­

¶óÀ̺귯¸®¸¦ µ¿ÀûÀ¸·Î ·ÎµåÇÏ°í ÃʱâÈ­Çϱâ À§Çؼ­´Â SDL_Init() ¸¦ »ç¿ëÇÑ´Ù. ÀÌ ÇÔ¼ö´Â È°¼ºÈ­ÇÏ°íÀÚ ÇÏ´Â ºÎºÐ¿¡ ÇØ´çÇÏ´Â Ç÷¡±×µéÀ» ÃëÇÑ´Ù. :

SDL_INIT_AUDIO
SDL_INIT_VIDEO
SDL_INIT_CDROM
SDL_INIT_TIMER

¶óÀ̺귯¸®ÀÇ »ç¿ëÀ» ¸¶ÃÆÀ¸¸é SDL_Quit() ¸¦ ÅëÇØ ¶óÀ̺귯¸®¸¦ Á¤¸®ÇÑ´Ù.

Tip:
SDLÀº ½Ã½ºÅÛ ¶óÀ̺귯¸®µéÀÌ ±âº»ÀûÀ¸·Î À§Ä¡ÇÑ µð·ºÅ丮·ÎºÎÅÍ SDL ¶óÀ̺귯¸®¸¦ ·ÎµåÇÑ´Ù. ¾ÖÇø®ÄÉÀ̼ÇÀÌ ¹èÆ÷µÉ ¶§ ÇÔ²² Á¦°øµÈ µ¿Àû ¶óÀ̺귯¸®µéÀÌ º°µµÀÇ µð·ºÅ丮·ÎºÎÅÍ ·ÎµåµÇµµ·Ï ÇÏ·Á¸é SDL_SetLibraryPath() ÇÔ¼ö¸¦ »ç¿ëÇÑ´Ù.
¿¹Á¦:
#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);

    ...
}

[ÀÌÀü] ¸ñÂ÷ [´ÙÀ½]