|
|
|||||||
| About Us | Register | FAQ | Members List | Calendar | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Emu author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
|
SDL Resources
Does anyone know any good online resources for information about SDL(Simple DirectMedia Layer). Any good sites with lots of info on it would be really helpful.
Thanks in advance, zenogais |
|
|
|
|
|
#3 (permalink) |
|
Emu author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
|
Re: SDL Resources
Thanks for the info, if you can learn all that you have from there then I have faith I should be able to get what I need. Thanks much!!
|
|
|
|
|
|
#4 (permalink) |
|
Ramsus K
![]() ![]() ![]() Join Date: Mar 2003
Location: Oklahoma
Posts: 461
|
I use the Library reference documentation. It should be all you really need once you've learned the basics of SDL programming from a few tutorials.
|
|
|
|
|
|
#5 (permalink) |
|
Emu author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
|
Re: SDL Resources
If you guys wouldn't mind can you help me with a problem. How come when I use SDL_CDPlayTracks() to play an Audio CD I can't hear anything?
|
|
|
|
|
|
#7 (permalink) |
|
Emu author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
|
Re: SDL Resources
I get an invalid starting track when I run the program, here is the relevent code. Also, I can hear the audio when I play the CD with WinAmp, whats going on?:
Code:
if(SDL_CDPlayTracks(cdrom, 0, 0, 0, 0) < 0) {
printf("Couldn't Play CD Audio Tracks: %s\n", SDL_GetError());
return;
}
|
|
|
|
|
|
#8 (permalink) | |
|
Ramsus K
![]() ![]() ![]() Join Date: Mar 2003
Location: Oklahoma
Posts: 461
|
Do you have multiple CD/DVD Drives? You may be opening the wrong one. Use SDL_CDNumDrives() to find out how many drives SDL detects.
EDIT: Also, from the documentation: Quote:
|
|
|
|
|
|
|
#9 (permalink) |
|
Emu author
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
|
Re: SDL Resources
I took the code stragiht from the documents, so I did call if(CD_INDRIVE(SDL_CDStatus(cdrom)) ). The problem is the light on my CD-ROM drive just keeps on flashing and nothing seems to happen. I'm not sure whats going on, here's the entire source:
Code:
void SDLPlayCD() {
if(SDL_WasInit(SDL_INIT_CDROM) == 0) {
printf("Initializing CD-ROM Drive.\n");
if(SDL_InitSubSystem(SDL_INIT_CDROM) < 0)
printf("Failed to Initialize CD-Rom: %s\n", SDL_GetError());
}
if(SDL_CDNumDrives() == 0) {
printf("Fatal Error: No CD-ROM Drives!\n");
return;
}
int numdrive = SDL_CDNumDrives();
printf("Num CD Drives: %d\n", numdrive);
printf("CD0 %s\n", SDL_CDName(0));
printf("CD1 %s\n", SDL_CDName(1));
cdrom = SDL_CDOpen(0);
if(cdrom == NULL) {
printf("Error: Unable to Open Access to CD-ROM Drive %s: %s\n", SDL_CDName(0), SDL_GetError());
return;
}
if(SDL_CDStatus(cdrom) > 0) {
printf("Playing CD\n");
if(SDL_CDPlayTracks(cdrom, 0, 0, 0, 0) < 0) {
printf("Couldn't Play CD Audio Tracks: %s\n", SDL_GetError());
return;
} else {
printf("CD is playing\n");
}
} else {
printf("CD Error: %s\n", SDL_GetError());
}
}
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|