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# - Can ProtoBuf-Net deserialize to a flat class? - protobuf-net uses nested protobuf constructs back upwards inheritance. however, can made force properties flat target class has same properties inherited "serialized" version? see test illustration below. needless result of flat namespace null both properties. possible solution: re-create info flat.b first on property property basis. note: not prefered option. using system; namespace hierarchy { using protobuf; [protocontract] public class { [protomember(1)] public string prop1 { get; set; } } [protocontract] public class b : { public b() { } [protomember(1)] public string prop2 { get; set; } public override string tostring() { homecoming "prop1=" + prop1 + ", prop2=" + prop2; } } } namespace flat { using protobuf; [protocontract] p...
Comments
Post a Comment