Deprecated: loadShaderSourceFromFile()
Upgrade to osgDB::readShaderFile() git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7112 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 8687665a6b5a6e660ca4fec3408104242ea4411c Former-commit-id: 9e7a3ceb03eb9209893d8e61b02f7d6e97f880b9
This commit is contained in:
parent
7a6243875d
commit
968f19f324
1 changed files with 8 additions and 6 deletions
|
@ -21,6 +21,9 @@
|
|||
#include <osg/Program>
|
||||
#include <osg/Node>
|
||||
#include <osg/Uniform>
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osgDB/FileUtils>
|
||||
|
||||
#include <tgf.h>
|
||||
|
||||
#include "OsgMain.h"
|
||||
|
@ -31,13 +34,12 @@
|
|||
SDCarShader::SDCarShader(osg::Node *car, SDCar *c)
|
||||
{
|
||||
std::string TmpPath = GetDataDir();
|
||||
osg::ref_ptr<osg::Shader> vertShader = new osg::Shader( osg::Shader::VERTEX);
|
||||
osg::ref_ptr<osg::Shader> fragShader = new osg::Shader( osg::Shader::FRAGMENT);
|
||||
vertShader->loadShaderSourceFromFile(TmpPath+"data/shaders/car.vert");
|
||||
fragShader->loadShaderSourceFromFile(TmpPath+"data/shaders/car.frag");
|
||||
|
||||
program = new osg::Program;
|
||||
program->addShader( vertShader.get() );
|
||||
program->addShader( fragShader.get() );
|
||||
program->addShader(osgDB::readShaderFile(osg::Shader::VERTEX,
|
||||
osgDB::findDataFile(TmpPath + "data/shaders/car.vert")));
|
||||
program->addShader(osgDB::readShaderFile(osg::Shader::FRAGMENT,
|
||||
osgDB::findDataFile(TmpPath + "data/shaders/car.frag")));
|
||||
|
||||
//pCar= dynamic_cast<osg::Group *> (car);
|
||||
pCar = car;
|
||||
|
|
Loading…
Reference in a new issue