DataType get_index_type() const { return index_type; }
GLenum get_gl_index_type() const { return gl_index_type; }
- DEPRECATED void set_data_type(DataType t) { set_index_type(t); }
- DEPRECATED DataType get_data_type() const { return index_type; }
-
Batch &append(unsigned);
Batch &append(const std::vector<unsigned> &);
bool can_append(PrimitiveType);
#include <msp/gl/extensions/arb_buffer_storage.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
#include <msp/gl/extensions/arb_map_buffer_range.h>
+#include <msp/gl/extensions/arb_vertex_buffer_object.h>
#include <msp/gl/extensions/khr_debug.h>
+#include <msp/gl/extensions/oes_mapbuffer.h>
#include <msp/strings/format.h>
#include "buffer.h"
-#include "deviceinfo.h"
#include "error.h"
-#include "misc.h"
-#include "vertexsetup.h"
using namespace std;
data(0);
}
-void Buffer::set_usage(BufferUsage)
-{
-}
-
void Buffer::data(const void *d)
{
if(size==0)
return sub_data(0, size, d);
if(ARB_direct_state_access)
- glNamedBufferData(id, size, d, STATIC_DRAW);
+ glNamedBufferData(id, size, d, GL_STATIC_DRAW);
else
{
bind_scratch();
- glBufferData(GL_ARRAY_BUFFER, size, d, STATIC_DRAW);
+ glBufferData(GL_ARRAY_BUFFER, size, d, GL_STATIC_DRAW);
}
allocated = true;
}
-void Buffer::data(unsigned sz, const void *d)
-{
- if(size==0)
- storage(sz);
- else if(sz!=size)
- throw incompatible_data("Buffer::data");
-
- data(d);
-}
-
void Buffer::sub_data(unsigned off, unsigned sz, const void *d)
{
if(size==0)
#include <stdexcept>
#include <string>
#include <vector>
-#include <msp/core/attributes.h>
#include "gl.h"
-#include <msp/gl/extensions/arb_pixel_buffer_object.h>
-#include <msp/gl/extensions/arb_vertex_buffer_object.h>
-#include <msp/gl/extensions/arb_uniform_buffer_object.h>
-#include <msp/gl/extensions/oes_mapbuffer.h>
namespace Msp {
namespace GL {
virtual ~buffer_too_small() throw() { }
};
-enum BufferUsage
-{
- STREAM_DRAW = GL_STREAM_DRAW,
- STREAM_READ = GL_STREAM_READ,
- STREAM_COPY = GL_STREAM_COPY,
- STATIC_DRAW = GL_STATIC_DRAW,
- STATIC_READ = GL_STATIC_READ,
- STATIC_COPY = GL_STATIC_COPY,
- DYNAMIC_DRAW = GL_DYNAMIC_DRAW,
- DYNAMIC_READ = GL_DYNAMIC_READ,
- DYNAMIC_COPY = GL_DYNAMIC_COPY
-};
-
-enum BufferAccess
-{
- READ_ONLY = GL_READ_ONLY,
- WRITE_ONLY = GL_WRITE_ONLY,
- READ_WRITE = GL_READ_WRITE
-};
-
class BufferRange;
/**
*/
class Buffer
{
- friend class BufferRange;
-
private:
unsigned id;
unsigned size;
If storage has already been allocated, does nothing. */
void allocate();
- /** Sets the usage hint of the buffer. It will take effect the next time
- the buffer's contents are defined. */
- DEPRECATED void set_usage(BufferUsage);
-
/** Uploads data into the buffer, completely replacing any previous
contents. Storage must be defined beforehand. The data must have size
matching the defined storage. */
void data(const void *);
- DEPRECATED void data(unsigned, const void *);
-
/** Overwrites part of the buffer data with new data. Storage must be
defined beforehand. */
void sub_data(unsigned, unsigned, const void *);
void require_size(unsigned) const;
void *map();
- DEPRECATED void *map(BufferAccess) { return map(); }
bool unmap();
void set_debug_name(const std::string &);
namespace Msp {
namespace GL {
-unsigned Clipping::get_n_attach_points()
-{
- return Limits::get_global().max_clip_planes;
-}
-
void Clipping::attach(const ClipPlane &p)
{
if(find_member(planes, &p, &AttachedPlane::plane)!=planes.end())
planes.erase(i);
}
-void Clipping::detach(unsigned i)
-{
- if(i<planes.size())
- detach(*planes[i].plane);
-}
-
const ProgramData &Clipping::get_shader_data() const
{
for(unsigned i=0; i<planes.size(); ++i)
#define MSP_GL_CLIPPING_H_
#include <vector>
-#include <msp/core/attributes.h>
#include "programdata.h"
namespace Msp {
mutable ProgramData shdata;
public:
- DEPRECATED static unsigned get_n_attach_points();
-
void attach(const ClipPlane &);
void detach(const ClipPlane &);
unsigned get_n_planes() const { return planes.size(); }
- DEPRECATED void attach(unsigned, const ClipPlane &p) { attach(p); }
- DEPRECATED void detach(unsigned);
-
const ProgramData &get_shader_data() const;
};
#include "pipelinestate.h"
#include "program.h"
#include "rect.h"
+#include "sampler.h"
#include "stenciltest.h"
#include "texture.h"
#include "uniformblock.h"
+#include <msp/gl/extensions/arb_depth_buffer_float.h>
+#include <msp/gl/extensions/arb_depth_texture.h>
#include <msp/gl/extensions/arb_texture_float.h>
+#include <msp/gl/extensions/arb_texture_rg.h>
+#include <msp/gl/extensions/ext_texture_srgb.h>
+#include <msp/gl/extensions/oes_required_internalformat.h>
+#include <msp/gl/extensions/oes_texture_stencil8.h>
#include <msp/io/print.h>
#include <msp/strings/format.h>
#include "pixelformat.h"
else if(conv.get()=="DEPTH_COMPONENT32F")
fmt = DEPTH_COMPONENT32F;
else
- {
- if(conv.get()=="SRGB")
- fmt = SRGB8;
- else if(conv.get()=="SRGB_ALPHA")
- fmt = SRGB8_ALPHA8;
- else
- {
- PixelComponents comp;
- conv >> comp;
- fmt = make_pixelformat(comp, (comp==DEPTH_COMPONENT ? FLOAT : UNSIGNED_BYTE));
- }
- IO::print(IO::cerr, "Warning: deprecated conversion of '%s' to PixelFormat\n", conv.get());
- }
+ throw lexical_error(format("conversion of '%s' to PixelFormat", conv.get()));
}
PixelComponents components_from_graphics(Graphics::PixelFormat pf)
#ifndef MSP_GL_PIXELFORMAT_H_
#define MSP_GL_PIXELFORMAT_H_
-#include <msp/core/attributes.h>
#include <msp/graphics/image.h>
#include <msp/strings/lexicalcast.h>
#include "gl.h"
-#include <msp/gl/extensions/arb_depth_buffer_float.h>
-#include <msp/gl/extensions/arb_depth_texture.h>
-#include <msp/gl/extensions/arb_texture_float.h>
-#include <msp/gl/extensions/arb_texture_rg.h>
-#include <msp/gl/extensions/ext_bgra.h>
-#include <msp/gl/extensions/ext_texture_srgb.h>
-#include <msp/gl/extensions/oes_required_internalformat.h>
-#include <msp/gl/extensions/oes_texture_stencil8.h>
-#include <msp/gl/extensions/msp_luminance_formats.h>
#include "datatype.h"
namespace Msp {
#include "misc.h"
#include "program.h"
#include "resources.h"
-#include "shader.h"
#include "glsl/compiler.h"
using namespace std;
init();
}
-Program::Program(const string &source)
-{
- init();
-
- GlslModule mod;
- mod.set_source(source);
- add_stages(mod);
-
- link();
- module = 0;
-}
-
-Program::Program(const string &vert, const string &frag)
-{
- init();
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- attach_shader_owned(new VertexShader(vert));
- attach_shader_owned(new FragmentShader(frag));
-#pragma GCC diagnostic pop
- link();
-}
-
Program::Program(const Module &mod, const map<string, int> &spec_values)
{
init();
glSpecializeShader(stage_ids[i], j->name.c_str(), spec_id_array.size(), &spec_id_array[0], &spec_value_array[0]);
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Program::attach_shader(Shader &shader)
-{
- unsigned shader_id = shader.steal_id();
- if(!shader_id)
- throw invalid_argument("Program::attach_shader");
-
- int type;
- glGetShaderiv(shader_id, GL_SHADER_TYPE, &type);
- switch(type)
- {
- case GL_VERTEX_SHADER: stage_ids[VERTEX] = shader_id; break;
- case GL_GEOMETRY_SHADER: stage_ids[GEOMETRY] = shader_id; break;
- case GL_FRAGMENT_SHADER: stage_ids[FRAGMENT] = shader_id; break;
- }
-
- glAttachShader(id, shader_id);
- compile_glsl_stage(shader_id);
-}
-
-void Program::attach_shader_owned(Shader *shader)
-{
- attach_shader(*shader);
- delete shader;
-}
-
-void Program::detach_shader(Shader &)
-{
-}
-
-const vector<Shader *> &Program::get_attached_shaders() const
-{
- static vector<Shader *> dummy;
- return dummy;
-}
-
-void Program::bind_attribute(unsigned index, const string &name)
-{
- static Require _req(ARB_vertex_shader);
- glBindAttribLocation(id, index, name.c_str());
-}
-
-void Program::bind_attribute(VertexAttribute attr, const string &name)
-{
- bind_attribute(get_attribute_semantic(attr), name);
-}
-
-void Program::bind_fragment_data(unsigned index, const string &name)
-{
- static Require _req(EXT_gpu_shader4);
- glBindFragDataLocation(id, index, name.c_str());
-}
-#pragma GCC diagnostic pop
-
void Program::link()
{
if(!has_stages())
return uni1->location<uni2->location;
}
-string Program::get_info_log() const
-{
- GLsizei len = get_program_i(id, GL_INFO_LOG_LENGTH);
- string log(len+1, 0);
- glGetProgramInfoLog(id, len+1, &len, &log[0]);
- log.erase(len);
- return log;
-}
-
const Program::UniformBlockInfo &Program::get_uniform_block_info(const string &name) const
{
auto i = find_member(uniform_blocks, name, &UniformBlockInfo::name);
DataFile::CollectionObjectLoader<Program>(p, &c)
{
add("module", &Loader::module);
-
- // Deprecated
- add("attribute", &Loader::attribute);
- add("fragment_shader", &Loader::fragment_shader);
- add("geometry_shader", &Loader::geometry_shader);
- add("vertex_shader", &Loader::vertex_shader);
}
void Program::Loader::finish()
obj.add_stages(get_collection().get<Module>(n), spec_values);
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void Program::Loader::attribute(unsigned i, const string &n)
-{
- obj.bind_attribute(i, n);
-}
-
-void Program::Loader::fragment_shader(const string &src)
-{
- obj.attach_shader_owned(new FragmentShader(src));
-}
-
-void Program::Loader::geometry_shader(const string &src)
-{
- obj.attach_shader_owned(new GeometryShader(src));
-}
-
-void Program::Loader::vertex_shader(const string &src)
-{
- obj.attach_shader_owned(new VertexShader(src));
-}
-#pragma GCC diagnostic pop
-
DataFile::Loader::ActionMap Program::SpecializationLoader::shared_actions;
namespace Msp {
namespace GL {
-class Shader;
-
/**
A complete shader program. Programs can be assembled of individual Shaders or
generated with a set of standard features.
private:
virtual void finish();
- void attribute(unsigned, const std::string &);
- void fragment_shader(const std::string &);
- void geometry_shader(const std::string &);
void module(const std::string &);
- void vertex_shader(const std::string &);
};
private:
/// Constructs an empty Program with no shader stages attached.
Program();
- /// Constructs a Program from unified source code using ProgramCompiler.
- DEPRECATED Program(const std::string &);
-
- /// Constructs a Program from vertex and fragment shader source code.
- DEPRECATED Program(const std::string &, const std::string &);
-
/// Constructs a Program from a Module, with specialization constants.
Program(const Module &, const std::map<std::string, int> & = std::map<std::string, int>());
void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
public:
- DEPRECATED void attach_shader(Shader &shader);
- DEPRECATED void attach_shader_owned(Shader *shader);
- DEPRECATED void detach_shader(Shader &shader);
- DEPRECATED const std::vector<Shader *> &get_attached_shaders() const;
-
- DEPRECATED void bind_attribute(unsigned, const std::string &);
- DEPRECATED void bind_attribute(VertexAttribute, const std::string &);
- DEPRECATED void bind_fragment_data(unsigned, const std::string &);
-
void link();
private:
void query_uniforms();
static bool uniform_location_compare(const UniformInfo *, const UniformInfo *);
public:
bool is_linked() const { return linked; }
- DEPRECATED std::string get_info_log() const;
LayoutHash get_uniform_layout_hash() const { return uniform_layout_hash; }
const std::vector<UniformBlockInfo> &get_uniform_blocks() const { return uniform_blocks; }
MIRRORED_REPEAT = GL_MIRRORED_REPEAT
};
-class Texture;
-
/**
Samplers are used to access texture data in shaders. To use a sampler with a
private:
void update() const;
- void set_parameter_i(unsigned, int) const;
- void set_parameter_f(unsigned, float) const;
- void set_parameter_fv(unsigned, const float *) const;
public:
void set_min_filter(TextureFilter);
+++ /dev/null
-#include <msp/gl/extensions/arb_fragment_shader.h>
-#include <msp/gl/extensions/arb_geometry_shader4.h>
-#include <msp/gl/extensions/arb_shader_objects.h>
-#include <msp/gl/extensions/arb_vertex_shader.h>
-#include <msp/io/print.h>
-#include "error.h"
-#include "misc.h"
-#include "shader.h"
-
-using namespace std;
-
-namespace Msp {
-namespace GL {
-
-Shader::Shader(GLenum t)
-{
- init(t);
-}
-
-Shader::Shader(GLenum t, const string &src)
-{
- init(t);
-
- source(src);
- compile();
-}
-
-void Shader::init(GLenum t)
-{
- static Require _req_base(ARB_shader_objects);
- compiled = false;
-
- if(t==GL_FRAGMENT_SHADER)
- static Require _req(ARB_fragment_shader);
- else if(t==GL_VERTEX_SHADER)
- static Require _req(ARB_vertex_shader);
- else if(t==GL_GEOMETRY_SHADER)
- static Require _req(ARB_geometry_shader4);
-
- id = glCreateShader(t);
-}
-
-Shader::~Shader()
-{
- if(id)
- glDeleteShader(id);
-}
-
-void Shader::source(unsigned count, const char **str, const int *len)
-{
- glShaderSource(id, count, str, len);
-}
-
-void Shader::source(const string &str)
-{
- source(str.data(), str.size());
-}
-
-void Shader::source(const char *str, int len)
-{
- source(1, &str, &len);
-}
-
-void Shader::compile()
-{
- glCompileShader(id);
- compiled = get_shader_i(id, GL_COMPILE_STATUS);
- if(!compiled)
- throw compile_error(get_info_log());
-
-#ifdef DEBUG
- string info_log = get_info_log();
- if(!info_log.empty())
- IO::print("Shader compile info log:\n%s", info_log);
-#endif
-}
-
-unsigned Shader::steal_id()
-{
- unsigned result = id;
- id = 0;
- return result;
-}
-
-string Shader::get_info_log() const
-{
- GLsizei len = get_shader_i(id, GL_INFO_LOG_LENGTH);
- string log(len+1, 0);
- glGetShaderInfoLog(id, len+1, &len, &log[0]);
- log.erase(len);
- return log;
-}
-
-
-VertexShader::VertexShader():
- Shader(GL_VERTEX_SHADER)
-{ }
-
-VertexShader::VertexShader(const string &src):
- Shader(GL_VERTEX_SHADER, src)
-{ }
-
-
-FragmentShader::FragmentShader():
- Shader(GL_FRAGMENT_SHADER)
-{ }
-
-FragmentShader::FragmentShader(const string &src):
- Shader(GL_FRAGMENT_SHADER, src)
-{ }
-
-
-GeometryShader::GeometryShader():
- Shader(GL_GEOMETRY_SHADER)
-{ }
-
-GeometryShader::GeometryShader(const string &src):
- Shader(GL_GEOMETRY_SHADER, src)
-{ }
-
-} // namespace GL
-} // namespace Msp
+++ /dev/null
-#ifndef MSP_GL_SHADER_H_
-#define MSP_GL_SHADER_H_
-
-#include <msp/core/attributes.h>
-#include <string>
-#include "gl.h"
-
-namespace Msp {
-namespace GL {
-
-/**
-A single shader stage. Shaders must be attached to a Program to be used.
-
-This class can't be instantiated directly. Use one of the VertexShader and
-FragmentShader classes to create Shaders.
-*/
-class Shader
-{
-private:
- unsigned id;
- bool compiled;
-
-protected:
- Shader(GLenum t);
- Shader(GLenum t, const std::string &);
-private:
- void init(GLenum);
-public:
- virtual ~Shader();
-
- void source(unsigned count, const char **str, const int *len);
- void source(const std::string &str);
- void source(const char *str, int len);
- void compile();
- unsigned get_id() const { return id; }
- unsigned steal_id();
- bool is_compiled() const { return compiled; }
- std::string get_info_log() const;
-} DEPRECATED;
-
-
-class VertexShader: public Shader
-{
-public:
- VertexShader();
- VertexShader(const std::string &);
-};
-
-
-class FragmentShader: public Shader
-{
-public:
- FragmentShader();
- FragmentShader(const std::string &);
-};
-
-
-class GeometryShader: public Shader
-{
-public:
- GeometryShader();
- GeometryShader(const std::string &);
-};
-
-} // namespace GL
-} // namespace Msp
-
-#endif
}
}
-void Texture::load_image(const string &fn, bool)
-{
- load_image(fn, 0U);
-}
-
void Texture::load_image(const string &fn, unsigned lv)
{
Graphics::Image img;
image(img, lv);
}
-void Texture::image(const Graphics::Image &img, bool)
-{
- image(img, 0U);
-}
-
void Texture::set_debug_name(const string &name)
{
#ifdef DEBUG
#ifndef MSP_GL_TEXTURE_H_
#define MSP_GL_TEXTURE_H_
-#include <msp/core/attributes.h>
#include <msp/datafile/objectloader.h>
#include <msp/graphics/image.h>
-#include "datatype.h"
#include "gl.h"
#include "pixelformat.h"
-#include "predicate.h"
-#include "sampler.h"
#include "resource.h"
namespace Msp {
/// Loads a Graphics::Image from a file and uploads it to the texture.
virtual void load_image(const std::string &, unsigned = 0);
- DEPRECATED void load_image(const std::string &, bool srgb);
-
/** Uploads an image to the texture. If storage has not been defined, it
will be set to match the image. Otherwise the image must be compatible
with the defined storage. Semantics depend on the type of texture. */
virtual void image(const Graphics::Image &, unsigned = 0) = 0;
- DEPRECATED void image(const Graphics::Image &, bool srgb);
-
GLenum get_target() const { return target; }
unsigned get_id() const { return id; }
-#include <msp/core/raii.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
#include <msp/gl/extensions/arb_texture_storage.h>
#include <msp/gl/extensions/msp_texture1d.h>
allocated |= 1<<level;
}
-void Texture1D::image(unsigned level, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture1D::image");
- image(level, data);
-}
-
void Texture1D::sub_image(unsigned level, int x, unsigned wd, const void *data)
{
if(width==0)
}
}
-void Texture1D::sub_image(unsigned level, int x, unsigned wd, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture1D::sub_image");
- sub_image(level, x, wd, data);
-}
-
void Texture1D::image(const Graphics::Image &img, unsigned lv)
{
if(img.get_height()!=1)
void storage(PixelFormat, unsigned, unsigned = 0);
- DEPRECATED void storage(PixelComponents c, unsigned w, unsigned l = 0)
- { storage(make_pixelformat(c, UNSIGNED_BYTE), w, l); }
-
void allocate(unsigned);
void image(unsigned, const void *);
- DEPRECATED void image(unsigned, PixelComponents, DataType, const void *);
void sub_image(unsigned, int, unsigned, const void *);
- DEPRECATED void sub_image(unsigned, int, unsigned, PixelComponents, DataType, const void *);
virtual void image(const Graphics::Image &, unsigned = 0);
using Texture::image;
unsigned get_width() const { return width; }
-#include <msp/core/raii.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
#include <msp/gl/extensions/arb_texture_storage.h>
+#include <msp/gl/extensions/arb_vertex_buffer_object.h>
#include <msp/graphics/imageloader.h>
#include "buffer.h"
#include "error.h"
allocated |= 1<<level;
}
-void Texture2D::image(unsigned level, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture2D::image");
- image(level, data);
-}
-
void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht, const void *data)
{
if(width==0 || height==0)
}
}
-void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture2D::sub_image");
- sub_image(level, x, y, wd, ht, data);
-}
-
void Texture2D::image(const Graphics::Image &img, unsigned lv)
{
image(img, lv, false);
it can't be changed. */
void storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned lv = 0);
- DEPRECATED void storage(PixelComponents cm, unsigned wd, unsigned ht, unsigned lv = 0)
- { storage(make_pixelformat(cm, UNSIGNED_BYTE), wd, ht, lv); }
-
/** Allocates storage for the texture. The contents are initially
undefined. If storage has already been allocated, does nothing. */
void allocate(unsigned level);
defined storage. */
virtual void image(unsigned level, const void *data);
- DEPRECATED void image(unsigned level, PixelComponents fmt, DataType type, const void *data);
-
/** Updates a rectangular region of the texture. Storage must be defined
beforehand. The image data must be in a format mathing the defined storage
and the update region must be fully inside the texture. */
void sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht, const void *data);
- DEPRECATED void sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht,
- PixelComponents fmt, DataType type, const void *data);
-
/** Updates the contents of the entire texture from an image. If storage
has not been defined, it will be set to match the image. Otherwise the
image must match the defined storage. */
sub_image(level, 0, 0, z, size.x, size.y, 1, data);
}
-void Texture2DArray::layer_image(unsigned level, unsigned z, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture2DArray::layer_image");
- layer_image(level, z, data);
-}
-
void Texture2DArray::layer_image(unsigned level, unsigned z, const Graphics::Image &img)
{
if(!get_width())
Texture2DArray();
void layer_image(unsigned, unsigned, const void *);
- DEPRECATED void layer_image(unsigned, unsigned, PixelComponents, DataType, const void *);
void layer_image(unsigned, unsigned, const Graphics::Image &);
unsigned get_layers() const { return get_depth(); }
#include <cmath>
-#include <msp/core/raii.h>
#include <msp/gl/extensions/arb_direct_state_access.h>
#include <msp/gl/extensions/arb_texture_storage.h>
#include <msp/gl/extensions/ext_texture3d.h>
allocated |= 1<<level;
}
-void Texture3D::image(unsigned level, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture3D::image");
- image(level, data);
-}
-
void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data)
{
if(width==0 || height==0 || depth==0)
}
}
-void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("Texture3D::sub_image");
- sub_image(level, x, y, z, wd, ht, dp, data);
-}
-
void Texture3D::image(const Graphics::Image &img, unsigned lv)
{
unsigned w = img.get_width();
it can't be changed. */
void storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned dp, unsigned lv = 0);
- DEPRECATED void storage(PixelComponents c, unsigned w, unsigned h, unsigned d, unsigned l = 0)
- { storage(make_pixelformat(c, UNSIGNED_BYTE), w, h, d, l); }
-
/** Allocates storage for the texture. The contents are initially
undefined. If storage has already been allocated, does nothing. */
void allocate(unsigned level);
defined storage. */
void image(unsigned level, const void *data);
- DEPRECATED void image(unsigned level, PixelComponents comp, DataType type, const void *data);
-
/** Updates a cuboid-shaped region of the texture. Storage must be defined
beforehand. The image data must be in a format mathing the defined storage
and the update region must be fully inside the texture. */
void sub_image(unsigned level, int x, int y, int z, unsigned wd, unsigned ht, unsigned dp, const void *data);
- DEPRECATED void sub_image(unsigned level,
- int x, int y, int z, unsigned wd, unsigned ht, unsigned dp,
- PixelComponents comp, DataType type, const void *data);
-
/** Updates the contents of the entire texture from an image. If storage
has not been defined, it will be set to match the image. In this case the
image will be treated as a stack of square layers and its height must be
}
}
-void TextureCube::image(TextureCubeFace face, unsigned level, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("TextureCube::image");
- image(face, level, data);
-}
-
void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned wd, unsigned ht, const void *data)
{
if(size==0)
}
}
-void TextureCube::sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned wd, unsigned ht, PixelComponents comp, DataType type, const void *data)
-{
- if(comp!=get_components(format) || type!=get_component_type(format))
- throw incompatible_data("TextureCube::subimage");
- sub_image(face, level, x, y, wd, ht, data);
-}
-
void TextureCube::image(TextureCubeFace face, const Graphics::Image &img)
{
unsigned w = img.get_width();
image(face, 0, img.get_pixels());
}
-void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool)
-{
- image(face, img);
-}
-
void TextureCube::image(const Graphics::Image &img, unsigned lv)
{
unsigned w = img.get_width();
it can't be changed. */
void storage(PixelFormat fmt, unsigned size, unsigned lv = 0);
- DEPRECATED void storage(PixelComponents c, unsigned s, unsigned l = 0)
- { storage(make_pixelformat(c, UNSIGNED_BYTE), s, l); }
-
/** Allocates storage for the cube faces. The contents are initially
undefined. If storage has already been allocated, does nothing. */
void allocate(unsigned level);
storage. */
void image(TextureCubeFace face, unsigned level, const void *data);
- DEPRECATED void image(TextureCubeFace face, unsigned level,
- PixelComponents comp, DataType type, const void *data);
-
/** Updates a rectangular region of a face. Storage must be defined
beforehand. The image data must be in a format mathing the defined storage
and the update region must be fully inside the face. */
void sub_image(TextureCubeFace face, unsigned level, int x, int y, unsigned w, unsigned h, const void *data);
- DEPRECATED void sub_image(TextureCubeFace face, unsigned level,
- int x, int y, unsigned w, unsigned h,
- PixelComponents comp, DataType type, const void *data);
-
void image(TextureCubeFace, const Graphics::Image &);
- DEPRECATED void image(TextureCubeFace, const Graphics::Image &, bool);
-
virtual void image(const Graphics::Image &, unsigned = 0);
using Texture::image;
#include "camera.h"
#include "renderer.h"
#include "resources.h"
-#include "shader.h"
using namespace std;
#include "misc.h"
#include "renderer.h"
#include "resources.h"
-#include "shader.h"
using namespace std;
#include "mesh.h"
#include "renderer.h"
#include "resources.h"
-#include "shader.h"
#include "texture2d.h"
using namespace std;
#include "meshbuilder.h"
#include "postprocessor.h"
#include "sampler.h"
-#include "shader.h"
namespace Msp {
namespace GL {
class Mesh;
class Renderer;
class Sampler;
-class Shader;
class Texture2D;
/**
namespace Msp {
namespace GL {
+class Sampler;
+
class Material
{
private: