Compare commits
2 Commits
0e4c8865f1
...
b8b511dd27
Author | SHA1 | Date | |
---|---|---|---|
b8b511dd27 | |||
eedaa3e370 |
@ -55,10 +55,11 @@ def draw(size, mode, **data):
|
||||
assert size == len(array) // attribute.count, 'Data for %s is incorrect length' % fmt
|
||||
|
||||
buffer = BufferObject(size * attribute.stride)
|
||||
attribute.set_region(buffer, 0, size, array)
|
||||
data = (attribute.c_type * len(array))(*array)
|
||||
buffer.set_data(data)
|
||||
|
||||
attribute.enable()
|
||||
attribute.set_pointer(buffer.ptr)
|
||||
|
||||
buffers.append(buffer) # Don't garbage collect it.
|
||||
|
||||
glDrawArrays(mode, 0, size)
|
||||
@ -108,10 +109,12 @@ def draw_indexed(size, mode, indices, **data):
|
||||
assert size == len(array) // attribute.count, 'Data for %s is incorrect length' % fmt
|
||||
|
||||
buffer = BufferObject(size * attribute.stride)
|
||||
attribute.set_region(buffer, 0, size, array)
|
||||
data = (attribute.c_type * len(array))(*array)
|
||||
buffer.set_data(data)
|
||||
|
||||
attribute.enable()
|
||||
attribute.set_pointer(buffer.ptr)
|
||||
buffers.append(buffer)
|
||||
buffers.append(buffer) # Don't garbage collect it.
|
||||
|
||||
if size <= 0xff:
|
||||
index_type = GL_UNSIGNED_BYTE
|
||||
|
@ -56,6 +56,10 @@ if __name__ == '__main__':
|
||||
sys.argv.remove('--output')
|
||||
sys.argv.remove(out_path)
|
||||
|
||||
if '--lto=yes' in sys.argv:
|
||||
compiler.use_lto = True
|
||||
sys.argv.remove('--lto=yes')
|
||||
|
||||
# 检测 --no-pyglet-opt 参数
|
||||
pyglet_optimizations = True
|
||||
if pyglet_optimizations and '--no-pyglet-opt' not in sys.argv:
|
||||
|
Loading…
Reference in New Issue
Block a user