Program.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_GRAPHICS_PROGRAM_H
#define SURGSIM_GRAPHICS_PROGRAM_H
#include <string>
#include "SurgSim/Framework/Accessible.h"
namespace SurgSim
{
namespace Framework
{
class Asset;
}
namespace Graphics
{
class Program
{
public:
virtual ~Program() = 0;
virtual bool hasVertexShader() const = 0;
virtual void clearVertexShader() = 0;
virtual bool loadVertexShader(const std::string& filePath) = 0;
virtual void setVertexShaderSource(const std::string& source) = 0;
virtual bool getVertexShaderSource(std::string* source) const = 0;
virtual bool hasGeometryShader() const = 0;
virtual void clearGeometryShader() = 0;
virtual bool loadGeometryShader(const std::string& filePath) = 0;
virtual void setGeometryShaderSource(const std::string& source) = 0;
virtual bool getGeometryShaderSource(std::string* source) const = 0;
virtual bool hasFragmentShader() const = 0;
virtual void clearFragmentShader() = 0;
virtual bool loadFragmentShader(const std::string& filePath) = 0;
virtual void setFragmentShaderSource(const std::string& source) = 0;
virtual bool getFragmentShaderSource(std::string* source) const = 0;
virtual void clear()
{
clearVertexShader();
clearGeometryShader();
clearFragmentShader();
}
virtual void setGlobalScope(bool val) = 0;
virtual bool isGlobalScope() const = 0;
};
inline Program::~Program()
{
}
}; // namespace Graphics
}; // namespace SurgSim
#endif // SURGSIM_GRAPHICS_PROGRAM_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
Accessible.h
SurgSim::Graphics::Program::clear
virtual void clear()
Clears the entire shader, returning to fixed-function pipeline.
Definition: Program.h:105
SurgSim::Graphics::Program
Base class that defines the interface for graphics programs.
Definition: Program.h:39