Changeset 9806 in orxonox.OLD for branches/new_class_id/src/lib
- Timestamp:
- Sep 24, 2006, 10:30:13 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib
- Files:
-
- 1 added
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/Makefile.am
r9761 r9806 26 26 light.h \ 27 27 shader.h \ 28 shader_data.h \ 28 29 \ 29 30 render2D/render_2d.h \ -
branches/new_class_id/src/lib/graphics/importer/static_model.h
r9715 r9806 10 10 11 11 #include "material.h" 12 #include "glincl.h"13 12 #include <vector> 14 #include <list>15 13 16 14 // definition of different modes for setting up Faces -
branches/new_class_id/src/lib/graphics/shader.cc
r9715 r9806 35 35 ObjectListDefinition(Shader); 36 36 37 void Shader::Uniform::setV(unsigned int count, float* vv) const 38 { 39 switch (count) 40 { 41 case 1: 42 glUniform1fv(this->uniform, 1, vv); 43 break; 44 case 2: 45 glUniform2fv(this->uniform, 2, vv); 46 break; 47 case 3: 48 glUniform3fv(this->uniform, 3, vv); 49 break; 50 case 4: 51 glUniform4fv(this->uniform, 4, vv); 52 break; 53 } 54 } 55 void Shader::Uniform::setV(unsigned int count, int* vv) const 56 { 57 switch (count) 58 { 59 case 1: 60 glUniform1iv(this->uniform, 1, vv); 61 break; 62 case 2: 63 glUniform2iv(this->uniform, 2, vv); 64 break; 65 case 3: 66 glUniform3iv(this->uniform, 3, vv); 67 break; 68 case 4: 69 glUniform4iv(this->uniform, 4, vv); 70 break; 71 } 72 } 73 74 75 76 77 37 78 /** 38 79 * standard constructor … … 41 82 { 42 83 this->registerObject(this, Shader::_objectList); 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 84 this->shaderProgram = 0; 85 this->vertexShader = 0; 86 this->fragmentShader = 0; 87 88 if (GLEW_ARB_shader_objects && GLEW_ARB_shading_language_100) 89 { 90 this->shaderProgram = glCreateProgramObjectARB(); 91 92 if (!vertexShaderFile.empty()) 93 this->loadShaderProgramm(Shader::Vertex, vertexShaderFile); 94 if (!fragmentShaderFile.empty()) 95 this->loadShaderProgramm(Shader::Fragment, fragmentShaderFile); 96 97 this->linkShaderProgram(); 98 99 } 100 else 101 { 102 PRINTF(2)("Shaders are not supported on your hardware\n"); 103 } 63 104 } 64 105 … … 91 132 //glLinkProgramARB(this->shaderProgram); 92 133 glDeleteObjectARB(this->shaderProgram); 93 134 // link error checking 94 135 glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_DELETE_STATUS_ARB, &status); 95 136 if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION) 96 137 this->printError(this->shaderProgram); 97 138 } 98 }99 100 Shader* Shader::getShader(const std::string& vertexShaderFile, const std::string& fragmentShaderFile)101 {102 return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER, RP_LEVEL, fragmentShaderFile);103 }104 105 bool Shader::unload(Shader* shader)106 {107 return ResourceManager::getInstance()->unload(shader);108 139 } 109 140 … … 161 192 162 193 glLinkProgramARB(this->shaderProgram); 163 194 // link error checking 164 195 glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &status); 165 196 if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION) … … 203 234 void Shader::bindShader(const char* name, const float* value, size_t size) 204 235 { 205 if (likely (this->shaderProgram != 0)) { 206 glUseProgramObjectARB(this->shaderProgram); 207 208 unsigned int location = glGetUniformLocationARB(this->shaderProgram, name); 209 /* This is EXPENSIVE and should be avoided. */ 210 211 if (size == 1) glUniform1fvARB(location, 1, value); 212 else if (size == 2) glUniform2fvARB(location, 1, value); 213 else if (size == 3) glUniform3fvARB(location, 1, value); 214 else if (size == 4) glUniform4fvARB(location, 1, value); 215 else if (size == 9) glUniformMatrix3fvARB(location, 1, false, value); 216 else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value); 217 218 } 236 if (likely (this->shaderProgram != 0)) 237 { 238 glUseProgramObjectARB(this->shaderProgram); 239 240 unsigned int location = glGetUniformLocationARB(this->shaderProgram, name); 241 /* This is EXPENSIVE and should be avoided. */ 242 243 if (size == 1) glUniform1fvARB(location, 1, value); 244 else if (size == 2) glUniform2fvARB(location, 1, value); 245 else if (size == 3) glUniform3fvARB(location, 1, value); 246 else if (size == 4) glUniform4fvARB(location, 1, value); 247 else if (size == 9) glUniformMatrix3fvARB(location, 1, false, value); 248 else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value); 249 250 } 219 251 } 220 252 221 253 void Shader::deactivateShader() 222 254 { 223 if (storedShader != NULL)224 glUseProgramObjectARB(0);225 Shader::storedShader = NULL;255 if (storedShader != NULL) 256 glUseProgramObjectARB(0); 257 Shader::storedShader = NULL; 226 258 } 227 259 … … 292 324 if (this->vertexShader != 0) 293 325 { 294 /* PRINT(3)("VertexShaderProgramm: number=%d, file='%s'\n", this->vertexShader, this->vertexShaderFile);295 if (this->vertexShaderSource != NULL)296 for (unsigned int i = 0; i < this->vertexShaderSource->getCount(); i++)297 PRINT(3)("%d: %s\n", i, this->vertexShaderSource->getEntry(i));298 }299 if (this->fragmentShader != 0)300 {301 PRINT(3)("FragmentShaderProgramm: number=%d, file='%s'\n", this->fragmentShader, this->fragmentShaderFile);302 if (this->fragmentShaderSource != NULL)303 for (unsigned int i = 0; i < this->fragmentShaderSource->getCount(); i++)304 PRINT(3)("%d: %s\n", i, this->fragmentShaderSource->getEntry(i));*/305 } 306 } 307 326 /* PRINT(3)("VertexShaderProgramm: number=%d, file='%s'\n", this->vertexShader, this->vertexShaderFile); 327 if (this->vertexShaderSource != NULL) 328 for (unsigned int i = 0; i < this->vertexShaderSource->getCount(); i++) 329 PRINT(3)("%d: %s\n", i, this->vertexShaderSource->getEntry(i)); 330 } 331 if (this->fragmentShader != 0) 332 { 333 PRINT(3)("FragmentShaderProgramm: number=%d, file='%s'\n", this->fragmentShader, this->fragmentShaderFile); 334 if (this->fragmentShaderSource != NULL) 335 for (unsigned int i = 0; i < this->fragmentShaderSource->getCount(); i++) 336 PRINT(3)("%d: %s\n", i, this->fragmentShaderSource->getEntry(i));*/ 337 } 338 } 339 -
branches/new_class_id/src/lib/graphics/shader.h
r9715 r9806 16 16 17 17 18 //! A class for ...18 //! The Shader is a Class-wrapper around the OpenGL Shader Language (GLSL). 19 19 class Shader : public BaseObject 20 20 { … … 38 38 void set(int v0, int v1, int v2, int v3) const { glUniform4i(this->uniform, v0, v1, v2, v3); } 39 39 40 void setV(unsigned int count, float* vv) const 41 { 42 switch (count) 43 { 44 case 1: 45 glUniform1fv(this->uniform, 1, vv); 46 break; 47 case 2: 48 glUniform2fv(this->uniform, 2, vv); 49 break; 50 case 3: 51 glUniform3fv(this->uniform, 3, vv); 52 break; 53 case 4: 54 glUniform4fv(this->uniform, 4, vv); 55 break; 56 } 57 } 58 void setV(unsigned int count, int* vv) const 59 { 60 switch (count) 61 { 62 case 1: 63 glUniform1iv(this->uniform, 1, vv); 64 break; 65 case 2: 66 glUniform2iv(this->uniform, 2, vv); 67 break; 68 case 3: 69 glUniform3iv(this->uniform, 3, vv); 70 break; 71 case 4: 72 glUniform4iv(this->uniform, 4, vv); 73 break; 74 } 75 } 40 void setV(unsigned int count, float* vv) const; 41 void setV(unsigned int count, int* vv) const; 42 76 43 private: 77 44 GLint uniform; 78 45 }; 79 46 47 //! The Type of Shader. 80 48 typedef enum 81 49 { 82 None = 0, 83 Fragment = 1, 84 Vertex = 2, 85 86 Program = 4, 87 } 88 Type; 50 None = 0, //!< No Type at all 51 Fragment = 1, //!< Fragment Shader. 52 Vertex = 2, //!< Vertex Shader. 53 Program = 4, //!< Compiled Shader Programm. 54 } Type; 89 55 90 56 public: 91 57 Shader(const std::string& vertexShaderFile = "", const std::string& fragmentShaderFile = ""); 92 58 virtual ~Shader(); 93 static Shader* getShader(const std::string& vertexShaderFile, const std::string& fragmentShaderFile);94 static bool unload(Shader* shader);95 59 60 61 Shader::Uniform getUniform(const std::string& location) { return Shader::Uniform(this, location); } 62 63 GLhandleARB getProgram() const { return this->shaderProgram; } 64 GLhandleARB getVertexS() const { return this->vertexShader; } 65 GLhandleARB getFragmentS() const { return this->fragmentShader; } 96 66 97 67 static bool checkShaderAbility(); 98 68 void activateShader(); 99 void bindShader(const char* name, const float* value, size_t size);100 69 static void deactivateShader(); 101 70 102 Shader::Uniform getUniform(const std::string& location) { return Shader::Uniform(this, location); } 71 void debug() const; 103 72 104 bool loadShaderProgramm(Shader::Type type, const std::string& fileName); 105 void deleteProgram(Shader::Type type); 106 107 void linkShaderProgram(); 108 109 110 bool readShader(const std::string& fileName, std::string& output); 111 112 113 inline static bool shaderActive() { return (Shader::storedShader != NULL)? true : false; }; 73 inline static bool isShaderActive() { return (Shader::storedShader != NULL) ? true : false; }; 114 74 inline static Shader* getActiveShader() { return Shader::storedShader; }; 115 75 inline static void suspendShader() { Shader* currShader = storedShader; if (storedShader!= NULL) { Shader::deactivateShader(); Shader::storedShader = currShader;} }; 116 76 inline static void restoreShader() { if (storedShader != NULL) storedShader->activateShader(); storedShader = NULL; }; 117 77 118 119 120 121 GLhandleARB getProgram() const { return this->shaderProgram; }122 GLhandleARB getVertexS() const { return this->vertexShader; }123 GLhandleARB getFragmentS() const { return this->fragmentShader; }124 125 void debug() const;126 127 78 static void printError(GLhandleARB program); 128 79 80 private: 81 void bindShader(const char* name, const float* value, size_t size); 82 void linkShaderProgram(); 83 bool readShader(const std::string& fileName, std::string& output); 84 bool loadShaderProgramm(Shader::Type type, const std::string& fileName); 85 void deleteProgram(Shader::Type type); 129 86 130 87 private: -
branches/new_class_id/src/lib/graphics/shader_data.cc
r9803 r9806 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include "shader .h"18 #include "shader_data.h" 19 19 20 20 #include "stdlibincl.h" … … 33 33 34 34 35 ObjectListDefinition(Shader );35 ObjectListDefinition(ShaderData); 36 36 37 37 /** … … 41 41 { 42 42 this->registerObject(this, Shader::_objectList); 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 43 this->shaderProgram = 0; 44 this->vertexShader = 0; 45 this->fragmentShader = 0; 46 47 if (GLEW_ARB_shader_objects && GLEW_ARB_shading_language_100) 48 { 49 this->shaderProgram = glCreateProgramObjectARB(); 50 51 if (!vertexShaderFile.empty()) 52 this->loadShaderProgramm(Shader::Vertex, vertexShaderFile); 53 if (!fragmentShaderFile.empty()) 54 this->loadShaderProgramm(Shader::Fragment, fragmentShaderFile); 55 56 this->linkShaderProgram(); 57 58 } 59 else 60 { 61 PRINTF(2)("Shaders are not supported on your hardware\n"); 62 } 63 63 } 64 64 … … 91 91 //glLinkProgramARB(this->shaderProgram); 92 92 glDeleteObjectARB(this->shaderProgram); 93 93 // link error checking 94 94 glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_DELETE_STATUS_ARB, &status); 95 95 if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION) 96 96 this->printError(this->shaderProgram); 97 97 } 98 }99 100 Shader* Shader::getShader(const std::string& vertexShaderFile, const std::string& fragmentShaderFile)101 {102 return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER, RP_LEVEL, fragmentShaderFile);103 }104 105 bool Shader::unload(Shader* shader)106 {107 return ResourceManager::getInstance()->unload(shader);108 98 } 109 99 … … 161 151 162 152 glLinkProgramARB(this->shaderProgram); 163 153 // link error checking 164 154 glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_LINK_STATUS_ARB, &status); 165 155 if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION) … … 203 193 void Shader::bindShader(const char* name, const float* value, size_t size) 204 194 { 205 if (likely (this->shaderProgram != 0)) { 206 glUseProgramObjectARB(this->shaderProgram); 207 208 unsigned int location = glGetUniformLocationARB(this->shaderProgram, name); 209 /* This is EXPENSIVE and should be avoided. */ 210 211 if (size == 1) glUniform1fvARB(location, 1, value); 212 else if (size == 2) glUniform2fvARB(location, 1, value); 213 else if (size == 3) glUniform3fvARB(location, 1, value); 214 else if (size == 4) glUniform4fvARB(location, 1, value); 215 else if (size == 9) glUniformMatrix3fvARB(location, 1, false, value); 216 else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value); 217 218 } 195 if (likely (this->shaderProgram != 0)) 196 { 197 glUseProgramObjectARB(this->shaderProgram); 198 199 unsigned int location = glGetUniformLocationARB(this->shaderProgram, name); 200 /* This is EXPENSIVE and should be avoided. */ 201 202 if (size == 1) glUniform1fvARB(location, 1, value); 203 else if (size == 2) glUniform2fvARB(location, 1, value); 204 else if (size == 3) glUniform3fvARB(location, 1, value); 205 else if (size == 4) glUniform4fvARB(location, 1, value); 206 else if (size == 9) glUniformMatrix3fvARB(location, 1, false, value); 207 else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value); 208 209 } 219 210 } 220 211 221 212 void Shader::deactivateShader() 222 213 { 223 if (storedShader != NULL)224 glUseProgramObjectARB(0);225 Shader::storedShader = NULL;214 if (storedShader != NULL) 215 glUseProgramObjectARB(0); 216 Shader::storedShader = NULL; 226 217 } 227 218 … … 292 283 if (this->vertexShader != 0) 293 284 { 294 /* PRINT(3)("VertexShaderProgramm: number=%d, file='%s'\n", this->vertexShader, this->vertexShaderFile);295 if (this->vertexShaderSource != NULL)296 for (unsigned int i = 0; i < this->vertexShaderSource->getCount(); i++)297 PRINT(3)("%d: %s\n", i, this->vertexShaderSource->getEntry(i));298 }299 if (this->fragmentShader != 0)300 {301 PRINT(3)("FragmentShaderProgramm: number=%d, file='%s'\n", this->fragmentShader, this->fragmentShaderFile);302 if (this->fragmentShaderSource != NULL)303 for (unsigned int i = 0; i < this->fragmentShaderSource->getCount(); i++)304 PRINT(3)("%d: %s\n", i, this->fragmentShaderSource->getEntry(i));*/305 } 306 } 307 285 /* PRINT(3)("VertexShaderProgramm: number=%d, file='%s'\n", this->vertexShader, this->vertexShaderFile); 286 if (this->vertexShaderSource != NULL) 287 for (unsigned int i = 0; i < this->vertexShaderSource->getCount(); i++) 288 PRINT(3)("%d: %s\n", i, this->vertexShaderSource->getEntry(i)); 289 } 290 if (this->fragmentShader != 0) 291 { 292 PRINT(3)("FragmentShaderProgramm: number=%d, file='%s'\n", this->fragmentShader, this->fragmentShaderFile); 293 if (this->fragmentShaderSource != NULL) 294 for (unsigned int i = 0; i < this->fragmentShaderSource->getCount(); i++) 295 PRINT(3)("%d: %s\n", i, this->fragmentShaderSource->getEntry(i));*/ 296 } 297 } 298 -
branches/new_class_id/src/lib/graphics/shader_data.h
r9803 r9806 1 1 /*! 2 * @file shader .h2 * @file shader_data.h 3 3 * @brief Definition of the Shader rendering class 4 4 */ 5 5 6 #ifndef _SHADER_ H7 #define _SHADER_ H6 #ifndef _SHADER_DATA_H 7 #define _SHADER_DATA_H 8 8 9 9 #include "base_object.h" 10 #include "glincl.h" 10 11 #include "shader_types.h" 11 12 #include <vector> 12 13 … … 16 17 17 18 18 //! A class for ...19 class Shader : public BaseObject19 //! The ShaderData is a Class-wrapper around the OpenGL Shader Language (GLSL). 20 class ShaderData : public BaseObject 20 21 { 21 ObjectListDeclaration(Shader );22 ObjectListDeclaration(ShaderData); 22 23 public: 23 class Uniform 24 { 25 public: 26 Uniform(const Shader* shader, const std::string& location) { this->uniform = glGetUniformLocationARB(shader->getProgram(), location.c_str()) ; } 27 Uniform(const Shader& shader, const std::string& location) { this->uniform = glGetUniformLocation(shader.getProgram(), location.c_str()) ; }; 28 Uniform(GLhandleARB shaderProgram, const std::string& location) { this->uniform = glGetUniformLocation(shaderProgram, location.c_str()) ; }; 24 ShaderData(const std::string& vertexShaderFile = "", const std::string& fragmentShaderFile = ""); 25 virtual ~ShaderData(); 29 26 30 void set(float v0) const { glUniform1f(this->uniform, v0); } 31 void set(float v0, float v1) const { glUniform2f(this->uniform, v0, v1); } 32 void set(float v0, float v1, float v2) const { glUniform3f(this->uniform, v0, v1, v2); } 33 void set(float v0, float v1, float v2, float v3) const { glUniform4f(this->uniform, v0, v1, v2, v3); } 27 Shaders::Uniform getUniform(const std::string& location) { return Shader::Uniform(this, location); } 34 28 35 void set(int v0) const { glUniform1i(this->uniform, v0); } 36 void set(int v0, int v1) const { glUniform2i(this->uniform, v0, v1); } 37 void set(int v0, int v1, int v2) const { glUniform3i(this->uniform, v0, v1, v2); } 38 void set(int v0, int v1, int v2, int v3) const { glUniform4i(this->uniform, v0, v1, v2, v3); } 39 40 void setV(unsigned int count, float* vv) const 41 { 42 switch (count) 43 { 44 case 1: 45 glUniform1fv(this->uniform, 1, vv); 46 break; 47 case 2: 48 glUniform2fv(this->uniform, 2, vv); 49 break; 50 case 3: 51 glUniform3fv(this->uniform, 3, vv); 52 break; 53 case 4: 54 glUniform4fv(this->uniform, 4, vv); 55 break; 56 } 57 } 58 void setV(unsigned int count, int* vv) const 59 { 60 switch (count) 61 { 62 case 1: 63 glUniform1iv(this->uniform, 1, vv); 64 break; 65 case 2: 66 glUniform2iv(this->uniform, 2, vv); 67 break; 68 case 3: 69 glUniform3iv(this->uniform, 3, vv); 70 break; 71 case 4: 72 glUniform4iv(this->uniform, 4, vv); 73 break; 74 } 75 } 76 private: 77 GLint uniform; 78 }; 79 80 typedef enum 81 { 82 None = 0, 83 Fragment = 1, 84 Vertex = 2, 85 86 Program = 4, 87 } 88 Type; 89 90 public: 91 Shader(const std::string& vertexShaderFile = "", const std::string& fragmentShaderFile = ""); 92 virtual ~Shader(); 93 static Shader* getShader(const std::string& vertexShaderFile, const std::string& fragmentShaderFile); 94 static bool unload(Shader* shader); 95 96 97 static bool checkShaderAbility(); 98 void activateShader(); 99 void bindShader(const char* name, const float* value, size_t size); 100 static void deactivateShader(); 101 102 Shader::Uniform getUniform(const std::string& location) { return Shader::Uniform(this, location); } 103 104 bool loadShaderProgramm(Shader::Type type, const std::string& fileName); 105 void deleteProgram(Shader::Type type); 106 107 void linkShaderProgram(); 108 109 110 bool readShader(const std::string& fileName, std::string& output); 111 112 113 inline static bool shaderActive() { return (Shader::storedShader != NULL)? true : false; }; 114 inline static Shader* getActiveShader() { return Shader::storedShader; }; 115 inline static void suspendShader() { Shader* currShader = storedShader; if (storedShader!= NULL) { Shader::deactivateShader(); Shader::storedShader = currShader;} }; 116 inline static void restoreShader() { if (storedShader != NULL) storedShader->activateShader(); storedShader = NULL; }; 117 118 119 120 121 GLhandleARB getProgram() const { return this->shaderProgram; } 29 GLhandleARB getProgram() const { return this->shaderProgram; } 122 30 GLhandleARB getVertexS() const { return this->vertexShader; } 123 31 GLhandleARB getFragmentS() const { return this->fragmentShader; } 124 32 33 void activateShader(); 34 125 35 void debug() const; 126 127 static void printError(GLhandleARB program); 128 36 private: 37 void bindShader(const char* name, const float* value, size_t size); 38 void linkShaderProgram(); 39 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); 129 42 130 43 private: … … 136 49 GLhandleARB vertexShader; 137 50 GLhandleARB fragmentShader; 138 139 140 static Shader* storedShader;141 51 }; 142 52 143 #endif /* _SHADER_ H */53 #endif /* _SHADER_DATA_H */ -
branches/new_class_id/src/lib/lang/base_object.cc
r9805 r9806 32 32 this->objectName = objectName; 33 33 this->xmlElem = NULL; 34 35 //ClassList::addToClassList(this, this->classID, "BaseObject");36 34 } 37 35 … … 45 43 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) 46 44 { 47 PRINTF(5)("DELETING OBJECT %s::%s FROM %s\n", this->getClassCName(), getCName(), (*it)._objectList->name().c_str());48 45 (*it)._objectList->unregisterObject((*it)._iterator); 49 46 delete (*it)._iterator; … … 148 145 void BaseObject::listInheritance() const 149 146 { 150 PRINT(0)("Listing inheritance diagram for ....: ");147 PRINT(0)("Listing inheritance diagram for %s::%s: ", getClassCName(), getCName()); 151 148 ClassList::const_iterator it; 152 149 for (it = this->_classes.begin(); it != this->_classes.end(); ++it) -
branches/new_class_id/src/lib/sound/ogg_player.h
r9762 r9806 100 100 101 101 102 std::string _title; 103 std::string _artist; 104 std::string _album; 105 std::string _vendor; 102 std::string _title; //!< Song Title. 103 std::string _artist; //!< Artist Name of the current song. 104 std::string _album; //!< Album Name of the current song. 105 std::string _vendor; //!< Vendor Name of the current song. 106 106 }; 107 107 -
branches/new_class_id/src/lib/sound/sound_buffer.cc
r9805 r9806 18 18 #include "sound_buffer.h" 19 19 20 20 21 namespace OrxSound 21 22 { 23 ObjectListDefinition(SoundBuffer); 22 24 ////////////////// 23 25 /* SOUND-BUFFER */ … … 26 28 : data(new SoundBufferData) 27 29 { 30 this->registerObject(this, SoundBuffer::_objectList); 28 31 } 29 32 /** … … 34 37 : data(new SoundBufferData) 35 38 { 39 this->registerObject(this, SoundBuffer::_objectList); 36 40 this->load(fileName); 37 41 } … … 39 43 SoundBuffer::SoundBuffer(const SoundBuffer& buffer) 40 44 : data(buffer.data) 41 { } 45 { 46 this->registerObject(this, SoundBuffer::_objectList); 47 } 42 48 43 49 SoundBuffer::SoundBuffer(const SoundBufferData::Pointer& dataPointer) 44 50 : data(dataPointer) 45 { }; 51 { 52 this->registerObject(this, SoundBuffer::_objectList); 53 }; 54 55 SoundBuffer::~SoundBuffer() 56 { 57 printf("Deleting Object of type SoundBuffer\n"); 58 } 59 46 60 } -
branches/new_class_id/src/lib/sound/sound_buffer.h
r9805 r9806 7 7 #define _SOUND_BUFFER_H 8 8 9 #include "base_object.h" 9 10 #include "sound_buffer_data.h" 10 11 … … 12 13 { 13 14 //! A class that represents a datastructure to play Sounds. 14 class SoundBuffer 15 class SoundBuffer : virtual public BaseObject 15 16 { 17 ObjectListDeclaration(SoundBuffer); 16 18 public: 17 19 SoundBuffer(); … … 19 21 SoundBuffer(const SoundBufferData::Pointer& dataPointer); 20 22 SoundBuffer(const std::string& fileName); 23 virtual ~SoundBuffer(); 21 24 22 25 bool operator==(const SoundBuffer& buffer) const {return this->data == buffer.data; };
Note: See TracChangeset
for help on using the changeset viewer.