Fillwave  10.0.0
Texture3D.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 #include <flw/flc/texturing/Texture.h>
24 #include <flw/cmn/TextureConfigs.h>
25 
26 namespace flw {
27 namespace flc {
28 
34 class Texture3D final {
35 private:
36  void sendData(TextureConfig* file, GLubyte* customData = nullptr);
37 
38 public:
39  Texture mTexture;
40 
41  pu<TextureConfig> mRight; /* Positive X*/
42  pu<TextureConfig> mLeft; /* Negative X*/
43  pu<TextureConfig> mCeil; /* Positive Y*/
44  pu<TextureConfig> mFloor; /* Negative Y*/
45  pu<TextureConfig> mFront; /* Positive Z*/
46  pu<TextureConfig> mBack; /* Negative Z*/
47 
48  ParameterList mParameters;
49 
50  Texture3D(
51  TextureConfig* right
52  , TextureConfig* left
53  , TextureConfig* ceil
54  , TextureConfig* floor
55  , TextureConfig* front
56  , TextureConfig* back
57  , ParameterList& param);
58 
59  ~Texture3D() = default;
60 
61  void sendData();
62 
63  void bind(GLuint idx = 0);
64 
65  void bind(GLint textureUnit, GLuint idx = 0);
66 
67  void unbind();
68 
69  void setParameter(GLenum parameter, GLenum value);
70 
71  void setParameters(ParameterList parameters);
72 
73  void log();
74 
75  void reload();
76 
77  static void unbindCubemapTexture(GLint textureUnit);
78 
79  static void unbindCubemapTextures();
80 
81  void sendData(GLubyte* xp, GLubyte* xn, GLubyte* yp, GLubyte* yn, GLubyte* zp, GLubyte* zn);
82 };
83 
84 } /* flc */
85 } /* flw */
Definition: Aliases.h:30
Definition: Texture.h:40
Single GLSL 3D Texture object. It consists of six 2D images.
Definition: Texture3D.h:34
Stores the single texture data.
Definition: TextureConfigs.h:35