Página principal | Jerarquía de la clase | Lista de componentes | Lista de archivos | Miembros de las clases

GE_Layer.h

00001 /***************************************************************************
00002  *   Copyright (C) 2004 by Luis Murciano Renedo                            *
00003  *   luis@localhost                                                        *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef GELAYER_H
00022 #define GELAYER_H
00023 
00024 #include <iostream.h>
00025 #include <stdio.h>
00026 #include <SDL/SDL.h>
00027 #include <SDL/SDL_image.h>
00028 #include <vector.h>
00029 #include "GE_Types.h"
00030 
00032 
00035 class GE_Layer
00036 {
00037 protected:
00038     
00040 
00041     bool visibilidad;
00042     
00044     SDL_Rect rect;
00045     
00047     SDL_Surface *surface;
00048     
00050 
00051     SDL_Surface* stored;
00052 
00053 public:
00054     
00056     vector <GE_Layer *> SubLayer;
00057 
00059     GE_Layer();
00060     
00062 
00063     GE_Layer(char *file_name, int x=0, int y=0 , int w=0, int h=0);
00064     
00066     GE_Layer(SDL_Surface *surface, int x=0, int y=0 , int w=0, int h=0);
00067     
00069     virtual ~GE_Layer();
00070 
00071     
00073     inline void setSurface(SDL_Surface *sdl_surface)
00074     {
00075         surface = sdl_surface;
00076     };
00077     
00079     void setSurface(char *);
00080     
00081     
00083     inline void setRect(SDL_Rect sdl_rect)
00084     {
00085         rect = sdl_rect;
00086     };
00087     
00089     inline void setRect(int x, int y)
00090     {
00091         rect.x=x;
00092         rect.y = y;
00093     };
00094     
00096     void setRect(GE_Vector vector);
00097     
00099     inline SDL_Surface* getSurface(void)
00100     {
00101         return surface;
00102     };
00103     
00105     inline SDL_Rect getRect (void)
00106     {
00107         return rect;
00108     };
00109     
00111 
00112     void addSubLayer(GE_Layer &NewLayer,int x = 0, int y = 0);
00113     
00115 
00116     void addSubLayer(GE_Layer&, SDL_Rect);
00117     
00119 
00120     void addSubLayer(GE_Layer*,int x = 0, int y = 0);
00121     
00122 
00124     Uint32 getPixel( int x, int y);
00125     
00127     SDL_PixelFormat * getPixelFormat();
00128     
00130 
00131     inline bool isVisible ()
00132     {
00133         return visibilidad;
00134     };
00135     
00136     
00138 
00139     inline void visible(bool v)
00140     {
00141         visibilidad = v;
00142     };
00143     
00145 
00146     GE_Layer& operator= (const GE_Layer&);
00147 };
00148 #endif

Generado el Mon Dec 6 10:30:28 2004 para Genma por doxygen 1.3.5