Fillwave  10.0.0
TextureConfigs.h
1 #pragma once
2 
3 /*
4  * The MIT License (MIT)
5  *
6  * Copyright (c) 2018 Filip Wasil and Fillwave community members
7  *
8  * Permission is hereby granted, free of charge, to any person
9  * obtaining a copy of this software and associated documentation files (the "Software"),
10  * to deal in the Software without restriction, including without limitation the rights
11  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
12  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included
15  * in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
24 #include <flw/flf/loaders/textureloader/TextureContent.h>
25 #include <flw/OpenGL.h>
26 #include <flw/cmn/Containers.h>
27 #include <flw/cmn/Aliases.h>
28 
29 namespace flw {
30 namespace flc {
31 
35 struct TextureConfig final {
39  struct Header {
40  Header(
41  GLint internalFormat = GL_RGBA
42  , GLint format = GL_RGBA
43  , GLint type = GL_UNSIGNED_BYTE
44  , GLsizei width = 0
45  , GLsizei height = 0);
46  GLenum mInternalFormat;
47  GLsizei mHeight;
48  GLsizei mWidth;
49  GLenum mType;
50  GLenum mFormat;
51  GLenum mCubeTarget;
52  };
53 
54  struct Mipmap {
55  Mipmap();
56  Mipmap(unsigned int size, unsigned int height, unsigned int width, unsigned int format, GLubyte* data);
57  unsigned int mSize;
58  unsigned int mHeight;
59  unsigned int mWidth;
60  unsigned int mFormat;
61  pn<GLubyte> mData;
62  };
66  struct Content {
67  Content(
68  GLint level = 0
69  , GLint border = 0
70  , GLboolean mipmaps = GL_FALSE
71  , GLboolean compression = GL_FALSE);
72  GLint mMipmapsLevel;
73  GLboolean mMipmaps;
74  GLboolean mCompression;
75  GLint mBorder;
76  GLsizei mCompressionSize;
77  };
78 
79  TextureConfig();
80 
81  ~TextureConfig();
82 
83  Header mHeader;
84  Content mContent;
85  EMemoryAllocation mAllocation;
86  pn<GLubyte> mData;
87  vecStack<Mipmap> mMipmaps;
88 };
89 
90 } /* flc */
91 } /* flw */
Definition: Aliases.h:30
Stores the single file header info.
Definition: TextureConfigs.h:39
Stores the single file info.
Definition: TextureConfigs.h:66
Definition: TextureConfigs.h:54
Stores the single texture data.
Definition: TextureConfigs.h:35