| GL Studio C++ Runtime API

texture_palette.h
Go to the documentation of this file.
1/*! \file
2 \brief The disti::TexturePalette class.
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.
38
39*/
40#ifndef _TEXTURE_PALETTE_H
41#define _TEXTURE_PALETTE_H
42
43#include "disti_metadata.h"
44#include "dynamic_array.h"
45#include "gls_include.h"
46#include "gls_metadata_attributes.h"
47#include "image.h"
48#include <iostream>
49
50 namespace disti
51{
52 class FilePathClass;
53
54/// Objects with no texture have a palette index of -1.
55/// Valid texture indeces are zero through some positive number (no max).
56 const int NO_TEXTURE = -1;
57
58/// When multiple textures are selected in the Texture Browser.
59/// It is defined here, because it must be different than NO_TEXTURE.
60 const int MULTIPLE_TEXTURES_SELECTED = -2;
61
62/** Current state of texture in the texture palette */
63 typedef enum
64{
65 TEXTURE_UNUSED, /**< The texture slot is unused */
66 TEXTURE_IGNORED, /**< Texture slot does not contain a texture,
67 the user choose to ignore it. It appears UNUSED for most purposes.*/
68 TEXTURE_INVALID, /**< Texture slot contains a texture, but it isn't
69 bound to the GL context */
70 TEXTURE_VALID /**< Texture slot contains a texture, and it is
71 bound to the GL context */
72
73} TextureState_e;
74
75/** Enumeration for an image compresion codec
76 */
77 class DistiAttributeImageCodecEnum : public DistiAttributeEnumDirect<glsImageCodec>
78{
79 public:
80 /// Constructor
81 /// \param callback The function pointer to call when this property changes.
82 /// \param name The name of the property to create.
83 /// \param attribPtr A pointer to the underlying property data.
84 GLS_EXPORT DistiAttributeImageCodecEnum( CallbackMethodCallerBase* callback, const AttributeName& name, glsImageCodec* attribPtr );
85
86 virtual GLS_EXPORT ~DistiAttributeImageCodecEnum();
87
88 GLS_EXPORT std::string Type() const DISTI_METHOD_OVERRIDE;
89};
90
91/** A texture palette entry. Keeps track of which textures are assigned to
92 each entry in the texture palette */
93class TexturePaletteEntry
94{
95 DistiAttribDict _attribDict;
96
97 TextureState_e status; /**< Status of the texture: UNUSED, INVALID, VALID, IGNORED */
98
99 FilePathClass* _filePath; /**< Path to the texture file */
100 char* _returned_filename; /**< Holds a pointer to the buffer returned by Filename() */
101 bool _supportsNPOTValue;
102
103 void SupportsAllowNPOT();
104
105 void InitMetadata();
106
107 public:
108 static GLS_EXPORT bool _defaultGenerateInline; ///< Unused, kept for backward compatibility.
109
110 bool generateInline; ///< True if the image is to be generated as inline code.
111 bool reverseAlpha; ///< True if the alpha channel should be reversed on load.
112 bool isLoadingDeferred; ///< True if loading should be deferred until first draw.
113 Image* texture; ///< Pointer to the texture object itself.
114 long compressedSize; ///< Size of image when compressed with currently set inline CODEC.
115 glsImageCodec codec; ///< CODEC that will be used to compress an inline image.
116 int compressionFactor; ///< Compression factor of the image, used only for JPEG.
117 int desiredLoadWidth; ///< The width that the image should load at. 0 indicates full size. (Editor only)
118 int desiredLoadHeight; ///< The height that the image should load at. 0 indicates full size. (Editor only)
119 int sourceImageWidth; ///< The width of the source image. (pixels) (Editor only)
120 int sourceImageHeight; ///< The height of the source image. (pixels) (Editor only)
121 int sourceImageMemSize; ///< The size of the source image im memory. (bytes) (Editor only)
122 bool useGLTextureCompression; ///< True if the image should be generated to use hardware texture compression. (Editor only)
123
124 bool allowNPOT; ///< Allow Non-power of two texture (do not scale up).
125
126 GLS_EXPORT TexturePaletteEntry();
127
128 /// Copy constructor
129 /// \param source The object to copy from.
130 GLS_EXPORT TexturePaletteEntry( const TexturePaletteEntry& source );
131
132 GLS_EXPORT ~TexturePaletteEntry();
133
134 /// Set up the default member values.
135 GLS_EXPORT void Initialize();
136
137 /// Assignment operator
138 /// \param source Tthe object to copy from.
139 /// \return The resulting object (this).
140 GLS_EXPORT TexturePaletteEntry& operator=( const TexturePaletteEntry& source );
141
142 /// \return The texture load state.
143 GLS_EXPORT TextureState_e TextureStatus() { return status; }
144
145 /// \return The filename relative to the current working directory.
146 GLS_EXPORT const char* Filename() const;
147
148 /// Set the file name relative to the current working directory.
149 /// \param name The new file name to set.
150 GLS_EXPORT void Filename( const char* name );
151
152 /// Sets the texture state to invalid.
153 GLS_EXPORT void Invalidate();
154
155 /// Set the texture state to valid.
156 GLS_EXPORT void Validate();
157
158 /// Sets texture to NULL and status to IGNORED.
159 GLS_EXPORT void Ignore();
160
161 /// \return True if there is no texture object (unused or ignored).
162 GLS_EXPORT bool IsEmpty() const;
163
164 /// \return True if ignored.
165 GLS_EXPORT bool IsIgnored() const;
166
167 /// \return True if invalid or valid (not unused or ignored).
168 GLS_EXPORT bool IsUsed() const;
169
170 /// Writes this object to a stream.
171 /// \param outstr The stream to write to.
172 /// \return The stream in its current state.
173 GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr );
174
175 /// Reads this object from a stream.
176 /// \param instr The stream to read from.
177 /// \return The stream in its current state.
178 GLS_EXPORT std::istream& ReadValue( std::istream& instr );
179};
180
181/** Texture Palette class. Stores a list of textures, each with its own
182 * texture handle. This the textures to be stored separately from the
183 * objects, which allows multiple objects to share the same textures.
184 */
185 class TexturePalette
186{
187 /** A texture of a single magenta pixel used for displaying textures that are not valid */
188 Image* _defaultTexture;
189
190 /** A callback that will get called when a texture in the palette has been update.
191 * \param bool True if it was added/update, false if it was removed
192 * \param int The index in the palette that was modified
193 * \param DisplayFrame The frame the palette belongs to
194 */
195 void ( *_paletteUpdateCallback )( bool, int, DisplayFrame* );
196
197 DisplayFrame* _owningDisplayFrame;
198
199 /** A dynamic array of TexturePaletteEntry */
200 DynamicArray<TexturePaletteEntry> _palette;
201
202 public:
203 /// \return True if the index \a i passed in is a valid texture index. Doesn't imply that a texture exists at that index,
204 /// merely that the index is within the array bounds of the texture palette.
205 /// \param i The index to check.
206 GLS_EXPORT bool IsValidIndex( int i );
207
208 /** Create a new texture palette with the indicated number of entries
209 * \param size The number of entries in the palette
210 */
211 GLS_EXPORT explicit TexturePalette( int size = 0 );
212
213 /** Resize texture palette with the indicated number of entries
214 * \param newSize The new number of entries in the palette
215 */
216 GLS_EXPORT void PaletteSize( int newSize );
217
218 GLS_EXPORT ~TexturePalette();
219
220 /// Assignment operator
221 /// \param source The object to copy from.
222 GLS_EXPORT void operator=( TexturePalette& source );
223
224 /// \return The texture palette entry at index i, expanding the palette to accomodate the index if needed.
225 /// \param i The index of the desired palette entry.
226 GLS_EXPORT TexturePaletteEntry* Entry( int i );
227
228 /// \return The number of textures (whether valid or not) in this texture palette.
229 /// \deprecated Renamed to Count() to match DynamicArray.
230 DISTI_DEPRECATED( "Renamed to Count() to match DynamicArray." )
231 unsigned int size() const { return Count(); }
232
233 /// \return The list of entries for this palette.
234 /// \deprecated Member data has been made private. Use accessor functions like Entry() and Count() instead.
235 DISTI_DEPRECATED( "Member data has been made private. Use accessor functions like Entry() and Count() instead." )
236 DynamicArray<TexturePaletteEntry>& palette;
237
238 /// \return The number of textures (whether valid or not) in this texture palette.
239 GLS_EXPORT unsigned int Count() const;
240
241 /** Invalidates all of the textures in the palette, forcing them to be
242 * rebound the next time they are referenced by an object.
243 */
244 GLS_EXPORT void InvalidateTextures();
245
246 /** Finds an unused slot in the texture palette.
247 * \return The index of the first unused slot in the palette.
248 */
249 GLS_EXPORT int FindAvailableSlot();
250
251 /** Returns the filename associated with the texture at the given index.
252 * \param i The index to get the filename from
253 * \return The filename of the texture at that index
254 */
255 GLS_EXPORT const char* TextureFilename( int i );
256
257 /** Sets the filename associated with the texture at the given index.
258 * \param i The index to get the filename from
259 * \param filename The filename to set
260 */
261 GLS_EXPORT void TextureFilename( int i, const char* filename );
262
263 /// Sets the texture at the given index.
264 /// Attempts to load the texture from disk.
265 /// \param i The texture index to load the texture into.
266 /// \param filename The filename to set.
267 /// \param options Image load options (e.g. reverse alpha).
268 /// \param glTexCompress The GlTextureCompression setting for the new Image.
269 /// \param allowNPOT If the image is allowed to be non-power of two (NPOT).
270 /// \param isLoadingDeferred If true, the image will not be loaded from disk until bound.
271 /// \return TRUE if successful else FALSE.
272 GLS_EXPORT bool SetTexture( int i, const char* filename, const Image::LoadOptions& options = Image::LoadOptions(), bool glTexCompress = false, bool allowNPOT = true, bool isLoadingDeferred = true );
273
274 /// Sets the texture at the given index using a TexturePaletteEntry structure.
275 /// This is generally only used in the Editor.
276 /// \param i The texture index to load the texture into.
277 /// \param entry Image generation options, NULL if not setting them.
278 /// \return TRUE if successful else FALSE.
279 GLS_EXPORT bool SetTexture( int i, TexturePaletteEntry* entry );
280
281 /// Sets the texture at the given index.
282 /// Does NOT attempt to load a file.
283 /// \param i The texture index to load the texture into.
284 /// \param image An image that will be the texture.
285 /// \return TRUE if successful else FALSE.
286 GLS_EXPORT bool SetTexture( int i, Image* image );
287
288 /// Sets the texture at the given index.
289 /// \param i The index to insert at.
290 /// \param image Structure containing the compressed image data.
291 /// \param isLoadingDeferred If true, the image will not be loaded from disk until bound.
292 /// \return true
293 GLS_EXPORT bool SetInlineTexture( int i, glsInlineImage& image, bool isLoadingDeferred = true );
294
295 /** Disables image sharing for the Image at the given index and
296 * ensures that the index refers to a unique Image instance.
297 * Note: If you want to disable image sharing for an Image that is not
298 * yet in a palette, you should call AllowImageSharing(false) on the Image.
299 * \param index The index of the texture to disable image sharing. The Image must already be loaded in the palette.
300 * \returns true on success
301 * \returns false on failure (Invalid index or Image could not be guarenteed unique)
302 */
303 GLS_EXPORT bool DisableImageSharing( int index );
304
305 /** Finds a texture based on its filename
306 * \param name The filename of the texture to find
307 * \return The index if found, -1 if not found
308 */
309 GLS_EXPORT int FindTextureByName( const char* name );
310
311 /** Gets the texture state of the texture at the given index.
312 * \param i The index to get the texture state from
313 * \return The state (UNUSED,VALID,INVALID) of the texture
314 */
315 GLS_EXPORT TextureState_e TextureState( int i );
316
317 /** Returns the width of the texture image in pixels
318 * \param i The index of the texture to get the width of
319 * \return The width of the texture image in pixels
320 */
321 GLS_EXPORT int Width( int i );
322
323 /** Returns the height of the texture image in pixels
324 * \param i The index of the texture to get the height of
325 * \return The height of the texture image in pixels
326 */
327 GLS_EXPORT int Height( int i );
328
329 /** Returns the power of two width of the texture image in pixels
330 * \param i The index of the texture to get the power of two width of
331 * \return The power of two width of the texture image in pixels
332 */
333 GLS_EXPORT int TextureWidth( int i );
334
335 /** Returns the power of two height of the texture image in pixels
336 * \param i The index of the texture to get the power of two height of
337 * \return The power of two height of the texture image in pixels
338 */
339 GLS_EXPORT int TextureHeight( int i );
340
341 /** Returns the Texture Coordinate of the upper right corner of the image
342 * computed as (Width/TextureWidth)
343 * \param i The index of the texture
344 * \return The Texture Coordinate of the upper right corner of the image
345 */
346 GLS_EXPORT float TextureCoordX( int i );
347
348 /** Returns the Texture Coordinate of the upper right corner of the image
349 * computed as (Height/TextureHeight)
350 * \param i The index of the texture
351 * \return The Texture Coordinate of the upper right corner of the image
352 */
353 GLS_EXPORT float TextureCoordY( int i );
354
355 /** Invalidate the texture at the given index, causing it to be rebound
356 * the next time it is referencd
357 * \param i The index of the texture
358 */
359 GLS_EXPORT void InvalidateTexture( int i );
360
361#ifdef GLES
362 /** Bind the texture at the given index, unless it is already bound. Set
363 * as the texture to be used for texturing polygons
364 * \param i The index of the texture
365 * \param stateManager
366 */
367 GLS_EXPORT void BindTexture( int i, IGlsStateManager* stateManager );
368#else
369 /** Bind the texture at the given index, unless it is already bound. Set
370 * as the texture to be used for texturing polygons
371 * \param i The index of the texture
372 */
373 GLS_EXPORT void BindTexture( int i );
374#endif
375
376 /** Return whether or not texture is bound
377 * \param i The index of the texture
378 * \return boolean result of whether or not texture is bound
379 */
380 GLS_EXPORT int TextureValid( int i );
381
382 /** Delete the texture at the given index. Mark the index as unused.
383 * \param i The index of the texture
384 */
385 GLS_EXPORT void DeleteTexture( int i );
386
387 /** Get a pointer to the texture at the given index.
388 * \param i The index of the texture
389 * \return The texture at that index. NULL if there is none.
390 */
391 GLS_EXPORT Image* Texture( int i );
392
393 /** \return True if the image is to be generated as inline code
394 * \param i The index of the texture
395 */
396 GLS_EXPORT bool GenerateInline( int i );
397
398 /** \return True if the image is to be generated to use OpenGL texture compression
399 * \param i The index of the texture
400 */
401 GLS_EXPORT bool UseGLTextureCompression( int i );
402
403 /** \return True if the image is allowed to be non power of two
404 * \param i The index of the texture
405 */
406 GLS_EXPORT bool AllowNPOT( int i );
407
408 /** \return Size of image when compressed with currently set inline CODEC
409 * \param i The index of the texture
410 */
411 GLS_EXPORT long CompressedSize( int i );
412
413 /** \return CODEC that will be used to compress an inline image
414 * \param i The index of the texture
415 */
416 GLS_EXPORT glsImageCodec Codec( int i );
417
418 /** \return Compression factor of the image, used only for JPEG
419 * \param i The index of the texture
420 */
421 GLS_EXPORT int CompressionFactor( int i );
422
423 /** Set True if the image is to be generated as inline code
424 * \param i The index of the texture
425 * \param val
426 */
427 GLS_EXPORT void GenerateInline( int i, bool val );
428
429 /** Set True if the image is to be generated to use OpenGL texture compression
430 * \param i The index of the texture
431 * \param val
432 */
433 GLS_EXPORT void UseGLTextureCompression( int i, bool val );
434
435 /** Set True if the image is allowed to be non power of two
436 * \param i The index of the texture
437 * \param val the value to set allowing non-power of two (NPOT) functionality
438 */
439 GLS_EXPORT void AllowNPOT( int i, bool val );
440
441 /** Set Size of image when compressed with currently set inline CODEC
442 * \param i The index of the texture
443 * \param val
444 */
445 GLS_EXPORT void CompressedSize( int i, long val );
446
447 /** Set CODEC that will be used to compress an inline image
448 * \param i The index of the texture
449 * \param val The codec to set
450 * \param reload Whether or not to reload the image
451 */
452 GLS_EXPORT void Codec( int i, glsImageCodec val, bool reload = true );
453
454 /** Set Compression factor of the image, used only for JPEG
455 * \param i The index of the texture
456 * \param val
457 * \param reload
458 */
459 GLS_EXPORT void CompressionFactor( int i, int val, bool reload = true );
460
461 /** Sets the desired load size for the image.
462 * If the loaded image is larger than the specified dimensions,
463 * it will be scaled down during the load.
464 * \param i The index of the texture
465 * \param width The desired width
466 * \param height The desired height
467 */
468 GLS_EXPORT void DesiredLoadSize( int i, int width, int height );
469
470 /** Reload a texture from disk, then downsize and compress it using the current settings
471 * of the TexturePaletteEntry
472 * \param i The index of the texture to reload
473 */
474 GLS_EXPORT void Reload( int i );
475
476 /** Set mip-mapping state for given texture
477 * \param i The index of the texture to set mipmapping for
478 * \param val The mipmapping state to set
479 */
480 GLS_EXPORT void SetMipMap( int i, bool val );
481
482 /** Compress using the current compression settings for the texture
483 * and scale down to the DesiredLoadSize.
484 * \param i The index of the texture
485 */
486 GLS_EXPORT void PreviewGenerated( int i );
487
488 /** Sets up for a callback to be used for reacting to the texture palette items and filenames to be updated.
489 * \param callback A function accepting whether the texture was added/modified(true) or removed(false), the index of it, and the frame this palette belongs to.
490 * \param owningFrame The display frame that this texture palette belongs to.
491 */
492 GLS_EXPORT void SetTexturePaletteCallback( void ( *callback )( bool, int, DisplayFrame* ), DisplayFrame* owningFrame );
493
494 /// Scales down an image to the next power-of-two size where (width <= desiredWidth || height <= desiredHeight), maintains aspect ratio.
495 /// \note This method may be removed from the TexturePalette in the future.
496 /// \param image The image to scale down.
497 /// \param desiredWidth The target width in pixels.
498 /// \param desiredHeight The target height in pixels.
499 /// \return True if operation is successful.
500 static GLS_EXPORT bool DownsizeImage( Image* image, int desiredWidth, int desiredHeight );
501
502 /** The DistiAttributeTexturePalette class for version 2.1 and older (read only). Included for
503 * backwards compatibility with v 2.1
504 */
505 class DistiAttributeTexturePalette_V21 : public DistiAttributeBase
506 {
507 TexturePalette** _palette;
508
509 public:
510 /// Constructor
511 /// \param palette A pointer to the underlying data.
512 GLS_EXPORT DistiAttributeTexturePalette_V21( TexturePalette** palette );
513
514 // This atttribute is never written
515 virtual bool OkToWrite() const DISTI_METHOD_OVERRIDE { return false; }
516 virtual std::ostream& WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE { return outstr; }
517
518 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE;
519
520 GLS_EXPORT std::string Type() const DISTI_METHOD_OVERRIDE;
521 };
522
523 /** The DistiAttributeTexturePalette class for version 3.0 and later
524 */
525 class DistiAttributeTexturePalette : public DistiAttributeBase
526 {
527 TexturePalette** _palette;
528
529 public:
530 /// Constructor
531 /// \param palette A pointer to the underlying data.
532 GLS_EXPORT DistiAttributeTexturePalette( TexturePalette** palette );
533
534 virtual GLS_EXPORT std::ostream& WriteValue( std::ostream& outstr ) DISTI_METHOD_OVERRIDE;
535 virtual GLS_EXPORT std::istream& ReadValue( std::istream& instr ) DISTI_METHOD_OVERRIDE;
536
537 GLS_EXPORT std::string Type() const DISTI_METHOD_OVERRIDE;
538
539 virtual DISTI_EXPORT DistiAttributeBase& operator=( const DistiAttributeBase& oldClass ) DISTI_METHOD_OVERRIDE;
540 };
541};
542
543} // namespace disti
544
545#endif
disti::AttributeName
Definition: disti_metadata.h:87
disti::CallbackMethodCallerBase
Definition: callback_caller_base.h:56
disti::DisplayFrame
Definition: display_frame.h:87
disti::DistiAttribDict
Definition: disti_metadata.h:750
disti::DistiAttributeBase
Definition: disti_metadata.h:220
disti::DistiAttributeEnumDirect
Definition: gls_metadata_attributes.h:2069
disti::DistiAttributeImageCodecEnum
Definition: texture_palette.h:78
disti::DistiAttributeImageCodecEnum::Type
std::string Type() const override
disti::DistiAttributeImageCodecEnum::DistiAttributeImageCodecEnum
DistiAttributeImageCodecEnum(CallbackMethodCallerBase *callback, const AttributeName &name, glsImageCodec *attribPtr)
disti::DynamicArray
Definition: dynamic_array.h:79
disti::FilePathClass
Definition: file_path_class.h:63
disti::IGlsStateManager
Definition: gls_state_manager_interface.h:69
disti::Image
Definition: image.h:178
disti::TexturePaletteEntry
Definition: texture_palette.h:94
disti::TexturePaletteEntry::compressionFactor
int compressionFactor
Compression factor of the image, used only for JPEG.
Definition: texture_palette.h:116
disti::TexturePaletteEntry::desiredLoadWidth
int desiredLoadWidth
The width that the image should load at. 0 indicates full size. (Editor only)
Definition: texture_palette.h:117
disti::TexturePaletteEntry::reverseAlpha
bool reverseAlpha
True if the alpha channel should be reversed on load.
Definition: texture_palette.h:111
disti::TexturePaletteEntry::compressedSize
long compressedSize
Size of image when compressed with currently set inline CODEC.
Definition: texture_palette.h:114
disti::TexturePaletteEntry::isLoadingDeferred
bool isLoadingDeferred
True if loading should be deferred until first draw.
Definition: texture_palette.h:112
disti::TexturePaletteEntry::Filename
const char * Filename() const
disti::TexturePaletteEntry::TexturePaletteEntry
TexturePaletteEntry(const TexturePaletteEntry &source)
disti::TexturePaletteEntry::desiredLoadHeight
int desiredLoadHeight
The height that the image should load at. 0 indicates full size. (Editor only)
Definition: texture_palette.h:118
disti::TexturePaletteEntry::Filename
void Filename(const char *name)
disti::TexturePaletteEntry::Validate
void Validate()
Set the texture state to valid.
disti::TexturePaletteEntry::_defaultGenerateInline
static bool _defaultGenerateInline
Unused, kept for backward compatibility.
Definition: texture_palette.h:108
disti::TexturePaletteEntry::useGLTextureCompression
bool useGLTextureCompression
True if the image should be generated to use hardware texture compression. (Editor only)
Definition: texture_palette.h:122
disti::TexturePaletteEntry::sourceImageMemSize
int sourceImageMemSize
The size of the source image im memory. (bytes) (Editor only)
Definition: texture_palette.h:121
disti::TexturePaletteEntry::IsEmpty
bool IsEmpty() const
disti::TexturePaletteEntry::sourceImageWidth
int sourceImageWidth
The width of the source image. (pixels) (Editor only)
Definition: texture_palette.h:119
disti::TexturePaletteEntry::Initialize
void Initialize()
Set up the default member values.
disti::TexturePaletteEntry::sourceImageHeight
int sourceImageHeight
The height of the source image. (pixels) (Editor only)
Definition: texture_palette.h:120
disti::TexturePaletteEntry::Invalidate
void Invalidate()
Sets the texture state to invalid.
disti::TexturePaletteEntry::texture
Image * texture
Pointer to the texture object itself.
Definition: texture_palette.h:113
disti::TexturePaletteEntry::IsIgnored
bool IsIgnored() const
disti::TexturePaletteEntry::allowNPOT
bool allowNPOT
Allow Non-power of two texture (do not scale up).
Definition: texture_palette.h:124
disti::TexturePaletteEntry::Ignore
void Ignore()
Sets texture to NULL and status to IGNORED.
disti::TexturePaletteEntry::codec
glsImageCodec codec
CODEC that will be used to compress an inline image.
Definition: texture_palette.h:115
disti::TexturePaletteEntry::ReadValue
std::istream & ReadValue(std::istream &instr)
disti::TexturePaletteEntry::WriteValue
std::ostream & WriteValue(std::ostream &outstr)
disti::TexturePaletteEntry::IsUsed
bool IsUsed() const
disti::TexturePaletteEntry::generateInline
bool generateInline
True if the image is to be generated as inline code.
Definition: texture_palette.h:110
disti::TexturePaletteEntry::TextureStatus
TextureState_e TextureStatus()
Definition: texture_palette.h:143
disti::TexturePaletteEntry::operator=
TexturePaletteEntry & operator=(const TexturePaletteEntry &source)
disti::TexturePalette::DistiAttributeTexturePalette_V21
Definition: texture_palette.h:506
disti::TexturePalette::DistiAttributeTexturePalette_V21::DistiAttributeTexturePalette_V21
DistiAttributeTexturePalette_V21(TexturePalette **palette)
disti::TexturePalette::DistiAttributeTexturePalette_V21::Type
std::string Type() const override
disti::TexturePalette::DistiAttributeTexturePalette_V21::ReadValue
virtual std::istream & ReadValue(std::istream &instr) override
disti::TexturePalette::DistiAttributeTexturePalette_V21::OkToWrite
virtual bool OkToWrite() const override
Definition: texture_palette.h:515
disti::TexturePalette::DistiAttributeTexturePalette_V21::WriteValue
virtual std::ostream & WriteValue(std::ostream &outstr) override
Definition: texture_palette.h:516
disti::TexturePalette::DistiAttributeTexturePalette
Definition: texture_palette.h:526
disti::TexturePalette::DistiAttributeTexturePalette::DistiAttributeTexturePalette
DistiAttributeTexturePalette(TexturePalette **palette)
disti::TexturePalette::DistiAttributeTexturePalette::Type
std::string Type() const override
disti::TexturePalette::DistiAttributeTexturePalette::ReadValue
virtual std::istream & ReadValue(std::istream &instr) override
disti::TexturePalette::DistiAttributeTexturePalette::WriteValue
virtual std::ostream & WriteValue(std::ostream &outstr) override
disti::TexturePalette
Definition: texture_palette.h:186
disti::TexturePalette::AllowNPOT
bool AllowNPOT(int i)
disti::TexturePalette::PaletteSize
void PaletteSize(int newSize)
disti::TexturePalette::SetTexturePaletteCallback
void SetTexturePaletteCallback(void(*callback)(bool, int, DisplayFrame *), DisplayFrame *owningFrame)
disti::TexturePalette::UseGLTextureCompression
void UseGLTextureCompression(int i, bool val)
disti::TexturePalette::DesiredLoadSize
void DesiredLoadSize(int i, int width, int height)
disti::TexturePalette::BindTexture
void BindTexture(int i, IGlsStateManager *stateManager)
disti::TexturePalette::Codec
void Codec(int i, glsImageCodec val, bool reload=true)
disti::TexturePalette::Reload
void Reload(int i)
disti::TexturePalette::DownsizeImage
static bool DownsizeImage(Image *image, int desiredWidth, int desiredHeight)
disti::TexturePalette::Entry
TexturePaletteEntry * Entry(int i)
disti::TexturePalette::operator=
void operator=(TexturePalette &source)
disti::TexturePalette::SetMipMap
void SetMipMap(int i, bool val)
disti::TexturePalette::CompressionFactor
void CompressionFactor(int i, int val, bool reload=true)
disti::TexturePalette::GenerateInline
bool GenerateInline(int i)
disti::TexturePalette::TexturePalette
TexturePalette(int size=0)
disti::TexturePalette::DeleteTexture
void DeleteTexture(int i)
disti::TexturePalette::PreviewGenerated
void PreviewGenerated(int i)
disti::TexturePalette::AllowNPOT
void AllowNPOT(int i, bool val)
disti::TexturePalette::Codec
glsImageCodec Codec(int i)
disti::TexturePalette::TextureValid
int TextureValid(int i)
disti::TexturePalette::CompressedSize
long CompressedSize(int i)
disti::TexturePalette::CompressedSize
void CompressedSize(int i, long val)
disti::TexturePalette::CompressionFactor
int CompressionFactor(int i)
disti::TexturePalette::IsValidIndex
bool IsValidIndex(int i)
disti::TexturePalette::UseGLTextureCompression
bool UseGLTextureCompression(int i)
disti::TexturePalette::GenerateInline
void GenerateInline(int i, bool val)
disti::TexturePalette::Texture
Image * Texture(int i)
disti_metadata.h
The disti metadata.
dynamic_array.h
The disti::DynamicArray class. A templated array of objects capable of dynamically growing.
DISTI_DEPRECATED
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
DISTI_METHOD_OVERRIDE
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
gls_include.h
A file for all GL Studio files to include.
GLS_EXPORT
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
gls_metadata_attributes.h
Defines templated metadata classes for DisplayObjects and other uses.
image.h
The Image class. All textures are converted internally into Images.
disti
Definition: bmpimage.h:47
disti::MULTIPLE_TEXTURES_SELECTED
const int MULTIPLE_TEXTURES_SELECTED
Definition: texture_palette.h:60
disti::glsImageCodec
glsImageCodec
Definition: image.h:64
disti::TextureState_e
TextureState_e
Definition: texture_palette.h:64
disti::TEXTURE_INVALID
@ TEXTURE_INVALID
Definition: texture_palette.h:68
disti::TEXTURE_VALID
@ TEXTURE_VALID
Definition: texture_palette.h:70
disti::TEXTURE_UNUSED
@ TEXTURE_UNUSED
Definition: texture_palette.h:65
disti::TEXTURE_IGNORED
@ TEXTURE_IGNORED
Definition: texture_palette.h:66
disti::NO_TEXTURE
const int NO_TEXTURE
Definition: texture_palette.h:56
disti::glsInlineImage
Definition: image.h:82