Ignore:
Timestamp:
10/10/08 13:53:22 (16 years ago)
Author:
mattausch
Message:

removed leaks. added class for shaders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h

    r3019 r3021  
    44#include "common.h" 
    55#include "glInterface.h" 
     6#include "ShaderProgram.h" 
    67 
    78#include <Cg/cg.h> 
     
    2021 
    2122 
    22 class ShaderProgram 
    23 { 
    24 public: 
    2523 
    26         ShaderProgram(CGprogram program): mProgram(program) {} 
    27  
    28         ~ShaderProgram() { cgDestroyProgram(mProgram); } 
    29  
    30         CGprogram mProgram; 
    31 }; 
    32  
    33  
    34 typedef  std::vector<ShaderProgram *> ShaderContainer; 
    3524typedef  std::vector<FrameBufferObject *> FBOContainer; 
    3625 
     
    5443                a smoothing factor for temporal coherence 
    5544        */ 
     45 
     46        ~DeferredRenderer(); 
     47 
    5648        void Render(FrameBufferObject *fbo,  
    5749                        const Matrix4x4 &oldProjViewMatrix,  
     
    6355                                ); 
    6456 
    65         /** Initialises the deferred shader and loads the required shaders: 
    66                 This function has to be called only once. 
    67         */ 
    68         static void Init(CGcontext context); 
    69  
    70         ~DeferredRenderer(); 
    71  
     57         
    7258        void SetUseTemporalCoherence(bool temporal); 
    7359 
     
    7864 
    7965        void SetShadingMethod(SHADING_METHOD s); 
     66         
     67        /** Initialises the deferred shader and loads the required shaders: 
     68                This function has to be called only once. 
     69        */ 
     70        static void InitCG(CGcontext context); 
     71        /** Releases all shader resources. 
     72        */ 
     73        static void ReleaseCG(); 
     74 
    8075        static int colorBufferIdx; 
    8176 
Note: See TracChangeset for help on using the changeset viewer.