GuiModel.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. typedef struct {
  21. const idMaterial *material;
  22. float color[4];
  23. int firstVert;
  24. int numVerts;
  25. int firstIndex;
  26. int numIndexes;
  27. } guiModelSurface_t;
  28. class idGuiModel {
  29. public:
  30. idGuiModel();
  31. void Clear();
  32. void WriteToDemo( idDemoFile *demo );
  33. void ReadFromDemo( idDemoFile *demo );
  34. void EmitToCurrentView( float modelMatrix[16], bool depthHack );
  35. void EmitFullScreen();
  36. // these calls are forwarded from the renderer
  37. void SetColor( float r, float g, float b, float a );
  38. void DrawStretchPic( const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *hShader,
  39. bool clip = true, float min_x = 0.0f, float min_y = 0.0f, float max_x = 640.0f, float max_y = 480.0f );
  40. void DrawStretchPic( float x, float y, float w, float h,
  41. float s1, float t1, float s2, float t2, const idMaterial *hShader);
  42. void DrawStretchTri ( idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material );
  43. //---------------------------
  44. private:
  45. void AdvanceSurf();
  46. void EmitSurface( guiModelSurface_t *surf, float modelMatrix[16], float modelViewMatrix[16], bool depthHack );
  47. guiModelSurface_t *surf;
  48. idList<guiModelSurface_t> surfaces;
  49. idList<glIndex_t> indexes;
  50. idList<idDrawVert> verts;
  51. };