source: trunk/packages/vizservers/nanovis/NvStdVertexShader.h @ 2844

Last change on this file since 2844 was 2844, checked in by ldelgass, 8 years ago

Cleanups, no functional changes

  • Property svn:eol-style set to native
File size: 951 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#ifndef NV_STD_VERTEX_SHADER_H
3#define NV_STD_VERTEX_SHADER_H
4
5#include "NvShader.h"
6
7class NvStdVertexShader : public NvShader
8{
9public:
10    NvStdVertexShader();
11
12    ~NvStdVertexShader();
13
14    void bind();
15    void unbind();
16
17private:
18    void init();
19
20    /// A parameter id for ModelViewProjection matrix of Cg program
21    CGparameter _mvp_vert_std_param;
22
23    /// A parameter id for ModelViewInverse matrix of Cg program
24    CGparameter _mvi_vert_std_param;
25};
26
27inline void NvStdVertexShader::bind()
28{
29    cgGLSetStateMatrixParameter(_mvp_vert_std_param, CG_GL_MODELVIEW_PROJECTION_MATRIX, CG_GL_MATRIX_IDENTITY);
30    cgGLSetStateMatrixParameter(_mvi_vert_std_param, CG_GL_MODELVIEW_MATRIX, CG_GL_MATRIX_INVERSE);
31    cgGLBindProgram(_cgVP);
32    cgGLEnableProfile(CG_PROFILE_VP30);
33}
34
35inline void NvStdVertexShader::unbind()
36{
37    cgGLDisableProfile(CG_PROFILE_VP30);
38}
39
40#endif
41
Note: See TracBrowser for help on using the repository browser.