]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.cpp
Remove remaining deprecated things from the core classes
[libs/gl.git] / source / core / program.cpp
index 473d8a0b0d2c79e8a147e4b278e02ffbf303cb73..9ed1e634ff4e6c0f214d3dd9aaeebec941d8cb23 100644 (file)
@@ -22,7 +22,6 @@
 #include "misc.h"
 #include "program.h"
 #include "resources.h"
-#include "shader.h"
 #include "glsl/compiler.h"
 
 using namespace std;
@@ -35,30 +34,6 @@ Program::Program()
        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();
@@ -255,61 +230,6 @@ void Program::add_spirv_stages(const SpirVModule &mod, const map<string, int> &s
                        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())
@@ -678,15 +598,6 @@ bool Program::uniform_location_compare(const UniformInfo *uni1, const UniformInf
        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);
@@ -806,12 +717,6 @@ Program::Loader::Loader(Program &p, Collection &c):
        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()
@@ -827,29 +732,6 @@ void Program::Loader::module(const string &n)
        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;