Skip to content

Commit a5f70cb

Browse files
committed
Remove some gl warnings.
1 parent 6f2d35d commit a5f70cb

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

lib/draft-api/src/openfl/display3D/Context3D.hx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,9 +2377,12 @@ import lime.math.Vector2;
23772377
__bindGLTextureCubeMap(texture.__getTexture());
23782378
}
23792379

2380-
#if (desktop && !html5)
2381-
// TODO: Cache?
2382-
gl.enable(gl.TEXTURE_2D);
2380+
#if lime
2381+
if (__context.type == OPENGL)
2382+
{
2383+
// TODO: Cache?
2384+
gl.enable(gl.TEXTURE_2D);
2385+
}
23832386
#end
23842387

23852388
__contextState.textures[i] = texture;
@@ -2422,9 +2425,12 @@ import lime.math.Vector2;
24222425
texture.__alphaTexture.__setSamplerState(samplerState);
24232426
gl.uniform1i(__state.program.__agalAlphaSamplerEnabled[sampler].location, 1);
24242427

2425-
#if (desktop && !html5)
2426-
// TODO: Cache?
2427-
gl.enable(gl.TEXTURE_2D);
2428+
#if lime
2429+
if (__context.type == OPENGL)
2430+
{
2431+
// TODO: Cache?
2432+
gl.enable(gl.TEXTURE_2D);
2433+
}
24282434
#end
24292435
}
24302436
else

src/openfl/display3D/Context3D.hx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2443,9 +2443,12 @@ import lime.math.Vector2;
24432443
__bindGLTextureCubeMap(texture.__getTexture());
24442444
}
24452445

2446-
#if (desktop && !html5)
2447-
// TODO: Cache?
2448-
gl.enable(gl.TEXTURE_2D);
2446+
#if lime
2447+
if (__context.type == OPENGL)
2448+
{
2449+
// TODO: Cache?
2450+
gl.enable(gl.TEXTURE_2D);
2451+
}
24492452
#end
24502453

24512454
__contextState.textures[i] = texture;
@@ -2477,9 +2480,12 @@ import lime.math.Vector2;
24772480
texture.__alphaTexture.__setSamplerState(samplerState);
24782481
gl.uniform1i(__state.program.__agalAlphaSamplerEnabled[sampler].location, 1);
24792482

2480-
#if (desktop && !html5)
2481-
// TODO: Cache?
2482-
gl.enable(gl.TEXTURE_2D);
2483+
#if lime
2484+
if (__context.type == OPENGL)
2485+
{
2486+
// TODO: Cache?
2487+
gl.enable(gl.TEXTURE_2D);
2488+
}
24832489
#end
24842490
}
24852491
else

src/openfl/display3D/textures/TextureBase.hx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class TextureBase extends EventDispatcher
8585
__supportsBGRA = true;
8686
__textureFormat = bgraExtension.BGRA_EXT;
8787

88+
// Note: Get rid of this when `ANGLE` is added.
8889
#if (lime && !ios && !tvos)
8990
if (context.__context.type == OPENGLES)
9091
{
@@ -369,8 +370,13 @@ class TextureBase extends EventDispatcher
369370
gl.texParameteri(__textureTarget, gl.TEXTURE_MAG_FILTER, magFilter);
370371
gl.texParameteri(__textureTarget, gl.TEXTURE_WRAP_S, wrapModeS);
371372
gl.texParameteri(__textureTarget, gl.TEXTURE_WRAP_T, wrapModeT);
372-
gl.texParameterf(__textureTarget, 34049, state.lodBias); // GL_TEXTURE_LOD_BIAS
373373

374+
#if lime
375+
if (__context.__context.type == OPENGL)
376+
{
377+
gl.texParameterf(__textureTarget, 0x8501, state.lodBias); // GL_TEXTURE_LOD_BIAS
378+
}
379+
#end
374380

375381
if (__samplerState == null) __samplerState = state.clone();
376382
__samplerState.copyFrom(state);

0 commit comments

Comments
 (0)