Esempio n. 1
0
    def link(self):
        LinkProgram(self._object)
        _check_errors()

        self._attribs = ProgramAttributes(self)
        self._uniforms = ProgramUniforms(self)
        return self.link_status
Esempio n. 2
0
 def image(self, image):
     with PreserveTextureBinding(self):
         self._bind()
         _check_errors()
         self._image = image
         self._image.submit(self._binding)
         _check_errors()
Esempio n. 3
0
 def __init__(self):
     self._texture = _gen_texture()
     _check_errors()
     self._unit = None
     self._image = None
     self.filter = Filter(self)
     self.wrap = WrapMode(self)
Esempio n. 4
0
 def __set__(self, instance, value):
     texture = self._get_texture(instance)
     with PreserveTextureBinding(texture) as binding:
         binding.state = texture._texture  #FIXME: binding.state ? clean enough?
         TexParameter(texture._binding, self._parameter,
                      value.value)  #FIXME: what if it's not a GLenum?
         _check_errors()
Esempio n. 5
0
    def link(self):
        LinkProgram(self._object)
        _check_errors()

        self._attribs = ProgramAttributes(self)
        self._uniforms = ProgramUniforms(self)
        return self.link_status
Esempio n. 6
0
 def __init__(self):
     self._texture = _gen_texture()
     _check_errors()
     self._unit = None
     self._image = None
     self.filter = Filter(self)
     self.wrap = WrapMode(self)
Esempio n. 7
0
 def image(self, image):
     with PreserveTextureBinding(self):
         self._bind()
         _check_errors()
         self._image = image
         self._image.submit(self._binding)
         _check_errors()
Esempio n. 8
0
 def sources(self, sources):
     #FIXME: looking at that for a second time, that is UGLY
     c_str_array = (c_str * len(sources))(*[
         c_str(''.join(source)) if hasattr(source, 'read') else c_str(source
                                                                      )
         for source in sources
     ])
     ShaderSource(self._object, len(sources), c_str_array,
                  cast(NULL, POINTER(GLuint)))
     _check_errors()
Esempio n. 9
0
 def sources(self, sources):
     #FIXME: looking at that for a second time, that is UGLY
     c_str_array = (c_str * len(sources))(*[
                                             c_str(''.join(source)) if hasattr(source, 'read')
                                                 else c_str(source)
                                                     for source in sources
                                           ])
     ShaderSource(self._object,
                  len(sources),
                  c_str_array,
                  cast(NULL, POINTER(GLuint))
                 )
     _check_errors()
Esempio n. 10
0
 def compile(self):
     CompileShader(self._object)
     _check_errors()
     return self.compile_status
Esempio n. 11
0
 def use(self):
     UseProgram(self._object)
     _check_errors()
Esempio n. 12
0
 def _set_unit(self):
     ActiveTexture(self.unit)
     _check_errors()
Esempio n. 13
0
File: util.py Progetto: Ademan/pygl
def _get_integer(flag):
    value = GLint(0)
    GetInteger(flag, value)
    _check_errors()
    return value.value
Esempio n. 14
0
 def enable(self):
     self._set_unit()
     _check_errors()
     Enable(self._binding)
     _check_errors()       #FIXME: check after everything?
Esempio n. 15
0
 def disable(self):
     self._set_unit()
     _check_errors()
     Disable(self._binding)
     _check_errors()
Esempio n. 16
0
File: state.py Progetto: Ademan/pygl
 def __get__(self, instance, owner):
     texture = GLint(0) #FIXME: textures are GLuints... but GetInteger is integers only
     GetInteger(_query_from_binding(self._get_binding(instance)), texture)
     _check_errors()
     return texture.value
Esempio n. 17
0
    def append(self, shader):
        self._shaders.append(shader)

        AttachShader(self._program._object, shader._object)
        _check_errors()
Esempio n. 18
0
def _get_integer(flag):
    value = GLint(0)
    GetInteger(flag, value)
    _check_errors()
    return value.value
Esempio n. 19
0
    def append(self, shader):
        self._shaders.append(shader)

        AttachShader(self._program._object, shader._object)
        _check_errors()
Esempio n. 20
0
 def __get__(self, instance, owner):
     texture = GLint(
         0)  #FIXME: textures are GLuints... but GetInteger is integers only
     GetInteger(_query_from_binding(self._get_binding(instance)), texture)
     _check_errors()
     return texture.value
Esempio n. 21
0
 def _set_unit(self):
     ActiveTexture(self.unit)
     _check_errors()
Esempio n. 22
0
 def disable(self):
     self._set_unit()
     _check_errors()
     Disable(self._binding)
     _check_errors()
Esempio n. 23
0
 def compile(self):
     CompileShader(self._object)
     _check_errors()
     return self.compile_status
Esempio n. 24
0
File: state.py Progetto: Ademan/pygl
 def __set__(self, instance, value):
     BindTexture(self._get_binding(instance), value)
     _check_errors()
Esempio n. 25
0
 def remove(self, shader):
     DetachShader(self._program._object,
                  shader._object)
     _check_errors()
Esempio n. 26
0
 def enable(self):
     self._set_unit()
     _check_errors()
     Enable(self._binding)
     _check_errors()  #FIXME: check after everything?
Esempio n. 27
0
 def remove(self, shader):
     DetachShader(self._program._object, shader._object)
     _check_errors()
Esempio n. 28
0
 def __set__(self, instance, value):
     BindTexture(self._get_binding(instance), value)
     _check_errors()
Esempio n. 29
0
 def use(self):
     UseProgram(self._object)
     _check_errors()
Esempio n. 30
0
 def __set__(self, instance, value):
     texture = self._get_texture(instance)
     with PreserveTextureBinding(texture) as binding:
         binding.state = texture._texture #FIXME: binding.state ? clean enough?
         TexParameter(texture._binding, self._parameter, value.value) #FIXME: what if it's not a GLenum?
         _check_errors()