Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5261 in orxonox.OLD


Ignore:
Timestamp:
Sep 26, 2005, 10:34:21 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: structure of the Shader-lib

Location:
trunk/src
Files:
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r5160 r5261  
    7474                  lib/graphics/graphics_engine.cc \
    7575                  lib/graphics/light.cc \
     76                  lib/graphics/shader.cc \
    7677                  lib/graphics/text_engine.cc \
    7778                  lib/graphics/render2D/element_2d.cc \
     
    146147                 lib/graphics/graphics_engine.h \
    147148                 lib/graphics/light.h \
     149                 lib/graphics/shader.h \
    148150                 lib/graphics/text_engine.h \
    149151                 lib/lang/base_object.h \
  • trunk/src/Makefile.in

    r5160 r5261  
    7676        orxonox-p_node.$(OBJEXT) orxonox-null_parent.$(OBJEXT) \
    7777        orxonox-graphics_engine.$(OBJEXT) orxonox-light.$(OBJEXT) \
    78         orxonox-text_engine.$(OBJEXT) orxonox-element_2d.$(OBJEXT) \
    79         orxonox-render_2d.$(OBJEXT) orxonox-base_object.$(OBJEXT) \
    80         orxonox-class_list.$(OBJEXT) orxonox-ini_parser.$(OBJEXT) \
    81         orxonox-substring.$(OBJEXT) orxonox-color.$(OBJEXT) \
    82         orxonox-helper_functions.$(OBJEXT) orxonox-vector.$(OBJEXT) \
    83         orxonox-curve.$(OBJEXT) orxonox-glmenu_imagescreen.$(OBJEXT) \
     78        orxonox-shader.$(OBJEXT) orxonox-text_engine.$(OBJEXT) \
     79        orxonox-element_2d.$(OBJEXT) orxonox-render_2d.$(OBJEXT) \
     80        orxonox-base_object.$(OBJEXT) orxonox-class_list.$(OBJEXT) \
     81        orxonox-ini_parser.$(OBJEXT) orxonox-substring.$(OBJEXT) \
     82        orxonox-color.$(OBJEXT) orxonox-helper_functions.$(OBJEXT) \
     83        orxonox-vector.$(OBJEXT) orxonox-curve.$(OBJEXT) \
     84        orxonox-glmenu_imagescreen.$(OBJEXT) \
    8485        orxonox-benchmark.$(OBJEXT)
    8586orxonox_OBJECTS = $(am_orxonox_OBJECTS)
     
    122123@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-resource_manager.Po \
    123124@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-satellite.Po \
     125@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-shader.Po \
    124126@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-skybox.Po \
    125127@AMDEP_TRUE@    ./$(DEPDIR)/orxonox-skysphere.Po \
     
    332334                  lib/graphics/graphics_engine.cc \
    333335                  lib/graphics/light.cc \
     336                  lib/graphics/shader.cc \
    334337                  lib/graphics/text_engine.cc \
    335338                  lib/graphics/render2D/element_2d.cc \
     
    404407                 lib/graphics/graphics_engine.h \
    405408                 lib/graphics/light.h \
     409                 lib/graphics/shader.h \
    406410                 lib/graphics/text_engine.h \
    407411                 lib/lang/base_object.h \
     
    531535@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-resource_manager.Po@am__quote@
    532536@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-satellite.Po@am__quote@
     537@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-shader.Po@am__quote@
    533538@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-skybox.Po@am__quote@
    534539@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-skysphere.Po@am__quote@
     
    12061211@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    12071212@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-light.obj `if test -f 'lib/graphics/light.cc'; then $(CYGPATH_W) 'lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/light.cc'; fi`
     1213
     1214orxonox-shader.o: lib/graphics/shader.cc
     1215@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shader.o -MD -MP -MF "$(DEPDIR)/orxonox-shader.Tpo" -c -o orxonox-shader.o `test -f 'lib/graphics/shader.cc' || echo '$(srcdir)/'`lib/graphics/shader.cc; \
     1216@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shader.Tpo" "$(DEPDIR)/orxonox-shader.Po"; else rm -f "$(DEPDIR)/orxonox-shader.Tpo"; exit 1; fi
     1217@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/shader.cc' object='orxonox-shader.o' libtool=no @AMDEPBACKSLASH@
     1218@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shader.Po' tmpdepfile='$(DEPDIR)/orxonox-shader.TPo' @AMDEPBACKSLASH@
     1219@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1220@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shader.o `test -f 'lib/graphics/shader.cc' || echo '$(srcdir)/'`lib/graphics/shader.cc
     1221
     1222orxonox-shader.obj: lib/graphics/shader.cc
     1223@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-shader.obj -MD -MP -MF "$(DEPDIR)/orxonox-shader.Tpo" -c -o orxonox-shader.obj `if test -f 'lib/graphics/shader.cc'; then $(CYGPATH_W) 'lib/graphics/shader.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/shader.cc'; fi`; \
     1224@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/orxonox-shader.Tpo" "$(DEPDIR)/orxonox-shader.Po"; else rm -f "$(DEPDIR)/orxonox-shader.Tpo"; exit 1; fi
     1225@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/graphics/shader.cc' object='orxonox-shader.obj' libtool=no @AMDEPBACKSLASH@
     1226@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/orxonox-shader.Po' tmpdepfile='$(DEPDIR)/orxonox-shader.TPo' @AMDEPBACKSLASH@
     1227@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     1228@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-shader.obj `if test -f 'lib/graphics/shader.cc'; then $(CYGPATH_W) 'lib/graphics/shader.cc'; else $(CYGPATH_W) '$(srcdir)/lib/graphics/shader.cc'; fi`
    12081229
    12091230orxonox-text_engine.o: lib/graphics/text_engine.cc
  • trunk/src/defs/class_id.h

    r5206 r5261  
    170170  CL_PARTICLE_SYSTEM            =    0x0000080a,
    171171  CL_ENVIRONMENT                =    0x00000810,
     172  CL_SHADER                     =    0x00000811,
    172173  // GL-menu
    173174  CL_GLMENU_IMAGE_SCREEN        =    0x00000901,
  • trunk/src/lib/graphics/graphics_engine.cc

    r5260 r5261  
    225225}
    226226
     227/**
     228 * grabs the Hardware Specifics
     229 * checks for all the different HW-types
     230 */
    227231void GraphicsEngine::grabHardwareSettings()
    228232{
     
    308312}
    309313
    310 
    311314/**
    312315 *  Signalhandler, for when the resolution has changed
     
    322325*/
    323326bool GraphicsEngine::texturesEnabled = true;
    324 
    325 
    326327
    327328/**
     
    378379     return false;
    379380};
    380 
    381381
    382382/**
     
    470470      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
    471471  }
     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 */
     479bool 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;
    472486}
    473487
     
    554568
    555569/**
    556   \brief processes the events for orxonox main class
     570  \brief processes the events for the GraphicsEngine class
    557571* @param the event to handle
    558572 */
  • trunk/src/lib/graphics/graphics_engine.h

    r5260 r5261  
    6969
    7070    void listModes();
     71    bool hwSupportsEXT(const char* extension);
    7172
    7273    /** \brief swaps the GL_BUFFERS */
  • trunk/src/lib/graphics/shader.cc

    r5260 r5261  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "shader.h"
    1919
    2020using namespace std;
     
    2323/**
    2424 * standard constructor
    25  * @todo this constructor is not jet implemented - do it
    2625*/
    27 ProtoClass::ProtoClass ()
     26Shader::Shader (SHADER_TYPE type, ...)
    2827{
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
     28   this->setClassID(CL_SHADER, "Shader");
    3029
    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;
    4137}
    4238
     
    4541 * standard deconstructor
    4642*/
    47 ProtoClass::~ProtoClass ()
     43Shader::~Shader ()
    4844{
    4945  // 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;*/
    5055}
     56
     57
     58bool Shader::loadShaderProgramm(SHADER_TYPE type, const char* fileName)
     59{
     60  if (type != SHADER_VERTEX || type != SHADER_FRAGMENT)
     61    return false;
     62
     63
     64}
     65
     66bool Shader::activateShader()
     67{
     68
     69}
  • trunk/src/lib/graphics/shader.h

    r5260 r5261  
    11/*!
    2  * @file proto_class.h
    3  * @brief Definition of ...
     2 * @file shader.h
     3 * @brief Definition of the Shader rendering class
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _SHADER_H
     7#define _SHADER_H
    88
    99#include "base_object.h"
     10#include "glincl.h"
     11
     12
     13typedef enum
     14{
     15  SHADER_NONE       = 0,
     16  SHADER_FRAGMENT   = 1,
     17  SHADER_VERTEX     = 0,
     18
     19} SHADER_TYPE;
    1020
    1121// FORWARD DECLARATION
     
    1424
    1525//! A class for ...
    16 class ProtoClass : public BaseObject {
     26class Shader : public BaseObject {
    1727
    1828 public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
     29  Shader(SHADER_TYPE type, ...);
     30  virtual ~Shader();
    2131
     32  bool loadShaderProgramm(SHADER_TYPE type, const char* fileName);
     33  bool activateShader();
    2234
    2335 private:
    24 
     36   char*                  fragmentShaderFile;
     37   char*                  vertexShaderFile;
     38   char*                  fragmentShaderSource;
     39   char*                  vertexShaderSource;
     40   GLenum                 shaderProgram;
     41   GLenum                 vertexShader;
     42   GLenum                 fragmentShader;
    2543};
    2644
    27 #endif /* _PROTO_CLASS_H */
     45#endif /* _SHADER_H */
Note: See TracChangeset for help on using the changeset viewer.