Beatmup
|
Stores linked GLSL programs and their associated fragment shader codes. More...
#include <program_bank.h>
Classes | |
struct | ProgramHolder |
Public Member Functions | |
ProgramBank (Context &context) | |
~ProgramBank () | |
GL::RenderingProgram * | operator() (GraphicPipeline &gpu, const std::string &code, bool enableExternalTextures=false) |
Provides a program given a fragment shader source code. More... | |
void | release (GraphicPipeline &gpu, GL::RenderingProgram *program) |
Marks a program as unused any more. More... | |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Protected Attributes | |
Context & | context |
Private Member Functions | |
bool | releaseProgram (GL::RenderingProgram *program, std::map< std::string, ProgramHolder > &cache) |
Private Attributes | |
std::map< std::string, ProgramHolder > | programs |
map of source code to programs without external texture extension More... | |
std::map< std::string, ProgramHolder > | programsWithExtTex |
map of source code to programs with external texture extension More... | |
Stores linked GLSL programs and their associated fragment shader codes.
Definition at line 31 of file program_bank.h.
|
inline |
Definition at line 46 of file program_bank.h.
GL::ProgramBank::~ProgramBank | ( | ) |
Definition at line 26 of file program_bank.cpp.
|
private |
Definition at line 52 of file program_bank.cpp.
GL::RenderingProgram * GL::ProgramBank::operator() | ( | GraphicPipeline & | gpu, |
const std::string & | code, | ||
bool | enableExternalTextures = false |
||
) |
Provides a program given a fragment shader source code.
Creates a new program or returns an available one increasing its user count (do not call this too often).
[in] | gpu | A graphic pipeline instance |
[in] | code | The fragment shader code of the program |
[in] | enableExternalTextures | If true , external texture extension is enabled in the program, for example, to access camera image in Android |
Definition at line 32 of file program_bank.cpp.
void GL::ProgramBank::release | ( | GraphicPipeline & | gpu, |
GL::RenderingProgram * | program | ||
) |
Marks a program as unused any more.
If the program has no other users, its is destroyed.
[in] | gpu | A graphic pipeline instance |
[in] | program | The program |
Definition at line 68 of file program_bank.cpp.
|
private |
map of source code to programs without external texture extension
Definition at line 38 of file program_bank.h.
|
private |
map of source code to programs with external texture extension
Definition at line 39 of file program_bank.h.
|
protected |
Definition at line 44 of file program_bank.h.