Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

surface_generic.h

Go to the documentation of this file.
00001 /*
00002         $Id: surface_generic.h,v 1.1 2001/03/06 15:09:17 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifndef header_surface_generic
00016 #define header_surface_generic
00017 
00018 #include "cardsurface.h"
00019 
00020 class CL_Surface_Generic
00021 {
00022 public:
00023         CL_Surface_Generic(
00024                 CL_SurfaceProvider *provider,
00025                 bool delete_provider,
00026                 bool dynamic,
00027                 class CL_Resource *resource = NULL);
00028 
00029         virtual ~CL_Surface_Generic();
00030 
00031         virtual void flush(CL_DisplayCard *card = NULL);
00032         virtual CL_SurfaceProvider *get_provider() const;
00033 
00034         virtual CL_CardSurface *get_cardsurface(int surface_num);
00035         virtual CL_CardSurface *get_cardsurface(CL_DisplayCard *card = NULL);
00036 
00037         // Display functions
00038         virtual void put_screen(
00039                 int x,
00040                 int y,
00041                 int spr_no=0,
00042                 CL_DisplayCard *card=NULL);
00043 
00044         virtual void put_screen(
00045                 int x,
00046                 int y,
00047                 float scale_x,
00048                 float scale_y,
00049                 int spr_no=0,
00050                 CL_DisplayCard *card=NULL);
00051 
00052         virtual void put_screen(
00053                 int x,
00054                 int y,
00055                 int size_x,
00056                 int size_y,
00057                 int spr_no=0,
00058                 CL_DisplayCard *card=NULL);
00059         
00060         virtual void put_target(
00061                 int x,
00062                 int y,
00063                 int spr_no,
00064                 CL_Target *target);
00065 
00066         virtual unsigned int get_width() const { return width; }
00067         virtual unsigned int get_height() const { return height; }
00068         virtual unsigned int get_num_frames() const { return no_sprs; }
00069 
00070         // is_video() returns true if in videomemory
00071         // on the specified card (null = current dispcard)
00072         virtual bool is_video(CL_DisplayCard *card = NULL) const;
00073         virtual bool is_loaded(CL_DisplayCard *card = NULL) const;
00074 
00075         // returns true if successfully loaded into videomemory, or already there
00076         virtual bool convert_video(CL_DisplayCard *card = NULL);
00077 
00078         // never fails! (or serious heap usage!)
00079         virtual bool convert_system(CL_DisplayCard *card = NULL);
00080 
00081         virtual void reload();
00082 
00083         int add_reference();
00084         int release_reference();
00085 
00086 protected:
00087         CL_SurfaceProvider *provider;
00088         bool delete_provider;
00089         CL_CardSurface **card_surfaces;
00090         int width, height, no_sprs;
00091         int translate_x, translate_y;
00092         bool dynamic;
00093 
00094         int ref_count;
00095 
00096         CL_Resource *resource;
00097 
00098         inline int ensure_surface_prepared(CL_DisplayCard *card);
00099 };
00100 
00101 #endif

Generated at Wed Apr 4 19:54:04 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001