Ignore:
Timestamp:
Feb 19, 2011, 10:09:20 PM (11 years ago)
Author:
sam
Message:

Protect the Shader constructor and provide a static creation method that
will let us cache shaders.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/shader.cpp

    r659 r668  
    4545 */
    4646
     47Shader *Shader::Create(char const *vert, char const *frag)
     48{
     49    return new Shader(vert, frag);
     50}
     51
     52void Shader::Destroy(Shader *shader)
     53{
     54    delete shader;
     55}
     56
    4757Shader::Shader(char const *vert, char const *frag)
    4858  : data(new ShaderData())
     
    7787int Shader::GetAttribLocation(char const *attr) const
    7888{
    79     return glGetAttribLocation(data->prog_id, attr);   
     89    return glGetAttribLocation(data->prog_id, attr);
    8090}
    8191
Note: See TracChangeset for help on using the changeset viewer.