DI-Guy C++ SDK Reference
13.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
diguyOglGraphicsShaderProgram.h
Go to the documentation of this file.
1
#ifndef __diguyOglGraphicsShaderProgram_H
2
#define __diguyOglGraphicsShaderProgram_H
3
4
5
6
#include "ogl_headers.h"
7
8
class
diguyGraphicsLink
;
9
10
#include <
diguyGraphicsShaderProgram.h
>
11
#include <hash_map>
12
13
14
/*********************************************************************
15
**
16
*2 diguyOglGraphicsShaderProgram
17
**
18
** This class is part of the DI-Guy Graphics API. It overrides the class
19
** diguyGraphicsShaderProgram. Detailed documentation is in the
20
** implementation file documentation
21
** <a href="diguyOglGraphicsShaderProgram.cpp.html">here</a>.
22
*/
23
24
class
diguyOglGraphicsShaderProgram
:
public
diguyGraphicsShaderProgram
25
{
26
27
public
:
28
29
diguyOglGraphicsShaderProgram
(
void
* internal_data);
30
~diguyOglGraphicsShaderProgram
();
31
32
virtual
int
load_vertex_shader_source
(
const
char
* filename_base);
33
virtual
int
load_pixel_shader_source
(
const
char
* filename_base);
34
virtual
int
reload
();
35
virtual
int
link
();
36
37
virtual
int
bind
();
38
virtual
int
unbind
();
39
40
GLhandleARB
get_gl_program_object
() {
return
m_gl_program_object
;}
41
42
GLhandleARB
m_gl_program_object
;
43
44
/*
45
* Though looked up here, these bind locations are used in
46
* diguyOglGraphicsMesh.cpp.
47
*/
48
int
m_bind_location_attr_weight_array
;
49
int
m_bind_location_attr_index_array
;
50
int
m_bind_location_attr_tangent
;
51
52
int
m_bind_location_ufrm_apply_matrices_flag
;
53
int
m_bind_location_ufrm_link_matrix
;
54
int
m_bind_location_ufrm_inverse_transform_matrix
;
55
int
m_bind_location_ufrm_link_matrices
;
56
int
m_bind_location_ufrm_link_colors
;
57
58
int
m_bind_location_ufrm_link_matrices_tbo
;
59
int
m_bind_location_ufrm_link_matrices_start
;
60
int
m_bind_location_ufrm_link_matrices_count
;
61
62
int
m_bind_location_ufrm_light_dir_os
;
63
int
m_bind_location_ufrm_eye_point_os
;
64
65
int
m_bind_location_ufrm_textures_enabled
;
66
67
int
m_bind_location_ufrm_bump_map_enabled
;
68
int
m_bind_location_ufrm_specular_map_enabled
;
69
int
m_bind_location_ufrm_component_map_enabled
;
70
71
int
m_bind_location_ufrm_misc_1_map_enabled
;
72
int
m_bind_location_ufrm_misc_2_map_enabled
;
73
74
int
m_bind_location_ufrm_light_array
;
75
int
m_include_point_lights
;
76
77
/*
78
* Uniform for controlling whether links matrices are applied to
79
* vertices in the vertex shader. Set from the mesh draw() function.
80
*/
81
virtual
void
set_apply_matrices_flag
(
int
apply_matrices_flag);
82
83
/*
84
* Called by diguy internal code to send data to the shaders.
85
*/
86
virtual
int
bind_color_array
(
int
num_colors,
87
const
float
* color_data);
88
virtual
int
bind_link_matrices
(
int
num_mats,
89
const
float
* mat_data);
90
91
virtual
int
bind_uniform_with_location
(
int
location,
92
const
char
* name,
93
int
value_size,
94
float
* values);
95
virtual
int
bind_uniform_with_location
(
int
location,
96
const
char
* name,
97
int
value_size,
98
int
* values);
99
100
/*
101
* Called by diguy internal find out what capabilities the shader has.
102
*/
103
virtual
int
get_attrib_bind_location
(
const
char
* name);
104
virtual
int
get_uniform_bind_location
(
const
char
* name);
105
106
/*
107
* These are render state variables whose values are set by DI-Guy.
108
* They should not be set in bind(), but in the appropriate
109
* diguyOglGraphicsShaderInstance virtual functions.
110
*/
111
112
protected
:
113
114
int
load_and_compile_shader
(GLhandleARB shader_object,
115
const
char
* shader_filename,
116
bool
& shader_loaded);
117
118
char
*
load_shader_source
(
const
char
* shader_filename);
119
void
free_shader_source
(
char
* source_source);
120
void
update_light_uniforms
();
121
122
char
m_vertex_shader_filename
[512];
123
bool
m_vertex_shader_loaded
;
124
GLhandleARB
m_gl_vertex_shader_object
;
125
126
char
m_pixel_shader_filename
[512];
127
bool
m_pixel_shader_loaded
;
128
GLhandleARB
m_gl_pixel_shader_object
;
129
130
bool
m_linked
;
131
float
m_last_light_update_time
;
132
const
float
*
m_last_matrix_data
;
133
134
};
135
136
141
diguyGraphicsShaderProgram
*
diguyOglGraphicsShaderProgram_create_func
(
void
* internal_data);
142
143
144
#endif
diguy
programming_examples
diguy_graphics_api
ogl_examples
common
diguyOglGraphicsShaderProgram.h
Generated on Wed Jul 9 2014 21:35:57 for DI-Guy C++ SDK Reference by
1.8.3.1