Jump to content
  • Advertisement
Sign in to follow this  
31337noob

checking to see if there is a cd?

This topic is 4754 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

is there a function to see the name of the cd (in c++)? or is there another way for checking to see if you have the right cd in the cd-rom tray. thanks in advanced.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by silverphyre673
in what? I think it would depend on a number of things: your OS, your API, etc.


winxp, c++

Share this post


Link to post
Share on other sites
The API is Win32, you will probably need to go searching though the platform sdk documentation for disc drive detection.

Share this post


Link to post
Share on other sites
SDL has some CD-ROM related functions, notably related to your problem is SDL_CDStatus.

Quote:
From the SDL documentation site: SDL_CDStatus
SDL_CDStatus
Name
SDL_CDStatus -- Returns the current status of the given drive.
Synopsis

#include "SDL.h"

CDstatus SDL_CDStatus(SDL_CD *cdrom);

/* Given a status, returns true if there's a disk in the drive */
#define CD_INDRIVE(status) ((int)status > 0)

[...]


Edit: Curse your evil, deceptice title!!! You want to know the name of the CD :-p. See SDL_CDName instead, then.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!