GL Studio C++ Runtime API
ddsfile.h
Go to the documentation of this file.
1 /*! \file
2  \brief DDS file loading functions
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America. Use, distribution,
38 duplication, or disclosure by the U. S. Government is subject to
39 "Restricted Rights" as set forth in DFARS 252.227-7014(c)(1)(ii).
40 
41 */
42 #ifndef INCLUDED_DISTI_DDSFILE_H
43 #define INCLUDED_DISTI_DDSFILE_H
44 
45 #include "gls_gl.h"
46 #include <memory>
47 #include <vector>
48 
49 #ifndef GL_COMPRESSED_RED_RGTC1
50 # define GL_COMPRESSED_RED_RGTC1 0x8DBB
51 # define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
52 # define GL_COMPRESSED_RG_RGTC2 0x8DBD
53 # define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
54 #endif
55 
56 #ifndef GL_COMPRESSED_LUMINANCE_LATC1_EXT
57 # define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
58 # define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
59 # define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
60 # define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
61 #endif
62 
63 namespace disti
64 {
66 {
67  GLsizei _width;
68  GLsizei _height;
69  GLenum _pixelFormat;
70  GLenum _pixelType;
71  GLenum _internalFormat;
72  GLuint _textureID;
73  GLuint _numMipmaps;
74 
75  std::vector<GLubyte> _texels;
76 
78  : _width( 0 )
79  , _height( 0 )
80  , _pixelFormat( 0 )
81  , _pixelType( 0 )
82  , _internalFormat( 0 )
83  , _textureID( 0 )
84  , _numMipmaps( 0 )
85  , _texels()
86  {
87  }
88 };
89 
90 void DDSInitExtensions();
91 
92 // Note: Caller takes ownership of returned data
93 DDSTextureInfo* ReadDDSFile( const char* filename, bool loadTexels );
94 
95 GLuint BindDDSTexture( DDSTextureInfo* texInfo, unsigned int skipLevels = 0 );
96 
97 } // namespace disti
98 
99 #endif // INCLUDED_DISTI_DDSFILE_H
Definition: ddsfile.h:65
Definition: bmpimage.h:46
The gls_gl.