34#include "../../Core/IOData/file_system.h"
35#include "graphic_context.h"
45 class ShaderObject_Impl;
185 explicit operator bool()
const {
return bool(impl); }
203 std::shared_ptr<ShaderObject_Impl> impl;
Virtual File System (VFS).
Definition file_system.h:47
Interface for implementing a GraphicContext target.
Definition graphic_context_provider.h:86
Interface to drawing graphics.
Definition graphic_context.h:257
I/O Device interface.
Definition iodevice.h:50
Shader Object provider.
Definition shader_object_provider.h:42
void throw_if_null() const
Throw an exception if this object is invalid.
bool compile()
Compile program.
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs)
Load and compile.
ShaderObject()
Constructs a null instance.
static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &fullname)
Load.
std::string get_shader_source() const
Get shader source code.
ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::string &source)
Constructs a ShaderObject.
unsigned int get_handle() const
Returns the OpenGL shader handle.
static ShaderObject load(GraphicContext &gc, ShaderType type, const std::string &filename, const FileSystem &fs)
Load.
ShaderObject(GraphicContext &gc, ShaderType type, const std::string &source)
Constructs an OpenGL shader.
bool operator==(const ShaderObject &other) const
Handle comparison operator.
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, const std::string &filename)
Load and compile.
std::string get_info_log() const
Get shader object's info log.
static ShaderObject load(GraphicContext &gc, ShaderType type, IODevice &file)
Load.
static ShaderObject load(GraphicContext &gc, const std::string &resource_id, const XMLResourceDocument &resources)
Load.
ShaderObject(GraphicContext &gc, ShaderType type, const std::vector< std::string > &sources)
Constructs a ShaderObject.
ShaderObjectProvider * get_provider() const
Get Provider.
ShaderObject(GraphicContext &gc, ShaderType type, const void *source, int source_size)
Constructs a ShaderObject.
bool is_null() const
Returns true if this object is invalid.
Definition shader_object.h:184
ShaderType get_shader_type() const
Gets the shader type.
ShaderObject(GraphicContextProvider *gc_provider, ShaderType type, const std::vector< std::string > &sources)
Constructs a ShaderObject.
static ShaderObject load_and_compile(GraphicContext &gc, ShaderType type, IODevice &file)
Load and compile.
XML Resource Document.
Definition xml_resource_document.h:48
ShaderType
Shader Type.
Definition shader_object.h:50
@ fragment
Definition shader_object.h:53
@ vertex
Definition shader_object.h:51
@ tess_evaluation
Definition shader_object.h:54
@ compute
Definition shader_object.h:56
@ tess_control
Definition shader_object.h:55
@ num_types
Definition shader_object.h:57
@ geometry
Definition shader_object.h:52