Skip to content

Commit 0d6bf45

Browse files
committed
Texture Tests
1 parent 6f537d3 commit 0d6bf45

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/test_texture.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from demosys.test import DemosysTestCase
2+
from demosys.opengl import Texture2D, TextureArray, DepthTexture
3+
4+
5+
class TextureTest(DemosysTestCase):
6+
7+
def test_create(self):
8+
Texture2D.create((256, 256)).use()
9+
TextureArray.create((256, 256, 4)).use()
10+
DepthTexture.create((256, 256))
11+
12+
def test_read(self):
13+
texture = Texture2D.create((4, 4), components=4)
14+
texture.read()
15+
16+
def test_read_into(self):
17+
texture = Texture2D.create((4, 4), components=4)
18+
buff = bytearray([0] * 16 * 4)
19+
texture.read_into(buff)

0 commit comments

Comments
 (0)