File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -353,8 +353,12 @@ void Pipeline :: render(
353
353
// set up multi-pass state
354
354
if (not has_lights){
355
355
if (m_bBlend) {
356
- glEnable (GL_BLEND);
357
- glBlendFunc (GL_SRC_ALPHA, GL_ONE);
356
+ if (m_BlendFunc)
357
+ m_BlendFunc ();
358
+ else {
359
+ glEnable (GL_BLEND);
360
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE);
361
+ }
358
362
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
359
363
}else {
360
364
// glDisable(GL_BLEND);
Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ class Pipeline:
145
145
auto l = this ->lock ();
146
146
m_bBlend = b;
147
147
}
148
+ void blend (std::function<void ()> func) {
149
+ auto l = this ->lock ();
150
+ m_bBlend = true ;
151
+ m_BlendFunc = func;
152
+ }
148
153
149
154
void backfaces (bool b);
150
155
@@ -220,6 +225,8 @@ class Pipeline:
220
225
221
226
const static std::vector<std::string> s_TextureUniformNames;
222
227
const static std::vector<std::string> s_AttributeNames;
228
+
229
+ std::function<void ()> m_BlendFunc;
223
230
};
224
231
225
232
#endif
You can’t perform that action at this time.
0 commit comments