Changeset 32240 in vbox for trunk/src/VBox/GuestHost/OpenGL/util
- Timestamp:
- Sep 5, 2010 2:59:54 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 65564
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/util/pixel.c
r27398 r32240 9 9 #include "cr_mem.h" 10 10 #include "cr_version.h" 11 #include <stdio.h> 11 12 #include <math.h> 12 13 … … 1776 1777 } 1777 1778 } 1779 1780 static int _tnum = 0; 1781 #pragma pack(1) 1782 typedef struct tgaheader_tag 1783 { 1784 char idlen; 1785 1786 char colormap; 1787 1788 char imagetype; 1789 1790 short cm_index; 1791 short cm_len; 1792 char cm_entrysize; 1793 1794 short x, y, w, h; 1795 char depth; 1796 char imagedesc; 1797 1798 } tgaheader_t; 1799 #pragma pack() 1800 1801 void crDumpTGA(GLint w, GLint h, GLvoid *data) 1802 { 1803 char fname[200]; 1804 tgaheader_t header; 1805 FILE *out; 1806 1807 if (!w || !h) return; 1808 1809 sprintf(fname, "tex%i.tga", _tnum++); 1810 out = fopen(fname, "w"); 1811 if (!out) crError("can't create %s!", fname); 1812 1813 header.idlen = 0; 1814 header.colormap = 0; 1815 header.imagetype = 2; 1816 header.cm_index = 0; 1817 header.cm_len = 0; 1818 header.cm_entrysize = 0; 1819 header.x = 0; 1820 header.y = 0; 1821 header.w = w; 1822 header.h = h; 1823 header.depth = 32; 1824 header.imagedesc = 0x08; 1825 fwrite(&header, sizeof(header), 1, out); 1826 1827 fwrite(data, w*h*4, 1, out); 1828 1829 fclose(out); 1830 }
Note:
See TracChangeset
for help on using the changeset viewer.