source: trunk/packages/vizservers/nanovis/StdVertexShader.cpp @ 3612

Last change on this file since 3612 was 3612, checked in by ldelgass, 7 years ago

Remove Nv prefix from shader classes now that they are in nv namespace.

  • Property svn:eol-style set to native
File size: 807 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 */
6#include "StdVertexShader.h"
7
8using namespace nv;
9
10StdVertexShader::StdVertexShader()
11{
12    init();
13}
14
15StdVertexShader::~StdVertexShader()
16{
17}
18
19void StdVertexShader::init()
20{
21    loadVertexProgram("vertex_std.cg", "main");
22}
23
24void StdVertexShader::bind(float *mvp, float *mvInv)
25{
26    if (mvp != NULL) {
27        setVPMatrixParameterf("modelViewProjMatrix", mvp);
28    } else {
29        setGLStateMatrixVPParameter("modelViewProjMatrix", MODELVIEW_PROJECTION_MATRIX);
30    }
31    if (mvInv != NULL) {
32        setVPMatrixParameterf("modelViewInv", mvInv);
33    } else {
34        setGLStateMatrixVPParameter("modelViewInv", MODELVIEW_MATRIX, MATRIX_INVERSE);
35    }
36
37    Shader::bind();
38}
Note: See TracBrowser for help on using the repository browser.