CDROM Audio

Opening A Drive

Once we know there is a drive, we can open it:

SDL_CD * cdrom;
...
cdrom = SDL_CDOpen(drive);

if (cdrom == NULL)
  {
    fprintf(stderr,
            "Can't open CD%d: %s\n",
            drive + 1,
            SDL_GetError());
  }

Don't forget to close it when you're done:

SDL_CDClose(cdrom);