SDL programming 1 (Environment configuration)

Source: Internet
Author: User

SDL is a free cross-platform multimedia development kit applicable to games, game sdks, demo software, simulators, MPEG players, and other applications.

You can go to the terminal.

1. Configure the path of the SDL header file and the Link Library in VC.

In the menu tools/options/Directores, set include files and library files to contain the corresponding SDL directories.

2. Create a Win32 console application project and add SDL. Lib sdlmain. lib to the object/library modules on the project/settings and link tab.

Or Add the following two lines of code to the source program:

# Pragma comment (Lib, "SDL. lib ")
# Pragma comment (Lib, "sdlmain. lib ")

3. Test SDL Configuration

# Include <stdlib. h>
# Include "SDL. H"

Int main (INT argc, char * argv [])
{
If (sdl_init (sdl_init_audio | sdl_init_video) <0) // initialize the audio and video SDL Library
{
Printf ("can not init SDL. \ n ");
Exit (1 );
}
Printf ("successful init SDL. \ n ");
Atexit (sdl_quit); // exit SDL
Return 0;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.