/********************************************************************
 * File: Display.h
 * Author: Keith Schwarz (htiek@cs.stanford.edu)
 *
 * An object representing an output device for the Copper3D system.
 * It need only support buffered pixel plotting.
 */
#ifndef Display_Included
#define Display_Included

#include <stdlib.h>
#include "Color.h"
#include "RefCountedObject.h"

namespace Copper3D
{
	class Display: public RefCountedObject
	{
	public:
		/* Factory: Display::New(size_t width, size_t height);
		 * Usage: Display* d = Display::New(400, 300);
		 * ----------------------------------------------------------------
		 * Creates a new Display object configured for the host system.
		 * The Display will have an output space of size width x height.
		 */
		static Display* New(size_t width, size_t height);

		virtual void plotPixel(size_t x, size_t y, Color c) = 0;
		virtual void display() = 0;
		virtual void clear() = 0;

		size_t width() const;
		size_t height() const;

	protected:
		/* Derived classes should call into this to set up the width/height. */
		Display(size_t width, size_t height);

		/* Polymorphic classes need virtual destructors. */
		virtual ~Display();

	private:
		size_t mWidth, mHeight;
	};
}

#endif
