35 #include "../../Core/IOData/file_system.h"
36 #include "graphic_context.h"
44 class GraphicContextProvider;
45 class XMLResourceDocument;
46 class ShaderObject_Impl;
47 class ShaderObjectProvider;
220 std::shared_ptr<ShaderObject_Impl> impl;
ShaderObject(GraphicContext &gc, ShaderType type, const std::vector< std::string > &sources)
Constructs a ShaderObject.
@ shadertype_tess_control
Definition: shader_object.h:56
bool compile()
Compile program.
ShaderObject(GraphicContext &gc, ShaderType type, const std::string &source)
Constructs an OpenGL shader.
ShaderType get_shader_type() const
Gets the shader type.
@ shadertype_geometry
Definition: shader_object.h:53
static ShaderObject load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &resources)
Load.
@ shadertype_tess_evaluation
Definition: shader_object.h:55
@ shadertype_num_types
Definition: shader_object.h:58
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, IODevice &file)
Load and compile.
bool operator==(const ShaderObject &other) const
Handle comparison operator.
I/O Device interface.
Definition: iodevice.h:51
static ShaderObject load(GraphicContext &gc, ShaderType type, IODevice &file)
Load.
@ shadertype_vertex
Definition: shader_object.h:52
ShaderObject(GraphicContext &gc, ShaderType type, const void *source, int source_size)
Constructs a ShaderObject.
ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::string &source)
Constructs a ShaderObject.
void throw_if_null() const
Throw an exception if this object is invalid.
static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs)
Load.
ShaderObjectProvider * get_provider() const
Get Provider.
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename)
Load and compile.
static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &fullname)
Load.
ShaderType
Shader Type.
Definition: shader_object.h:51
Interface to drawing graphics.
Definition: graphic_context.h:258
ShaderObject()
Constructs a null instance.
@ shadertype_fragment
Definition: shader_object.h:54
Virtual File System (VFS).
Definition: file_system.h:48
XML Resource Document.
Definition: xml_resource_document.h:49
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs)
Load and compile.
std::string get_info_log() const
Get shader object's info log.
Interface for implementing a GraphicContext target.
Definition: graphic_context_provider.h:87
@ shadertype_compute
Definition: shader_object.h:57
bool is_null() const
Returns true if this object is invalid.
Definition: shader_object.h:193
unsigned int get_handle() const
Returns the OpenGL shader handle.
Shader Object.
Definition: shader_object.h:69
std::string get_shader_source() const
Get shader source code.
ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::vector< std::string > &sources)
Constructs a ShaderObject.
Shader Object provider.
Definition: shader_object_provider.h:43