Source

gb_emulator / gb_emulator / include / gb_emulator / gb_config.h

Full commit
/*  Copyright Š 2011 Chris Spencer <spencercw@gmail.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#ifndef GB_CONFIG_H_E891C8C0_1E0A_11E1_A5CC_0002A5D5C51B
#define GB_CONFIG_H_E891C8C0_1E0A_11E1_A5CC_0002A5D5C51B

#include <boost/filesystem/path.hpp>

class GbConfig
{
public:
	//! Drivers that may be used to display the video emulation.
	enum VideoDriver
	{
		VIDEO_DEFAULT,  //!< Use an appropriate default.
		VIDEO_D3D11,    //!< Direct3D 11.
		VIDEO_OPENGL    //!< OpenGL.
	};

	//! Drivers that may be used to output the sound emulation.
	enum AudioDriver
	{
		AUDIO_DEFAULT,  //!< Use an appropriate default.
		AUDIO_WASAPI    //!< WASAPI.
	};

	//! Rendering method to use for the video emulation.
	enum Renderer
	{
		RENDER_DEFAULT,   //!< Use an appropriate default.
		RENDER_SOFTWARE,  //!< Performs emulation in software.
		//! Offloads some of the emulation onto the graphics hardware.
		/**
		 * This is experimental and is currently only supported by the Direct3D 11 video driver.
		 */
		RENDER_HARDWARE
	};

	//! The video driver to use.
	VideoDriver videoDriver;

	//! The audio driver to use.
	AudioDriver audioDriver;

	//! The rendering method to use.
	Renderer renderer;

	//! The ROM file to execute.
	/**
	 * This may be empty.
	 */
	boost::filesystem::path rom;

	//! The serial server to connect to.
	/**
	 * Leave this empty if you don't want to use serial communications or if you want to act as a
	 * server. If this is not empty \c serialPort must not be zero. This may be a hostname or an IP
	 * address (IPv4 and IPv6 are supported).
	 */
	std::string serialHost;

	//! The port of the remote serial server, or the port to serve on.
	/**
	 * Set this to zero if you don't want to use serial communications. To act as a server set this
	 * value and leave \c serialHost empty. If \c serialHost is not empty this value must not be
	 * zero.
	 */
	uint16_t serialPort;

	//! Default constructor; sets appropriate default values.
	GbConfig():
	videoDriver(VIDEO_DEFAULT),
	audioDriver(AUDIO_DEFAULT),
	renderer(RENDER_DEFAULT),
	serialPort(0)
	{
	}
};

#endif