00001 // OMICRON ENGINE HEADER FILE 00002 // 00003 // -------------------------------------------------------------------------- 00004 // Copyright (C) 2001-2002 by Bjoern Paetzel <kolrabi@gmx.de> 00005 // 00006 // This file is part of the Omicron Engine. 00007 // 00008 // The Omicron Engine is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by the 00010 // Free Software Foundation; either version 2 of the License, or (at your 00011 // option) any later version. 00012 // 00013 // The Omicron Engine is distributed in the hope that it will be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00015 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 // for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License along 00019 // with The Omicron Engine; if not, write to the Free Software Foundation, 00020 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00021 // 00022 // -------------------------------------------------------------------------- 00023 // Last modified: $Date: 2002/12/07 19:02:17 $ 00024 // By : $Author: kolrabi $ 00025 // $Id: texture.h,v 1.1.1.1 2002/12/07 19:02:17 kolrabi Exp $ 00026 00027 /* 00028 00029 $Log: texture.h,v $ 00030 Revision 1.1.1.1 2002/12/07 19:02:17 kolrabi 00031 initial release 00032 00033 00034 */ 00035 00043 /**************************************************************************** 00044 **************************************************************************** 00045 * DEFINES ****************************************************************** 00046 **************************************************************************** 00047 ****************************************************************************/ 00048 00049 /* TEXTURE CONSTANTS ********************************************************/ 00050 00051 #define TF_NEAREST 0 00052 #define TF_LINEAR 1 00053 #define TF_NEAREST_MIPMAP_NEAREST 2 00054 #define TF_LINEAR_MIPMAP_NEAREST 3 00055 #define TF_NEAREST_MIPMAP_LINEAR 4 00056 #define TF_LINEAR_MIPMAP_LINEAR 5 00057 00058 #define TW_REPEAT 0 00059 #define TW_CLAMP 1 00060 00061 #define TEXTURE_NOTFOUND 0 00062 00063 /**************************************************************************** 00064 **************************************************************************** 00065 * TEXTURE MANAGER ********************************************************** 00066 **************************************************************************** 00067 ****************************************************************************/ 00068 00069 #ifndef OMICRONTYPES_TEXTURE_DEFINED 00070 #define OMICRONTYPES_TEXTURE_DEFINED 00071 00077 typedef struct texture_s 00078 { 00079 ulong texture; 00080 00081 char name[64]; 00082 char file[MAX_PATH+1]; 00083 00084 sshort width, height; 00085 } texture_t; 00086 00088 class texture_manager_c 00089 { 00090 protected: 00091 00092 array_c <texture_t> * 00093 textures; 00094 00095 public: 00096 00097 texture_manager_c(); 00098 ~texture_manager_c(); 00099 00100 sshort 00101 find(const char *name); 00102 00103 sshort 00104 load(const char *name, bool nocompression = false); 00105 00106 sshort 00107 create(ushort width, ushort height, const char *name); 00108 00109 void 00110 freeall(); 00111 00112 void 00113 freetex(sshort num); 00114 00115 void 00116 set_bits(sshort num, const char *bits, bool mipmaps = true, bool nocompression = false); 00117 00118 void 00119 set_bits24(sshort num, const char *bits, bool mipmaps = true, bool nocompression = false); 00120 00121 class image_c * 00122 get_image(sshort num); 00123 00124 void 00125 set_image(sshort num, const class image_c *img, bool mipmaps = false, bool nocompression = false); 00126 00127 void 00128 set(sshort num, sshort stage=0); 00129 00130 ushort 00131 get_width(sshort num); 00132 00133 ushort 00134 get_height(sshort num); 00135 00136 ulong 00137 get_gltexture(sshort num); 00138 }; 00139 00140 #endif
1.2.18