1 .TH "SDL_CDOpen" "3" "Tue 11 Sep 2001, 22:58" "SDL" "SDL API Reference"
3 SDL_CDOpen\- Opens a CD-ROM drive for access\&.
8 \fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR);
11 Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&.
13 Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&.
20 SDL_Init(SDL_INIT_CDROM);
23 /* Check for CD drives */
24 if(!SDL_CDNumDrives()){
26 fprintf(stderr, "No CDROM devices available
31 /* Open the default drive */
34 /* Did if open? Check if cdrom is NULL */
36 fprintf(stderr, "Couldn\&'t open drive: %s
41 /* Print Volume info */
46 for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
47 FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame);
48 printf(" Track %d: Length %d:%d
49 ", cur_track, min, sec);
52 SDL_CDClose(cdrom);\fR
57 \fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR
58 ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 22:58