Example #1
0
void GeoShaderData::ReadData(DataReader* reader)
{
    std::string readStr;
    reader->ReadString(readStr);
    InputPrimitive = PrimitiveTypeFromString(readStr);

    readStr.clear();
    reader->ReadString(readStr);
    OutputPrimitive = PrimitiveTypeFromString(readStr);

    reader->ReadUInt(MaxVertices);
    reader->ReadDataStructure(RenderIOAttributes_Readable(OutputTypes));
    reader->ReadUInt(UsageFlags.GetBitmaskValue());

    reader->ReadCollection([](DataReader* reader, void* pCollection, unsigned int elIndex, void* pDat)
                           {
                               UniformList& uList = *(UniformList*)pCollection;
                               reader->ReadDataStructure(Uniform_Readable(uList[elIndex]));
                           },
                           [](void* pCollection, unsigned int nElements)
                           {
                               UniformList* uList = (UniformList*)pCollection;
                               uList->resize(nElements);
                           }, &Params);

    reader->ReadString(ShaderCode);
}
Example #2
0
UniformList Program::getActiveUniforms() const {
   UniformList ul;

   // Get the number of active attributes
   GLint num_uniforms;
   getProgram(Program::ActiveUniforms, &num_uniforms);

   for(int index = 0; index < num_uniforms; index++) {
      ul.push_back(getUniformInfo(index));
   }
   return ul;
}
Example #3
0
void TextureSample2DNode::GetMyParameterDeclarations(UniformList& uniforms) const
{
    uniforms.push_back(Uniform(SamplerName, UT_VALUE_SAMPLER2D));
}