Mark remaining ones as deprecated with a compiler attribute.
shdata.uniform("occlusion_radius", r);
}
-void AmbientOcclusion::set_depth_ratio(float)
-{
-}
-
void AmbientOcclusion::set_darkness(float darkness)
{
shdata.uniform("darkness", darkness);
void set_occlusion_radius(float);
void set_edge_depth_threshold(float);
- // Deprecated
- void set_depth_ratio(float);
-
void set_darkness(float);
virtual void render(Renderer &, const Texture2D &, const Texture2D &);
#define MSP_GL_ANIMATEDOBJECT_H_
#include <vector>
+#include <msp/core/attributes.h>
#include <msp/datafile/objectloader.h>
#include "keyframe.h"
#include "matrix.h"
ProgramData &get_shader_data();
const ProgramData &get_shader_data() const;
- // Deprecated
- void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);
+ DEPRECATED void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);
virtual const Matrix *get_matrix() const { return &matrix; }
float get_far_clip() const { return clip_far; }
const Geometry::Angle<float> &get_frustum_rotation() const { return rotate; }
- // Deprecated, use set/get_aspect_ratio instead
- void set_aspect(float a) { set_aspect_ratio(a); }
- float get_aspect() const { return get_aspect_ratio(); }
-
void set_position(const Vector3 &);
void set_look_direction(const Vector3 &);
void look_at(const Vector3 &);
shdata.uniform("brightness_response", b, t, pow(t, b));
}
-void ColorCurve::set_peak(float)
-{
-}
-
-void ColorCurve::set_brightness(float b)
-{
- set_brightness_response(1/b);
-}
-
void ColorCurve::set_gamma(float g)
{
if(g<0.1 || g>10)
/** Sets the exponent of the */
void set_brightness_response(float);
- // Deprecated functions
- void set_peak(float);
- void set_brightness(float);
-
/** Sets the gamma value used for mapping output colors. Allowed range is
from 0.1 to 10. */
void set_gamma(float);
spot_exp = e;
}
-void Light::set_spot_cutoff(float c)
-{
- set_spot_cutoff(Geometry::Angle<float>::from_degrees(c));
-}
-
void Light::set_spot_cutoff(const Geometry::Angle<float> &c)
{
if(c<Geometry::Angle<float>::zero() || (c>Geometry::Angle<float>::right() && c!=Geometry::Angle<float>::straight()))
/** Sets the angular falloff exponent of the spotlight. Must be >= 0. */
void set_spot_exponent(float);
- /// Deprecated.
- void set_spot_cutoff(float);
-
/** Sets the cutoff angle of a spotlight. Beyond this angle from its axis
the spotlight provides no illumination. Must be between 0 and 90 degrees,
or exactly 180 degrees to indicate a non-spotlight. */
void Lighting::Loader::zenith_direction(float x, float y, float z)
{
- obj.set_sky_direction(Vector3(x, y, z));
+ obj.set_zenith_direction(Vector3(x, y, z));
}
} // namespace GL
effect without shaders. */
void set_zenith_direction(const Vector3 &);
- /// Deprecated alias for set_zenith_direction
- void set_sky_direction(const Vector3 &d) { set_zenith_direction(d); }
-
/** Sets the angle where skylight cuts off, counted from the true horizon.
Has no effect without shaders. */
void set_horizon_angle(const Geometry::Angle<float> &);
{
if(lods[0].mesh && lod0_watched)
if(ResourceManager *rm = lods[0].mesh->get_manager())
- rm->unwatch_resource(*lods[0].mesh, *this);
+ rm->unobserve_resource(*lods[0].mesh, *this);
}
Object::LevelOfDetail &Object::get_lod(unsigned i, const char *caller)
RefPtr<const Mesh> &ptr = get_lod(i, "Object::set_mesh").mesh;
if(i==0 && ptr && lod0_watched)
if(ResourceManager *rm = ptr->get_manager())
- rm->unwatch_resource(*ptr, *this);
+ rm->unobserve_resource(*ptr, *this);
ptr = m;
ptr.keep();
lod0_watched = false;
if(i==0 && m)
if(ResourceManager *rm = m->get_manager())
{
- rm->watch_resource(*m, *this);
+ rm->observe_resource(*m, *this);
lod0_watched = true;
}
}
}
-void Pipeline::set_camera(const Camera *c)
-{
- camera = c;
-}
-
-Pipeline::Pass &Pipeline::add_pass(const Tag &tag)
-{
- passes.push_back(Pass(tag, 0));
- return passes.back();
-}
-
-void Pipeline::add_renderable(Renderable &r)
-{
- for(vector<Slot>::iterator i=renderables.begin(); i!=renderables.end(); ++i)
- if(i->renderable==&r)
- {
- i->passes.clear();
- return;
- }
-
- renderables.push_back(&r);
-}
-
-void Pipeline::add_renderable_for_pass(Renderable &r, const Tag &tag)
-{
- for(vector<Slot>::iterator i=renderables.begin(); i!=renderables.end(); ++i)
- if(i->renderable==&r)
- {
- i->passes.insert(tag);
- return;
- }
-
- renderables.push_back(&r);
- renderables.back().passes.insert(tag);
-}
-
-void Pipeline::remove_renderable(Renderable &r)
-{
- for(vector<Slot>::iterator i=renderables.begin(); i!=renderables.end(); ++i)
- if(i->renderable==&r)
- {
- renderables.erase(i);
- return;
- }
-}
-
Pipeline::Pass &Pipeline::add_pass(const Tag &tag, Renderable &r)
{
passes.push_back(Pass(tag, &r));
bool get_hdr() const { return hdr; }
unsigned get_multisample() const { return samples; }
- // Deprecated
- void set_camera(const Camera *);
- Pass &add_pass(const Tag &tag);
- void add_renderable(Renderable &);
- void add_renderable_for_pass(Renderable &, const Tag &);
- void remove_renderable(Renderable &);
-
/** Adds a pass to the pipeline. It's permissible to add the same
Renderable multiple times. */
Pass &add_pass(const Tag &, Renderable &);
#include "postprocessor.h"
#include "shader.h"
-namespace {
-
-const char fullscreen_vs_source[] =
- "attribute vec4 vertex;\n"
- "varying vec2 texcoord;\n"
- "void main()\n"
- "{\n"
- " gl_Position = vertex;\n"
- " texcoord = vertex.xy*0.5+0.5;\n"
- "}\n";
-
-}
-
-
namespace Msp {
namespace GL {
render(color, depth);
}
-Shader &PostProcessor::get_fullscreen_vertex_shader()
-{
- static VertexShader shader(fullscreen_vs_source);
- return shader;
-}
-
const Mesh &PostProcessor::get_fullscreen_quad()
{
static const Mesh &mesh = create_fullscreen_quad();
virtual void render(Renderer &, const Texture2D &, const Texture2D &);
protected:
- /** Returns a vertex shader suitable for rendering a full-screen quad.
- Input vertices are assumed to be in normalized device coordinates; no
- transform is performed. The shader provides a varying vec2 texcoord for
- a fragment shader to access textures.
-
- Deprecated in favor of the builtin postprocess.glsl module. */
- static Shader &get_fullscreen_vertex_shader();
-
/** Returns a mesh consisting of a single quad, covering the entire screen.
The vertices are in normalized device coordinates. */
static const Mesh &get_fullscreen_quad();
end();
}
-void Renderer::begin(const Camera *c)
-{
- end();
- if(c)
- set_camera(*c);
-}
-
void Renderer::set_camera(const Camera &c)
{
state->camera = &c;
Renderer(const Camera *);
~Renderer();
- /** Resets all internal state and restarts rendering. There must be no
- unpopped state in the stack. It is permissible to call begin() multiple
- times without an intervening end().
-
- Deprecated; use end() and set_camera() instead.*/
- void begin(const Camera *);
-
/** Sets the camera to render from. The modelview matrix is reset to the
camera's view matrix. */
void set_camera(const Camera &);
void observe_resource(const Resource &, ResourceObserver &);
void unobserve_resource(const Resource &, ResourceObserver &);
- // Deprecated names
- void watch_resource(const Resource &r, ResourceObserver &o) { observe_resource(r, o); }
- void unwatch_resource(const Resource &r, ResourceObserver &o) { unobserve_resource(r, o); }
-
void tick();
private:
void dispatch_work();
+++ /dev/null
-#ifndef MSP_GL_RESOURCEWATCHER_H_
-#define MSP_GL_RESOURCEWATCHER_H_
-
-#include "resourceobserver.h"
-
-namespace Msp {
-namespace GL {
-
-// Deprecated name
-typedef ResourceObserver ResourceWatcher;
-
-} // namespace GL
-} // namespace Msp
-
-#endif
#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"
void set_auto_generate_mipmap(bool);
/// Deprecated. Use set_auto_generate_mipmap instead.
- void set_generate_mipmap(bool g) { set_auto_generate_mipmap(g); }
+ DEPRECATED void set_generate_mipmap(bool g) { set_auto_generate_mipmap(g); }
/** Sets depth texture comparison. Has no effect on other formats. When
comparison is enabled, the third component of the texture coordinate is
height times its depth.
Deprecated in favor of the base class version.*/
- void load_image(const std::string &fn, int dp = -1);
+ DEPRECATED void load_image(const std::string &fn, int dp = -1);
using Texture::load_image;
content = r;
}
-void View::synchronize_camera_aspect(Camera &c)
-{
- synced_cameras.push_back(&c);
- c.set_aspect_ratio(get_aspect_ratio());
-}
-
void View::render()
{
Bind bind_fbo(target);
Framebuffer ⌖
Camera *camera;
Renderable *content;
- std::list<Camera *> synced_cameras;
View(Framebuffer &);
void set_camera(Camera *);
void set_content(Renderable *);
- // Deprecated
- float get_aspect() const { return get_aspect_ratio(); }
- void synchronize_camera_aspect(Camera &);
-
virtual void render();
};
float aspect = static_cast<float>(w)/h;
if(camera)
camera->set_aspect_ratio(aspect);
- for(list<Camera *>::iterator i=synced_cameras.begin(); i!=synced_cameras.end(); ++i)
- (*i)->set_aspect_ratio(aspect);
}
} // namespace GL