Download
Documentation
Development
Examples
Donations
Contributions
Forum
Sources
API
Display
Render
texture_cube.h
1
/*
2
** ClanLib SDK
3
** Copyright (c) 1997-2013 The ClanLib 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 ClanLib 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
31
#pragma once
32
33
#include "../api_display.h"
34
#include "texture.h"
35
36
namespace
clan
37
{
40
42
enum
TextureCubeDirection
43
{
44
cl_cube_positive_x
,
45
cl_cube_negative_x
,
46
cl_cube_positive_y
,
47
cl_cube_negative_y
,
48
cl_cube_positive_z
,
49
cl_cube_negative_z
50
};
51
53
class
CL_API_DISPLAY
TextureCube
:
public
Texture
54
{
57
public
:
59
TextureCube
();
60
64
TextureCube
(
const
std::shared_ptr<Texture_Impl> &impl) :
Texture
(impl) { }
65
73
TextureCube
(
GraphicContext
&context,
int
width,
int
height,
TextureFormat
texture_format =
tf_rgba8
,
int
levels = 1);
74
81
TextureCube
(
GraphicContext
&context,
const
Size
&size,
TextureFormat
texture_format =
tf_rgba8
,
int
levels = 1);
83
86
public
:
88
int
get_width()
const
;
89
91
int
get_height()
const
;
92
94
Size
get_size()
const
;
96
99
public
:
105
void
set_image(
106
GraphicContext
&context,
107
TextureCubeDirection
cube_direction,
108
PixelBuffer
&image,
109
int
level = 0);
110
116
void
set_subimage(
117
GraphicContext
&context,
118
TextureCubeDirection
cube_direction,
119
int
x,
120
int
y,
121
const
PixelBuffer
&image,
122
const
Rect
&src_rect,
123
int
level = 0);
124
125
void
set_subimage(
126
GraphicContext
&context,
127
TextureCubeDirection
cube_direction,
128
const
Point
&point,
129
const
PixelBuffer
&image,
130
const
Rect
&src_rect,
131
int
level = 0);
133
};
134
135
}
136
clan::Texture
Texture object class.
Definition:
texture.h:104
clan::PixelBuffer
Pixel data container.
Definition:
pixel_buffer.h:69
clan::cl_cube_negative_x
Definition:
texture_cube.h:45
clan::cl_cube_negative_z
Definition:
texture_cube.h:49
clan::cl_cube_positive_y
Definition:
texture_cube.h:46
clan::TextureCubeDirection
TextureCubeDirection
Texture cube directions.
Definition:
texture_cube.h:42
clan::cl_cube_positive_z
Definition:
texture_cube.h:48
clan::TextureCube
2D texture cube object class.
Definition:
texture_cube.h:53
clan::Rect
2D (left,top,right,bottom) rectangle structure - Integer
Definition:
rect.h:453
clan::cl_cube_positive_x
Definition:
texture_cube.h:44
clan::TextureCube::TextureCube
TextureCube(const std::shared_ptr< Texture_Impl > &impl)
Constructs a texture from an implementation.
Definition:
texture_cube.h:64
clan::TextureFormat
TextureFormat
Texture format.
Definition:
texture_format.h:41
clan::GraphicContext
Interface to drawing graphics.
Definition:
graphic_context.h:257
clan::Point
2D (x,y) point structure - Integer
Definition:
point.h:63
clan::Size
2D (width,height) size structure - Integer
Definition:
size.h:157
clan::cl_cube_negative_y
Definition:
texture_cube.h:47
clan::tf_rgba8
Definition:
texture_format.h:44