Esempio n. 1
0
	def array_stride(self):
		if not self.layout.standardized:
			stride = GL.GLint()
			stride = GL.glGetActiveUniformsiv(self.program.handle, 1, self.index,
			                                  GL.GL_UNIFORM_ARRAY_STRIDE, c.byref(matrix_stride))
			return stride.value
		return super().array_stride
Esempio n. 2
0
	def offset(self):
		'''Returns the offset of the member from the start of the parent :py:class:`UniformBlock`

		:rtype: :py:obj:`int`
		'''
		if not self.active:
			return None

		if isinstance(self.datatype, Struct):
			return min(m.offset for m in self)
		elif isinstance(self.datatype, Array):
			return self[0].offset

		offset = GL.GLint()
		GL.glGetActiveUniformsiv(self.program.handle, 1, self.index,
		                         GL.GL_UNIFORM_OFFSET, c.byref(offset))
		return offset.value