texture_cube_array.h
1 /*
2 ** UICore
3 ** Copyright (c) 1997-2015 The UICore Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries UICore may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 ** Harry Storbacka
28 */
29 
30 #pragma once
31 
32 #include "texture_cube.h"
33 
34 namespace uicore
35 {
37  class TextureCubeArray : public virtual Texture
38  {
39  public:
43  static std::shared_ptr<TextureCubeArray> create(const GraphicContextPtr &context, int width, int height, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1);
44  static std::shared_ptr<TextureCubeArray> create(const GraphicContextPtr &context, const Size &size, int array_size, TextureFormat texture_format = tf_rgba8, int levels = 1);
45 
47  virtual int width() const = 0;
48 
50  virtual int height() const = 0;
51 
53  Size size() const { return Size(width(), height()); }
54 
56  virtual int array_size() const = 0;
57 
64  virtual void set_image(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, const PixelBufferPtr &image, int level = 0) = 0;
65 
72  virtual void set_subimage(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, int x, int y, const PixelBufferPtr &image, const Rect &src_rect, int level = 0) = 0;
73  virtual void set_subimage(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, const Point &point, const PixelBufferPtr &image, const Rect &src_rect, int level = 0)
74  {
75  set_subimage(context, array_index, cube_direction, point.x, point.y, image, src_rect, level);
76  }
77  };
78 }
Texture object class.
Definition: texture.h:94
2D (width,height) size structure - Integer
Definition: size.h:167
2D texture cube array object class.
Definition: texture_cube_array.h:37
Size size() const
Get the texture size.
Definition: texture_cube_array.h:53
Type x
Definition: vec2.h:75
virtual void set_image(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, const PixelBufferPtr &image, int level=0)=0
Upload image to texture.
TextureFormat
Texture format.
Definition: texture_format.h:35
virtual void set_subimage(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, int x, int y, const PixelBufferPtr &image, const Rect &src_rect, int level=0)=0
Upload image to sub texture.
Definition: texture_format.h:38
2D (x,y) point structure - Integer
Definition: point.h:58
Type y
Definition: vec2.h:76
virtual int array_size() const =0
Get the texture array size.
virtual void set_subimage(const GraphicContextPtr &context, int array_index, TextureCubeDirection cube_direction, const Point &point, const PixelBufferPtr &image, const Rect &src_rect, int level=0)
Definition: texture_cube_array.h:73
virtual int height() const =0
Get the texture height.
virtual int width() const =0
Get the texture width.
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:491
TextureCubeDirection
Texture cube directions.
Definition: texture_cube.h:37
std::shared_ptr< PixelBuffer > PixelBufferPtr
Definition: d3d_target.h:39
std::shared_ptr< GraphicContext > GraphicContextPtr
Definition: d3d_target.h:49
static std::shared_ptr< TextureCubeArray > create(const GraphicContextPtr &context, int width, int height, int array_size, TextureFormat texture_format=tf_rgba8, int levels=1)
Constructs a Texture.
Definition: Application/application.h:35