1
1
2
2
3
- import Texture from '../texture'
3
+ import Texture2D from '../texture-2d '
4
4
import Program from '../program'
5
5
6
6
var expect = require ( 'expect.js' ) ;
@@ -22,7 +22,7 @@ function loadImage( img, src ){
22
22
var mireRGB , mireRGBA ;
23
23
var filltex , filltex16 ;
24
24
25
- describe ( "Texture " , function ( ) {
25
+ describe ( "Texture2d " , function ( ) {
26
26
27
27
before ( function ( ) {
28
28
var vert = require ( './glsl/filltex.vert' )
@@ -49,33 +49,33 @@ describe( "Texture", function(){
49
49
50
50
51
51
it ( "should be exported in nanogl namespace" , function ( ) {
52
- expect ( Texture ) . to . be . ok ( ) ;
52
+ expect ( Texture2D ) . to . be . ok ( ) ;
53
53
} ) ;
54
54
55
55
it ( "creation should leave clean gl state" , function ( ) {
56
- var tex = new Texture ( gl ) ;
56
+ var tex = new Texture2D ( gl ) ;
57
57
testContext . assertNoError ( ) ;
58
58
tex . dispose ( )
59
59
} ) ;
60
60
61
61
62
62
it ( "dispose should leave clean gl state" , function ( ) {
63
- var tex = new Texture ( gl ) ;
63
+ var tex = new Texture2D ( gl ) ;
64
64
tex . dispose ( )
65
65
testContext . assertNoError ( ) ;
66
66
} ) ;
67
67
68
68
69
69
it ( "should load rgb tex" , function ( ) {
70
- var tex = new Texture ( gl ) ;
70
+ var tex = new Texture2D ( gl ) ;
71
71
tex . fromImage ( mireRGB , false ) ;
72
72
tex . dispose ( ) ;
73
73
testContext . assertNoError ( ) ;
74
74
} ) ;
75
75
76
76
77
77
it ( "should load rgba tex" , function ( ) {
78
- var tex = new Texture ( gl ) ;
78
+ var tex = new Texture2D ( gl ) ;
79
79
tex . fromImage ( mireRGBA , true ) ;
80
80
tex . dispose ( ) ;
81
81
testContext . assertNoError ( ) ;
@@ -84,7 +84,7 @@ describe( "Texture", function(){
84
84
85
85
86
86
it ( "should render rgb tex" , function ( ) {
87
- var tex = new Texture ( gl ) ;
87
+ var tex = new Texture2D ( gl ) ;
88
88
tex . fromImage ( mireRGB , false ) ;
89
89
90
90
filltex . bind ( )
@@ -102,7 +102,7 @@ describe( "Texture", function(){
102
102
103
103
104
104
it ( "should render nearest filtering" , function ( ) {
105
- var tex = new Texture ( gl ) ;
105
+ var tex = new Texture2D ( gl ) ;
106
106
tex . fromImage ( mireRGB , false ) ;
107
107
108
108
filltex . bind ( )
@@ -121,7 +121,7 @@ describe( "Texture", function(){
121
121
122
122
123
123
it ( "should render linear filtering" , function ( ) {
124
- var tex = new Texture ( gl ) ;
124
+ var tex = new Texture2D ( gl ) ;
125
125
tex . fromImage ( mireRGB , false ) ;
126
126
127
127
filltex . bind ( )
@@ -140,7 +140,7 @@ describe( "Texture", function(){
140
140
141
141
142
142
it ( "should render nearest mip filtering" , function ( ) {
143
- var tex = new Texture ( gl ) ;
143
+ var tex = new Texture2D ( gl ) ;
144
144
tex . fromImage ( mireRGB , false ) ;
145
145
146
146
filltex . bind ( )
@@ -160,7 +160,7 @@ describe( "Texture", function(){
160
160
161
161
162
162
it ( "should render nearest mip linear filtering" , function ( ) {
163
- var tex = new Texture ( gl ) ;
163
+ var tex = new Texture2D ( gl ) ;
164
164
tex . fromImage ( mireRGB , false ) ;
165
165
166
166
filltex . bind ( )
@@ -180,7 +180,7 @@ describe( "Texture", function(){
180
180
181
181
182
182
it ( "should render linear mip linear filtering" , function ( ) {
183
- var tex = new Texture ( gl ) ;
183
+ var tex = new Texture2D ( gl ) ;
184
184
tex . fromImage ( mireRGB , false ) ;
185
185
186
186
filltex . bind ( )
@@ -200,7 +200,7 @@ describe( "Texture", function(){
200
200
201
201
202
202
it ( "should render with program sampler helper" , function ( ) {
203
- var tex = new Texture ( gl ) ;
203
+ var tex = new Texture2D ( gl ) ;
204
204
tex . fromImage ( mireRGB , false ) ;
205
205
206
206
filltex . bind ( )
@@ -216,7 +216,7 @@ describe( "Texture", function(){
216
216
217
217
218
218
it ( "@should accept Uint8Array RGB data" , function ( ) {
219
- var tex = new Texture ( gl , gl . RGB ) ;
219
+ var tex = new Texture2D ( gl , gl . RGB ) ;
220
220
tex . bind ( ) ;
221
221
gl . pixelStorei ( gl . UNPACK_ALIGNMENT , 1 ) ;
222
222
@@ -242,7 +242,7 @@ describe( "Texture", function(){
242
242
} ) ;
243
243
244
244
it ( "should accept Uint8Array RGBA data" , function ( ) {
245
- var tex = new Texture ( gl , gl . RGBA ) ;
245
+ var tex = new Texture2D ( gl , gl . RGBA ) ;
246
246
247
247
var data = new Uint8Array ( [
248
248
0x10 , 0x10 , 0x10 , 0x60 ,
0 commit comments