DI-Guy SDK Documentation  13.2
diguyDx11GraphicsShaderProgram.h
Go to the documentation of this file.
1 #pragma once
2 
3 
5 
7 #include "dx11_headers.h"
8 
9 struct ID3DXEffect;
10 
11 
16 {
17 
18 public:
19 
20  diguyDx11GraphicsShaderProgram(void* internal_data);
22 
23  virtual int load_vertex_shader_source(const char* filename_base);
24  virtual int load_pixel_shader_source(const char* filename_base);
25  virtual int reload();
26  virtual int link();
27 
28  virtual int bind();
29  virtual int unbind();
30 
31  virtual int bind_model_view_matrices(const float* view_matrix, const float* model_matrix);
32  virtual int bind_link_matrices(int num_mats, const float* mat_data);
33  virtual int bind_color_array(int num_colors, const float* color_data);
34  virtual void set_apply_matrices_flag(int apply_matrices_flag);
35 
36  ID3D11InputLayout* m_skinned_vertexDecl;
37  ID3D11InputLayout* m_rigid_vertexDecl;
38 
39 protected:
40 
41  char* load_shader_source(const char* shader_filename);
42  void free_shader_source(char* source_source);
43 
44  ID3DBlob* m_vertex_blob;
45  ID3D11VertexShader * m_vertex_shader;
46  char m_vertex_shader_filename[512];
48 
49  ID3DBlob* m_pixel_blob;
50  ID3D11PixelShader * m_pixel_shader;
51  char m_pixel_shader_filename[512];
53 
54  bool m_linked;
55 
56 };
57 
58 
64 
65 
ID3D11PixelShader * m_pixel_shader
Definition: diguyDx11GraphicsShaderProgram.h:48
virtual void set_apply_matrices_flag(int apply_matrices_flag)
Definition: diguyDx11GraphicsShaderProgram.cpp:606
virtual int bind_link_matrices(int num_mats, const float *mat_data)
This function will be called by DI-Guy when the matrix data of a character's links needs to be sent t...
Definition: diguyDx11GraphicsShaderProgram.cpp:524
bool m_linked
Definition: diguyDx11GraphicsShaderProgram.h:52
ID3D11InputLayout * m_skinned_vertexDecl
Definition: diguyDx11GraphicsShaderProgram.h:34
diguyGraphicsShaderProgram * diguyDx11GraphicsShaderProgram_create_func(void *internal_data)
Create function declaration.
Definition: diguyDx11GraphicsShaderProgram.cpp:625
virtual int bind()
This function will be called by DI-Guy when this program is being bound for rendering.
Definition: diguyDx11GraphicsShaderProgram.cpp:408
bool m_vertex_shader_loaded
Definition: diguyDx11GraphicsShaderProgram.h:45
virtual int bind_color_array(int num_colors, const float *color_data)
This function will be called by DI-Guy when the color data of a character's links needs to be sent to...
Definition: diguyDx11GraphicsShaderProgram.cpp:575
ID3DBlob * m_vertex_blob
Definition: diguyDx11GraphicsShaderProgram.h:42
virtual int bind_model_view_matrices(const float *view_matrix, const float *model_matrix)
Definition: diguyDx11GraphicsShaderProgram.cpp:546
char m_vertex_shader_filename[512]
Definition: diguyDx11GraphicsShaderProgram.h:44
char m_pixel_shader_filename[512]
Definition: diguyDx11GraphicsShaderProgram.h:49
bool m_pixel_shader_loaded
Definition: diguyDx11GraphicsShaderProgram.h:50
ID3D11InputLayout * m_rigid_vertexDecl
Definition: diguyDx11GraphicsShaderProgram.h:35
virtual int load_vertex_shader_source(const char *filename_base)
This function will be called by DI-Guy when it is time for the vertex part of this shader to be loade...
Definition: diguyDx11GraphicsShaderProgram.cpp:209
virtual int reload()
Forces the underlying shader to reload. Returns 0 on success.
Definition: diguyDx11GraphicsShaderProgram.cpp:464
ID3D11VertexShader * m_vertex_shader
Definition: diguyDx11GraphicsShaderProgram.h:43
void free_shader_source(char *source_source)
Definition: diguyDx11GraphicsShaderProgram.cpp:503
virtual int link()
This function will be called by DI-Guy when it is time for the shader program to be linked...
Definition: diguyDx11GraphicsShaderProgram.cpp:376
~diguyDx11GraphicsShaderProgram()
Definition: diguyDx11GraphicsShaderProgram.cpp:98
virtual int unbind()
In general variables that were set in bind() should be unset or unbound here.
Definition: diguyDx11GraphicsShaderProgram.cpp:437
char * load_shader_source(const char *shader_filename)
Definition: diguyDx11GraphicsShaderProgram.cpp:486
Definition: diguyDx11GraphicsShaderProgram.h:13
ID3DBlob * m_pixel_blob
Definition: diguyDx11GraphicsShaderProgram.h:47
diguyDx11GraphicsShaderProgram(void *internal_data)
4 Header files and forward declarations
Definition: diguyDx11GraphicsShaderProgram.cpp:57
This class implements shader programs for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderProgram.h:96
virtual int load_pixel_shader_source(const char *filename_base)
This function is the pixel shader (AKA fragment shader in OpenGL) equivalent of load_vertex_shader_so...
Definition: diguyDx11GraphicsShaderProgram.cpp:313