ios - Fragment Shader GLSL for texture, color and texture/color - i want accomplish glsl shader, can texture , color vertex objects. in fact, works me in 2 3 cases: 1) if have texture assigned (but no specific color - color "white"), textured object - works 2) if have texture , color assigned, textured object modulated color - works 3) if have color assigned no texture, black object - doesn't work my shader looks this: varying lowp vec4 colorvarying; varying mediump vec2 texcoordvarying; uniform sampler2d texture; void main(){ gl_fragcolor = texture2d(texture, texcoordvarying) * colorvarying; } i guess that, texture2d(...,...) returns 0 if no texture assigned - seems problem. there way in glsl can check, if no texture assigned (in case, want gl_fragcolor = colorvarying;) "if" isn't alternative in glsl shader, if understanded correctly - ideas accomplish this? or necessary create 2 different shaders both cases? like i'd ...
iphone - Dismissing a UIAlertView - i set in app purchase app, , when user taps button, purchase started. basically, tap button, , depending on speed on net connection, waiting 10 seconds until new alert view comes asking if purchase product. user tap button multiple times since nil came up, , multiple purchase alert views come up. additionally, maybe seen user app bug. in end, problem. i want alert view come spinning wheel says "loading..." when users taps purchase button. problem is, how dismiss when new alert view comes asking user if want purchase product? if ([uialertview alloc] says: @"whatever apple's alert view says") { //dismiss "loading..." alert view here } i uncertainty work, input appreciated. thanks! you need have access alertview. can this. create alertview instance var in app delegate , when want show loading initialize instance var assign property , when want dismiss phone call [alertviewinstance d...
c# - Why IEnumerable<T> becomes empty after adding elements to a collection? - i have ienumerable<t> when iterate through , add together it's element list becomes empty? is there wrong expect code? public class apple { private icollection<fruit> _fruits = new list<fruit>(); public void addfruits(ienumerable<fruit> fruits) { if (fruits == null) throw new argumentnullexception("fruits"); foreach (var fruit in fruits) { _fruits.add(fruit); } } } the caller code: public void addfruits(ienumerable<fruit> fruitstoadd) { foreach (var apple in apples) { // here fruitstoadd has elements, fruitstoadd.tolist() has 2 fruits. apple.addfruits(fruitstoadd); // here fruitstoadd has no element!!, fruitstoadd.tolist() empty! // next iteration not add together fruit next apple since fruitstoadd empty. } } update the tolist() so...
Comments
Post a Comment