source: nanovis/branches/1.1/StdVertexShader.cpp @ 4906

Last change on this file since 4906 was 4904, checked in by ldelgass, 5 years ago

Merge serveral changes from trunk. Does not include threading, world space
changes, etc.

  • Property svn:eol-style set to native
File size: 871 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");
22}
23
24void StdVertexShader::bind(float *mvp, float *mvInv)
25{
26    if (mvp != NULL) {
27        setVPMatrixParameterf("modelViewProjMatrix", mvp);
28    } else {
29        setGLStateMatrixVPParameter("modelViewProjMatrix",
30                                    MODELVIEW_PROJECTION_MATRIX);
31    }
32    if (mvInv != NULL) {
33        setVPMatrixParameterf("modelViewInv", mvInv);
34    } else {
35        setGLStateMatrixVPParameter("modelViewInv",
36                                    MODELVIEW_MATRIX, MATRIX_INVERSE);
37    }
38
39    Shader::bind();
40}
Note: See TracBrowser for help on using the repository browser.