this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added GPU_BLEND_NORMAL_ADD_ALPHA blend mode (paint-style).

+14 -3
+12 -2
SDL_gpu/GL_common/SDL_gpu_GL_common.inl
··· 548 548 return; 549 549 glBlendEquation(GL_FUNC_ADD); 550 550 } 551 - else if(mode == GPU_BLEND_KEEP_ALPHA) 551 + else if(mode == GPU_BLEND_NORMAL_KEEP_ALPHA) 552 552 { 553 553 if(!(renderer->enabled_features & GPU_FEATURE_BLEND_FUNC_SEPARATE)) 554 554 return; 555 555 // Don't disturb the alpha 556 556 glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE); 557 + if(!(renderer->enabled_features & GPU_FEATURE_BLEND_EQUATIONS)) 558 + return; 559 + glBlendEquation(GL_FUNC_ADD); 560 + } 561 + else if(mode == GPU_BLEND_NORMAL_ADD_ALPHA) 562 + { 563 + if(!(renderer->enabled_features & GPU_FEATURE_BLEND_FUNC_SEPARATE)) 564 + return; 565 + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE); 557 566 if(!(renderer->enabled_features & GPU_FEATURE_BLEND_EQUATIONS)) 558 567 return; 559 568 glBlendEquation(GL_FUNC_ADD); ··· 2500 2509 // Delete the attached target first 2501 2510 if(image->target != NULL) 2502 2511 { 2503 - renderer->FreeTarget(renderer, image->target); 2512 + GPU_Target* target = image->target; 2504 2513 image->target = NULL; 2514 + renderer->FreeTarget(renderer, target); 2505 2515 } 2506 2516 2507 2517 flushAndClearBlitBufferIfCurrentTexture(renderer, image);
+2 -1
SDL_gpu/SDL_gpu.h
··· 100 100 GPU_BLEND_MOD_ALPHA = 12, 101 101 GPU_BLEND_SET_ALPHA = 13, 102 102 GPU_BLEND_SET = 14, 103 - GPU_BLEND_KEEP_ALPHA = 15, 103 + GPU_BLEND_NORMAL_KEEP_ALPHA = 15, 104 + GPU_BLEND_NORMAL_ADD_ALPHA = 16, 104 105 GPU_BLEND_OVERRIDE = 100 // Lets you specify direct GL calls before blitting. Note: You should call GPU_FlushBlitBuffer() before you change blend modes via OpenGL so the new blend mode doesn't affect SDL_gpu's previously buffered blits. 105 106 } GPU_BlendEnum; 106 107