1
0
forked from 0ad/0ad
0ad/source/renderer/VertexProgram.cpp
Calefaction 11900f8b38 *** empty log message ***
This was SVN commit r1297.
2004-11-08 22:10:06 +00:00

65 lines
1.3 KiB
C++
Executable File

#include "precompiled.h"
#include "res/vfs.h"
#include "res/mem.h"
#include "renderer/VertexProgram.h"
#include "graphics/ProgramManager.h"
#include "renderer/Renderer.h"
#include "maths/Vector3D.h"
#include "graphics/LightEnv.h"
#include "CLogger.h"
#define LOG_CATEGORY "shaders"
CVertexProgram::CVertexProgram(const char *file)
{
Load(file);
}
CVertexProgram::~CVertexProgram()
{
}
bool CVertexProgram::IsValid()
{
return false;
}
void CVertexProgram::Bind()
{
}
void CVertexProgram::Load(const char *file)
{
#ifdef BUILD_CG
/* m_Program = NULL;
if(!file || !vfs_exists(file) || g_ProgramManager.GetVPProfile() == CG_PROFILE_UNKNOWN)
return;
void *data;
size_t size;
Handle h = vfs_load(file, data, size, 0);
if(h <= 0)
{
LOG(ERROR, LOG_CATEGORY, "CVertexShader::LoadShader: vfs_load for %s failed!\n", file);
return;
}
std::string src = (char*)data;
mem_free_h(h);
m_Program = cgCreateProgram(
g_ProgramManager.GetContext(),
CG_SOURCE,
src.c_str(),
g_ProgramManager.GetVPProfile(),
"main",
NULL
);
if(!m_Program)
{
LOG(ERROR, LOG_CATEGORY, "CVertexShader::LoadShader: Could not compile Cg shader: %s", cgGetErrorString(cgGetError()));
return;
}*/
#endif
}