www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/21/09:17:07

Message-ID: <c=GB%a=_%p=Indigo_Active_Vi%l=CRIANLARICH-970421130655Z-367@crianlarich.Indigo>
From: Robert Humphris <r DOT humphris AT indigo-avs DOT com>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>,
"'Jeff Weeks'"
<pweeks AT execulink DOT com>
Subject: RE: Style AND speed in C++? How? Please, I need some radical ideas on this one!
Date: Mon, 21 Apr 1997 14:06:55 +0100
Encoding: 39 TEXT

How about using a parent class, and having all drivers for new cards
etc. as children of that class.

The base class would work thus:

class videoDriver
{
protected:
	// some stuff
private:
	videoDriver();
	~videoDriver();
	.. .
	// other virtual video functions ....
};

then you can derive all your new drivers from this:
class S3videoDriver : public videoDriver
{
	....
}


then you can do...

void main()
{
	videoDriver	*pvdVideo;
	pvdVideo = new S3videoDriver;

	S3videoDriver->....  // some driver type operation
	.. .
}


Any good do you think?

Rob Humphris
>

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019