Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 25, 2006, 12:10:07 PM (18 years ago)
Author:
bensch
Message:

Switching to new Shader layout, with Shader and ShaderData. Shaders do not render for the time being

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/shader_data.h

    r9806 r9818  
    99#include "base_object.h"
    1010
    11 #include "shader_types.h"
     11#include "glincl.h"
    1212#include <vector>
    13 
     13#include "count_pointer.h"
    1414
    1515// FORWARD DECLARATION
     
    2121{
    2222  ObjectListDeclaration(ShaderData);
     23  //! The Type of Shader.
     24  typedef enum  {
     25    None       = 0,     //!< No Type at all
     26    Fragment   = 1,     //!< Fragment Shader.
     27    Vertex     = 2,     //!< Vertex Shader.
     28    Program    = 4,     //!< Compiled Shader Programm.
     29  }  Type;
     30
     31 public:
     32  typedef CountPointer<ShaderData> Pointer;
    2333public:
    24   ShaderData(const std::string& vertexShaderFile = "", const std::string& fragmentShaderFile = "");
     34  ShaderData();
    2535  virtual ~ShaderData();
    2636
    27   Shaders::Uniform getUniform(const std::string& location) { return Shader::Uniform(this, location); }
     37  bool load(const std::string& vertexShaderFile = "", const std::string& fragmentShaderFile = "");
     38
    2839
    2940  GLhandleARB getProgram() const { return this->shaderProgram; }
     
    3849  void linkShaderProgram();
    3950  bool readShader(const std::string& fileName, std::string& output);
    40   bool loadShaderProgramm(Shader::Type type, const std::string& fileName);
    41   void deleteProgram(Shader::Type type);
     51  bool loadShaderProgramm(ShaderData::Type type, const std::string& fileName);
     52  void deleteProgram(ShaderData::Type type);
     53
     54  static void printError(GLhandleARB program);
    4255
    4356private:
     57
    4458  std::string            fragmentShaderFile;
    4559  std::string            vertexShaderFile;
Note: See TracChangeset for help on using the changeset viewer.