Emuforums.com

Go Back   Emuforums.com > General Discussion > Web development / Programming
About Us Register FAQ Members List Calendar Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old August 14th, 2003   #1 (permalink)
Emu author
 
zenogais's Avatar
 
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
zenogais is offline   Reply With Quote
Old August 14th, 2003   #2 (permalink)
Fallen
 
Kraelis's Avatar
 
Join Date: Jun 2001
Location: Moonlight Spire
Posts: 1,393
Re: SDL Resources

The main site is as best as you can go... so far... I think they have some links to *some* good sites. I learned SDL on my own from there. I can even do OpenGL integration too!
__________________
--KrÆlis Cross


Mundus vult decipi, ergo decipiatur

===============
Athlon 64 x2 3800| Asrock ALiveNF6G-VSTA | Kingston DDR2 1 Gb RAM
Kraelis is offline   Reply With Quote
Old August 14th, 2003   #3 (permalink)
Emu author
 
zenogais's Avatar
 
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!!
zenogais is offline   Reply With Quote
Old August 14th, 2003   #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.
RamsusX is offline   Reply With Quote
Old August 14th, 2003   #5 (permalink)
Emu author
 
zenogais's Avatar
 
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?
zenogais is offline   Reply With Quote
Old August 14th, 2003   #6 (permalink)
Ramsus K
 
Join Date: Mar 2003
Location: Oklahoma
Posts: 461
Can you hear CD audio when you use the Windows CD Player program to play an audio CD? If not, check your mixer settings. Otherwise, try posting the relevant code from your program.
RamsusX is offline   Reply With Quote
Old August 15th, 2003   #7 (permalink)
Emu author
 
zenogais's Avatar
 
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;
	}
zenogais is offline   Reply With Quote
Old August 15th, 2003   #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:
SDL_CDPlayTracks should only be called after calling SDL_CDStatus to get track information about the CD.
Sounds like you need to first make a call to SDL_CDStatus. See the documentation for information on how to use it.
RamsusX is offline   Reply With Quote
Old August 15th, 2003   #9 (permalink)
Emu author
 
zenogais's Avatar
 
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());
	}
}
zenogais is offline   Reply With Quote
Old August 16th, 2003   #10 (permalink)
Ramsus K
 
Join Date: Mar 2003
Location: Oklahoma
Posts: 461
Re: SDL Resources

Did you initialize the audio subsystem?
RamsusX is offline   Reply With Quote
Old August 16th, 2003   #11 (permalink)
Emu author
 
zenogais's Avatar
 
Join Date: Aug 2003
Location: Victorville(Near Los Angeles or LA for those who are on the DL)
Posts: 839
Re: SDL Resources

Yes, I initialized it with SDL_INIT
zenogais is offline   Reply With Quote
Old August 17th, 2003   #12 (permalink)
Ramsus K
 
Join Date: Mar 2003
Location: Oklahoma
Posts: 461
Re: SDL Resources

Sounds like it could be a bug in SDL. Have some friends test the program out on their computers.
RamsusX is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 22:20.

© 2006 - 2008 Emu Forums | About Emu Forums | Legal | A member of the Crowdgather Forum Community


Powered by vBulletin® Version 3.7.0 Release Candidate 3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5