TDME2
1.9.121
src
tdme
engine
subsystems
texture2D
Texture2DRenderShader.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
tdme/tdme.h
>
4
#include <
tdme/engine/fwd-tdme.h
>
5
#include <
tdme/engine/subsystems/renderer/fwd-tdme.h
>
6
#include <
tdme/engine/subsystems/texture2D/fwd-tdme.h
>
7
#include <
tdme/math/Vector2.h
>
8
9
using
tdme::engine::subsystems::renderer::Renderer
;
10
11
using
tdme::engine::Engine
;
12
using
tdme::math::Vector2
;
13
14
/**
15
* Texture 2D render shader
16
* @author Andreas Drewke
17
* @version $Id$
18
*/
19
class
tdme::engine::subsystems::texture2D::Texture2DRenderShader
final
20
{
21
22
private
:
23
Renderer
*
renderer
{
nullptr
};
24
int32_t
vertexShaderId
{ -1 };
25
int32_t
fragmentShaderId
{ -1 };
26
int32_t
programId
{ -1 };
27
int32_t
uniformTextureUnit
{ -1 };
28
int32_t
vboVertices
{ -1 };
29
int32_t
vboTextureCoordinates
{-1 };
30
bool
initialized
;
31
bool
isRunning
;
32
33
public
:
34
/**
35
* Public constructor
36
* @param renderer renderer
37
*/
38
Texture2DRenderShader
(
Renderer
*
renderer
);
39
40
/**
41
* Public destructor
42
*/
43
~Texture2DRenderShader
();
44
45
/**
46
* @return if initialized and ready to use
47
*/
48
bool
isInitialized
();
49
50
/**
51
* Initialize
52
*/
53
void
initialize
();
54
55
/**
56
* Use render program
57
*/
58
void
useProgram
();
59
60
/**
61
* Un use render program
62
*/
63
void
unUseProgram
();
64
65
/**
66
* Render texture
67
* @param engine engine to use
68
* @param position 2D position on screen
69
* @param dimension 2D dimenson on screen
70
* @param textureId texture id
71
* @param width optional render target width
72
* @param height optional render target height
73
*/
74
void
renderTexture
(
Engine
* engine,
const
Vector2
& position,
const
Vector2
& dimension,
int
textureId,
int
width = -1,
int
height = -1);
75
76
};
Vector2.h
tdme::engine::Engine
Engine main class.
Definition:
Engine.h:122
tdme::engine::subsystems::renderer::Renderer
Renderer interface.
Definition:
Renderer.h:45
tdme::engine::subsystems::texture2D::Texture2DRenderShader
Texture 2D render shader.
Definition:
Texture2DRenderShader.h:20
tdme::engine::subsystems::texture2D::Texture2DRenderShader::isInitialized
bool isInitialized()
Definition:
Texture2DRenderShader.cpp:34
tdme::engine::subsystems::texture2D::Texture2DRenderShader::vboTextureCoordinates
int32_t vboTextureCoordinates
Definition:
Texture2DRenderShader.h:29
tdme::engine::subsystems::texture2D::Texture2DRenderShader::fragmentShaderId
int32_t fragmentShaderId
Definition:
Texture2DRenderShader.h:25
tdme::engine::subsystems::texture2D::Texture2DRenderShader::uniformTextureUnit
int32_t uniformTextureUnit
Definition:
Texture2DRenderShader.h:27
tdme::engine::subsystems::texture2D::Texture2DRenderShader::initialize
void initialize()
Initialize.
Definition:
Texture2DRenderShader.cpp:39
tdme::engine::subsystems::texture2D::Texture2DRenderShader::programId
int32_t programId
Definition:
Texture2DRenderShader.h:26
tdme::engine::subsystems::texture2D::Texture2DRenderShader::isRunning
bool isRunning
Definition:
Texture2DRenderShader.h:31
tdme::engine::subsystems::texture2D::Texture2DRenderShader::renderTexture
void renderTexture(Engine *engine, const Vector2 &position, const Vector2 &dimension, int textureId, int width=-1, int height=-1)
Render texture.
Definition:
Texture2DRenderShader.cpp:93
tdme::engine::subsystems::texture2D::Texture2DRenderShader::vertexShaderId
int32_t vertexShaderId
Definition:
Texture2DRenderShader.h:24
tdme::engine::subsystems::texture2D::Texture2DRenderShader::vboVertices
int32_t vboVertices
Definition:
Texture2DRenderShader.h:28
tdme::engine::subsystems::texture2D::Texture2DRenderShader::useProgram
void useProgram()
Use render program.
Definition:
Texture2DRenderShader.cpp:79
tdme::engine::subsystems::texture2D::Texture2DRenderShader::~Texture2DRenderShader
~Texture2DRenderShader()
Public destructor.
Definition:
Texture2DRenderShader.cpp:29
tdme::engine::subsystems::texture2D::Texture2DRenderShader::unUseProgram
void unUseProgram()
Un use render program.
Definition:
Texture2DRenderShader.cpp:88
tdme::engine::subsystems::texture2D::Texture2DRenderShader::initialized
bool initialized
Definition:
Texture2DRenderShader.h:30
tdme::engine::subsystems::texture2D::Texture2DRenderShader::renderer
Renderer * renderer
Definition:
Texture2DRenderShader.h:23
tdme::engine::subsystems::texture2D::Texture2DRenderShader::Texture2DRenderShader
Texture2DRenderShader(Renderer *renderer)
Public constructor.
Definition:
Texture2DRenderShader.cpp:22
tdme::math::Vector2
2D vector 2 class
Definition:
Vector2.h:19
fwd-tdme.h
fwd-tdme.h
fwd-tdme.h
tdme.h
Generated by
1.9.3