pike.git / lib / modules / GL.pmod / GLSLUtils.pmod

version» Context lines:

pike.git/lib/modules/GL.pmod/GLSLUtils.pmod:297:    }       //! Create a new vertex buffer, draw_mode is a usage hint.    //!    //! GL_STREAM_DRAW: Draw multiple times, updating the data ocassionally    //! GL_STATIC_DRAW: Set the data once, then draw multiple times    //! GL_DYNAMIC_DRAW: Draw and update all the time    //!    //! The mode is only a hint, it does not really affect the    //! functionality of the buffer. -  void create(int draw_mode) +  protected void create(int draw_mode)    {    this->draw_mode = draw_mode;    [id] = glGenBuffers( 1 );    }   }      bool nvidia = true;   int last_vbo;      class GLSLProgram
pike.git/lib/modules/GL.pmod/GLSLUtils.pmod:491:    source_path = combine_path(f,file_name );    return compile_string( Stdio.read_file( combine_path(f,file_name ) ),file_name );    }    }    error("Could not find %O in %{%O %}\n", file_name, shader_path );    return -1;    }       //! Create a new GLSL shader. If @[name] is specified, it    //! indicates a filename passed to @[compile_file]. -  void create(string|void name) +  protected void create(string|void name)    {    if( name )    {    if( mixed error = catch(compile_file(name)) )    werror("While compiling %O:\n%s", name, describe_error(error));    }    }       //! Adds a texture to the list of textures used by the shader.    //! If this function is used the allocation of texture units is
pike.git/lib/modules/GL.pmod/GLSLUtils.pmod:818:    //! it has a size.    //!    //! If @[internal_format] and @[format] are specified they are used to    //! override the defaults (GL_RGB[A]16F_ARB and GL_RGB[A]    //! respectively)    //!    //! Setting these also makes the buffer ignore the @[alpha] paramenter.    //!    //! The @[mipmap] parameter depends on the existance of the    //! glGenerateMipmapEXT extension. -  void create(int w, int h, int type, bool depth, bool mipmap, bool alpha, +  protected void create(int w, int h, int type, bool depth, +  bool mipmap, bool alpha,    int|void internal_format, int|void format)    {    if( mipmap && type == GL_TEXTURE_RECTANGLE_ARB )    mipmap = false;    this->alpha = alpha;    this->mipmaps = mipmap;    this->texture_type = type;    this->internal_format = internal_format;    this->format = format;    [fbo]=glGenFramebuffersEXT(1);
pike.git/lib/modules/GL.pmod/GLSLUtils.pmod:907:    this_program dup() { return this_program(v); }    mixed ARG(mixed x )    {    if( objectp(x) )    {    if( x->v ) return x->v;    return x;    }    return x;    } -  this_program `*( this_program x ) { +  protected this_program `*( this_program x ) {    return this_program(v*ARG(x));    } -  this_program `+( this_program x ) { +  protected this_program `+( this_program x ) {    return this_program(v+ARG(x));    } -  this_program `-( this_program x ) { +  protected this_program `-( this_program x ) {    return this_program(v-ARG(x));    } -  this_program `/( this_program x ) { +  protected this_program `/( this_program x ) {    return this_program(v/ARG(x));    }       float dot( vec x )    {    return v->dot( x->v );    }       this_program cross( vec x )    {    return this_program(v->cross( x->v ));    }    -  this_program ``*( object x ) +  protected this_program ``*( object x )    {    if( x->v ) x = x->v;    return this_program( Math.Matrix(@column( (array)(x*v), 0 )) );    }       float length()    {    return v->norm();    }       this_program norm()    {    return this_program( v->normv() );    }    -  void create( Math.Matrix _v ) +  protected void create( Math.Matrix _v )    {    v = _v;    }    -  mixed `->( string x ) +  protected mixed `->( string x )    {    if( this[x] ) return this[x];    switch( x )    {    case "x": return ((array)v)[0][0];    case "y": return ((array)v)[0][1];    case "z": return ((array)v)[0][2];    case "q": return ((array)v)[0][3];    case "xy": return ((array)v)[0][..1];    case "xyz": return ((array)v)[0][..2];
pike.git/lib/modules/GL.pmod/GLSLUtils.pmod:973:    }    }   }      class vec3   //! A vector class somewhat similar to a GLSL vec3.   {       inherit vec;    -  void create( Math.Matrix|float x, float y, float z ) +  protected void create( Math.Matrix|float x, float y, float z )    {    if( objectp( x ) )    ::create( x );    else    v = Math.Matrix( ({ x, y, z }) );    }   }      class vec4   //! A vector class somewhat similar to a GLSL vec4.   {       inherit vec;    -  void create( Math.Matrix|float x, float y, float z, float w ) +  protected void create( Math.Matrix|float x, float y, float z, float w )    {    if( objectp( x ) )    ::create( x );    else    v = Math.Matrix( ({ x, y, z, w }) );    }   }      class vec2   //! A vector class somewhat similar to a GLSL vec2.   {       inherit vec;    -  void create( Math.Matrix|float x, float y ) +  protected void create( Math.Matrix|float x, float y )    {    if( objectp( x ) )    ::create( x );    else    v = Math.Matrix( ({ x, y }) );    }   }