@@ -235,8 +235,10 @@ void PrimitiveMan::DrawPrimitives(int player, BITMAP* targetBitmap, const Vector
235
235
std::array<int , 4 > lastBlendAmounts = {BlendAmountLimits::MinBlend, BlendAmountLimits::MinBlend, BlendAmountLimits::MinBlend, BlendAmountLimits::MinBlend};
236
236
GLint currentShader = rlGetShaderCurrent ();
237
237
rlDrawRenderBatchActive ();
238
- glBlendBarrierKHR ();
239
- rlEnableAdvancedColorBlend ();
238
+ if (GLAD_GL_KHR_blend_equation_advanced_coherent){
239
+ glBlendBarrierKHR ();
240
+ rlEnableAdvancedColorBlend ();
241
+ }
240
242
rlEnableColorBlend ();
241
243
for (const std::unique_ptr<GraphicalPrimitive>& primitive: m_ScheduledPrimitives) {
242
244
if (int playerToDrawFor = primitive->m_Player ; playerToDrawFor == player || playerToDrawFor == -1 ) {
@@ -258,13 +260,17 @@ void PrimitiveMan::DrawPrimitives(int player, BITMAP* targetBitmap, const Vector
258
260
glUniform4f (colorUniform, 1 .0f , 1 .0f , 1 .0f , 1 .0f );
259
261
lastBlendMode = DrawBlendMode::NoBlend;
260
262
}
261
- glBlendBarrierKHR ();
263
+ if (GLAD_GL_KHR_blend_equation_advanced_coherent) {
264
+ glBlendBarrierKHR ();
265
+ }
262
266
rlZDepth (primitive->m_Depth );
263
267
primitive->DrawTiled (targetBitmap, targetPos);
264
268
}
265
269
}
266
270
rlDrawRenderBatchActive ();
267
- rlDisableAdvancedColorBlend ();
271
+ if (GLAD_GL_KHR_blend_equation_advanced_coherent) {
272
+ rlDisableAdvancedColorBlend ();
273
+ }
268
274
rlSetBlendMode (RL_BLEND_ALPHA);
269
275
rlEnableShader (currentShader);
270
276
GLint colorUniform = glGetUniformLocation (rlGetShaderCurrent (), " rteColor" );
0 commit comments