github.com/gop9/olt@v0.0.0-20200202132135-d956aad50b08/gio/app/internal/gl/types.go (about)

     1  // +build !js
     2  
     3  package gl
     4  
     5  type (
     6  	Buffer       struct{ V uint }
     7  	Framebuffer  struct{ V uint }
     8  	Program      struct{ V uint }
     9  	Renderbuffer struct{ V uint }
    10  	Shader       struct{ V uint }
    11  	Texture      struct{ V uint }
    12  	Query        struct{ V uint }
    13  	Uniform      struct{ V int }
    14  	Object       struct{ V uint }
    15  )
    16  
    17  func (u Uniform) Valid() bool {
    18  	return u.V != -1
    19  }
    20  
    21  func (p Program) Valid() bool {
    22  	return p.V != 0
    23  }
    24  
    25  func (s Shader) Valid() bool {
    26  	return s.V != 0
    27  }
    28  
    29  func (t Texture) Valid() bool {
    30  	return t.V != 0
    31  }
    32  
    33  func (t Texture) Equal(t2 Texture) bool {
    34  	return t == t2
    35  }