Thread: Abstract Base Class discription.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    450

    Abstract Base Class discription.

    I just created an abstract base class called button that I will use as an interface button in a dirctdraw/network game I am creating.
    Take a look and tell me if it looks ok.
    I questioned one thing, can you make the destructor the pure virtual function?
    Code:
    #ifndef _BUTTON_H_
    #define _BUTTON_H_
    
    #include <ddraw.h>
    #include <windows.h>
    #include <windowsx.h>
    
    class Button
    {
    public:
    	Button();
    	virtual IDirectDrawSurface * hover(IDirectDrawSurface * pddshovered,int width,int height); 
    	virtual sfns * pressed(IDirectDrawSurface * pddspressed, int width, int height);
    	virtual bool released(sfns * pscleansfns);
    	virtual IDirectDrawSurface * display(IDirectDrawSurface * pddsbuttonsurface, int width, int height);
    	virtual IDirectDrawSurface * erase(IDirectDrawSurface * pddsbackbufferclearsurface,int width, int height);  
    	virtual ~Button(void) = 0;
    
    private:
    	STRUCT
    	{
    		IDirectSurface * pdds;
    		int surfacewidth;
    		int surfaceheight;
    		int result;
    	} sfns;
    };//endclass
    
    #endif;
    Last edited by curlious; 11-07-2003 at 08:08 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. derived class can not access base class protected member?
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 10-21-2007, 06:32 PM
  2. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 02:46 PM
  3. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 01:09 PM
  4. Abstract Base Class and References
    By Thantos in forum C++ Programming
    Replies: 9
    Last Post: 10-13-2004, 01:35 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM