Changeset 5261 in orxonox.OLD for trunk/src/lib
- Timestamp:
- Sep 26, 2005, 10:34:21 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 2 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r5260 r5261 225 225 } 226 226 227 /** 228 * grabs the Hardware Specifics 229 * checks for all the different HW-types 230 */ 227 231 void GraphicsEngine::grabHardwareSettings() 228 232 { … … 308 312 } 309 313 310 311 314 /** 312 315 * Signalhandler, for when the resolution has changed … … 322 325 */ 323 326 bool GraphicsEngine::texturesEnabled = true; 324 325 326 327 327 328 /** … … 378 379 return false; 379 380 }; 380 381 381 382 382 /** … … 470 470 PRINT(4)(" | %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h); 471 471 } 472 } 473 474 /** 475 * checks wether a certain extension is availiable 476 * @param extension the Extension to check for (ex. GL_ARB_texture_env_dot3) 477 * @return true if it is, false otherwise 478 */ 479 bool GraphicsEngine::hwSupportsEXT(const char* extension) 480 { 481 if (this->hwExtensions != NULL) 482 for (unsigned int i = 0; i < this->hwExtensions->getCount(); i++) 483 if (!strcmp(extension, this->hwExtensions->getString(i))) 484 return true; 485 return false; 472 486 } 473 487 … … 554 568 555 569 /** 556 \brief processes the events for orxonox mainclass570 \brief processes the events for the GraphicsEngine class 557 571 * @param the event to handle 558 572 */ -
trunk/src/lib/graphics/graphics_engine.h
r5260 r5261 69 69 70 70 void listModes(); 71 bool hwSupportsEXT(const char* extension); 71 72 72 73 /** \brief swaps the GL_BUFFERS */ -
trunk/src/lib/graphics/shader.cc
r5260 r5261 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " proto_class.h"18 #include "shader.h" 19 19 20 20 using namespace std; … … 23 23 /** 24 24 * standard constructor 25 * @todo this constructor is not jet implemented - do it26 25 */ 27 ProtoClass::ProtoClass ()26 Shader::Shader (SHADER_TYPE type, ...) 28 27 { 29 this->setClassID(CL_ PROTO_ID, "ProtoClass");28 this->setClassID(CL_SHADER, "Shader"); 30 29 31 /* If you make a new class, what is most probably the case when you write this file 32 don't forget to: 33 1. Add the new file new_class.cc to the ./src/Makefile.am 34 2. Add the class identifier to ./src/class_id.h eg. CL_NEW_CLASS 35 36 Advanced Topics: 37 - if you want to let your object be managed via the ObjectManager make sure to read 38 the object_manager.h header comments. You will use this most certanly only if you 39 make many objects of your class, like a weapon bullet. 40 */ 30 this->fragmentShaderFile = NULL; 31 this->vertexShaderFile = NULL; 32 this->fragmentShaderSource = NULL; 33 this->vertexShaderSource = NULL; 34 this->shaderProgram = 0; 35 this->vertexShader = 0; 36 this->fragmentShader = 0; 41 37 } 42 38 … … 45 41 * standard deconstructor 46 42 */ 47 ProtoClass::~ProtoClass()43 Shader::~Shader () 48 44 { 49 45 // delete what has to be deleted here 46 delete[] this->fragmentShaderFile; 47 delete[] this->vertexShaderFile; 48 delete[] this->fragmentShaderSource; 49 delete[] this->vertexShaderSource; 50 51 // DELETE THE PROGRAMS 52 /* this->shaderProgram = 0; 53 this->vertexShader = 0; 54 this->fragmentShader = 0;*/ 50 55 } 56 57 58 bool Shader::loadShaderProgramm(SHADER_TYPE type, const char* fileName) 59 { 60 if (type != SHADER_VERTEX || type != SHADER_FRAGMENT) 61 return false; 62 63 64 } 65 66 bool Shader::activateShader() 67 { 68 69 } -
trunk/src/lib/graphics/shader.h
r5260 r5261 1 1 /*! 2 * @file proto_class.h3 * @brief Definition of ...2 * @file shader.h 3 * @brief Definition of the Shader rendering class 4 4 */ 5 5 6 #ifndef _ PROTO_CLASS_H7 #define _ PROTO_CLASS_H6 #ifndef _SHADER_H 7 #define _SHADER_H 8 8 9 9 #include "base_object.h" 10 #include "glincl.h" 11 12 13 typedef enum 14 { 15 SHADER_NONE = 0, 16 SHADER_FRAGMENT = 1, 17 SHADER_VERTEX = 0, 18 19 } SHADER_TYPE; 10 20 11 21 // FORWARD DECLARATION … … 14 24 15 25 //! A class for ... 16 class ProtoClass: public BaseObject {26 class Shader : public BaseObject { 17 27 18 28 public: 19 ProtoClass();20 virtual ~ ProtoClass();29 Shader(SHADER_TYPE type, ...); 30 virtual ~Shader(); 21 31 32 bool loadShaderProgramm(SHADER_TYPE type, const char* fileName); 33 bool activateShader(); 22 34 23 35 private: 24 36 char* fragmentShaderFile; 37 char* vertexShaderFile; 38 char* fragmentShaderSource; 39 char* vertexShaderSource; 40 GLenum shaderProgram; 41 GLenum vertexShader; 42 GLenum fragmentShader; 25 43 }; 26 44 27 #endif /* _ PROTO_CLASS_H */45 #endif /* _SHADER_H */
Note: See TracChangeset
for help on using the changeset viewer.