def __init__(self, items, data_type=None):
		if data_type:
			self.data_type = data_type

		self.element_count = len(items)

		# examine first element to find out whether it's a vector type,
		# in which case the array needs flattening
		try:
			self.element_size = len(items[0])
			is_flat = False
		except __HOLE__:
			# elements are scalar
			self.element_size = 1
			is_flat = True

		if is_flat:
			items_flat = items
		else:
			# need to flatten array
			items_flat = []
			for item in items:
				items_flat += item

		constructor = TYPE_CONSTRUCTORS[self.data_type]
		gl_items = (constructor * len(items_flat))(*items_flat)
		self.name = glGenBuffers(1)
		glBindBuffer(self.target, self.name)
		glBufferData(self.target, gl_items, GL_STATIC_DRAW)
dataset/ETHPy150Open gasman/shortcrust/shortcrust/buffer.py/Buffer.__init__