textures.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1997-2006 Id Software, Inc.
  4. This file is part of Quake 2 Tools source code.
  5. Quake 2 Tools source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake 2 Tools source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Quake 2 Tools source code; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. typedef struct
  19. {
  20. char name[32];
  21. float shift[2];
  22. float rotate;
  23. float scale[2];
  24. int contents;
  25. int flags;
  26. int value;
  27. } texdef_t;
  28. typedef struct
  29. {
  30. int width, height;
  31. int originy;
  32. texdef_t texdef;
  33. } texturewin_t;
  34. typedef struct qtexture_s
  35. {
  36. struct qtexture_s *next;
  37. char name[64]; // includes partial directory and extension
  38. int width, height;
  39. int contents;
  40. int flags;
  41. int value;
  42. int texture_number; // gl bind number
  43. vec3_t color; // for flat shade mode
  44. qboolean inuse; // true = is present on the level
  45. } qtexture_t;
  46. // a texturename of the form (0 0 0) will
  47. // create a solid color texture
  48. void Texture_Init (void);
  49. void Texture_Flush (void);
  50. void Texture_ClearInuse (void);
  51. void Texture_ShowInuse (void);
  52. void Texture_ShowDirectory (int menunum);
  53. qtexture_t *Texture_ForName (char *name);
  54. void Texture_Init (void);
  55. void Texture_SetTexture (texdef_t *texdef);
  56. void Texture_SetMode(int iMenu); // GL_TEXTURE_NEAREST, etc..