home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / video / gl_surface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-09-04  |  3.0 KB  |  102 lines

  1. /***************************************************************************
  2.  * gl_surface.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2005 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_GL_SURFACE_H
  17. #define SMC_GL_SURFACE_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../core/math/point.h"
  21.  
  22. /* *** *** *** *** *** *** *** *** OpenGL Surface *** *** *** *** *** *** *** *** *** */
  23.  
  24. class GL_Surface
  25. {
  26. public:
  27.     GL_Surface( void );
  28.     ~GL_Surface( void );
  29.  
  30.     /* Blit the surface on the given position
  31.      * if request is NULL automatically creates the request
  32.     */
  33.     void Blit( float x, float y, float z, cSurfaceRequest *request = NULL );
  34.     // Blit only the surface data on the given request
  35.     void Blit_Data( cSurfaceRequest *request );
  36.  
  37.     // Copy GL_Surface and return it
  38.     GL_Surface *Copy( void );
  39.  
  40.     // Save the texture to a file
  41.     void Save( string filename );
  42.  
  43.     // Set the ground type
  44.     void Set_Ground_Type( GroundType gtype );
  45.  
  46.     // Check if the OpenGL texture is used by another GL_Surface
  47.     bool Is_Texture_Use_Multiple( void );
  48.  
  49.     /* Return a software texture copy
  50.      * only_filename: if set doesn't save the software texture but only the filename
  51.     */
  52.     cSaved_Texture *Get_Software_Texture( bool only_filename = 0 );
  53.     // Load a software texture
  54.     void Load_Software_Texture( cSaved_Texture *soft_tex );
  55.  
  56.     // Return the filename
  57.     string Get_Filename( int with_dir = 2, bool with_end = 1 );
  58.     // Set a function called on destruction
  59.     void Set_Destruction_Function( void ( *nfunction )( GL_Surface * ) );
  60.  
  61.     // GL texture number
  62.     GLuint image;
  63.     // internal drawing offset
  64.     float int_x, int_y;
  65.     // starting drawing dimension without modifications like rotation and scaling
  66.     float start_w, start_h;
  67.     // final drawing dimension
  68.     float w, h;
  69.     // texture dimension
  70.     unsigned int tex_w, tex_h;
  71.     // internal rotation
  72.     float base_rotx, base_roty, base_rotz;
  73.     // image collision data
  74.     GL_point col_pos;
  75.     float col_w, col_h;
  76.  
  77.     // origin if created from a file
  78.     string filename;
  79.     // should the image be deleted
  80.     bool auto_del_img;
  81.     // if managed over the image manager
  82.     bool managed;
  83.     // if the image is tagged as obsolete 
  84.     bool obsolete;
  85.  
  86.     // editor tags
  87.     string editor_tags;
  88.     // name
  89.     string name;
  90.     // default sprite type
  91.     unsigned int type;
  92.     // ground type
  93.     GroundType ground_type;
  94. private:
  95.     // function called on destruction
  96.     void ( *destruction_function )( GL_Surface * );
  97. };
  98.  
  99. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  100.  
  101. #endif
  102.