Main Page
Namespaces
Classes
Files
File List
File Members
include
Graphics
GL4
GteGL4TextureSingle.h
Go to the documentation of this file.
1
// David Eberly, Geometric Tools, Redmond WA 98052
2
// Copyright (c) 1998-2017
3
// Distributed under the Boost Software License, Version 1.0.
4
// http://www.boost.org/LICENSE_1_0.txt
5
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6
// File Version: 3.0.0 (2016/06/19)
7
8
#pragma once
9
10
#include <
Graphics/GteTextureSingle.h
>
11
#include <
Graphics/GL4/GteGL4Texture.h
>
12
#include <
LowLevel/GteLogger.h
>
13
14
namespace
gte
15
{
16
17
class
GTE_IMPEXP
GL4TextureSingle
:
public
GL4Texture
18
{
19
public
:
20
// Abstract base class, a shim to distinguish between single textures and
21
// texture arrays.
22
virtual
~
GL4TextureSingle
();
23
24
// Member access.
25
inline
TextureSingle
* GetTexture()
const
;
26
27
virtual
bool
Update()
override
;
28
virtual
bool
CopyCpuToGpu()
override
;
29
virtual
bool
CopyGpuToCpu()
override
;
30
31
bool
Update(
unsigned
int
level
);
32
bool
CopyCpuToGpu(
unsigned
int
level);
33
bool
CopyGpuToCpu(
unsigned
int
level);
34
void
CopyGpuToGpu
(
GL4TextureSingle
*
texture
,
unsigned
int
level)
35
{
36
(
void
)texture;
37
(
void
)level;
38
LogError
(
"Not yet implemented."
);
39
}
40
41
// Returns true if mipmaps need to be generated.
42
virtual
bool
CanAutoGenerateMipmaps()
const
= 0;
43
44
// Generates mipmaps from level 0 -- only if CanAutoGenerateMipmaps() returns true.
45
virtual
bool
GenerateMipmaps();
46
47
protected
:
48
// No public construction. Derived classes use this constructor.
49
GL4TextureSingle
(
TextureSingle
const
* gtTexture,
GLenum
target
,
GLenum
targetBinding);
50
51
// Only call from derived class constructor after texture storage has been allocated.
52
void
Initialize();
53
54
// Called by Update and CopyCpuToGpu.
55
bool
DoCopyCpuToGpu(
unsigned
int
level);
56
57
// Should be called in constructor when CopyType is any value bu COPY_NONE.
58
void
CreateStaging();
59
60
// This is called to copy the data from the CPU buffer to the GPU
61
// for the specified level. If a pixel unpack buffer is being used
62
// then data needs to be passed as 0 which is used as an offset.
63
virtual
void
LoadTextureLevel(
unsigned
int
level,
void
const
*
data
) = 0;
64
65
private
:
66
// Data associated with each mip level
67
GLuint
mLevelPixelUnpackBuffer[
Texture::MAX_MIPMAP_LEVELS
];
68
GLuint
mLevelPixelPackBuffer[
Texture::MAX_MIPMAP_LEVELS
];
69
};
70
71
inline
TextureSingle
*
GL4TextureSingle::GetTexture
()
const
72
{
73
return
static_cast<
TextureSingle
*
>
(mGTObject);
74
}
75
76
}
gte::GL4TextureSingle
Definition:
GteGL4TextureSingle.h:17
GteLogger.h
GLuint
unsigned int GLuint
Definition:
glcorearb.h:89
void
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
level
GLint level
Definition:
glcorearb.h:103
gte::GL4TextureSingle::CopyGpuToGpu
void CopyGpuToGpu(GL4TextureSingle *texture, unsigned int level)
Definition:
GteGL4TextureSingle.h:34
target
GLenum target
Definition:
glcorearb.h:1662
GteTextureSingle.h
GLenum
unsigned int GLenum
Definition:
glcorearb.h:83
LogError
#define LogError(message)
Definition:
GteLogger.h:92
gte
Definition:
GLX/GteWICFileIO.h:16
data
GLboolean * data
Definition:
glcorearb.h:126
gte::Texture::MAX_MIPMAP_LEVELS
Definition:
GteTexture.h:46
texture
GLuint texture
Definition:
glcorearb.h:410
gte::GL4TextureSingle::GetTexture
TextureSingle * GetTexture() const
Definition:
GteGL4TextureSingle.h:71
gte::TextureSingle
Definition:
GteTextureSingle.h:15
gte::GL4Texture
Definition:
GteGL4Texture.h:16
GteGL4Texture.h
GTE_IMPEXP
#define GTE_IMPEXP
Definition:
GTEngineDEF.h:63
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:00