• Content count

  • Joined

  • Last visited

Community Reputation

212 Neutral

About discman1028

  • Rank
    Advanced Member
  1. Does anyone have experience with XML validation in C#? No matter how bad I foul up my schema, it's still validating "ok"... no exceptions thrown, no output. Does anyone see a problem with my source, offhand? // XML in C# string "xmlstr". // XSD schema in file "../../../Info.xsd". // ... StringReader sr = new StringReader(xmlstr); ValidationEventHandler veh = new ValidationEventHandler(ValidationErrorHandler); XmlSchema schema = XmlSchema.Read(new XmlTextReader("../../../Info.xsd"), veh); XmlDocument xdoc = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(schema); settings.IgnoreWhitespace = true; settings.ValidationType = ValidationType.Schema; settings.ValidationEventHandler += veh; XmlReader reader = XmlReader.Create(sr, settings); xdoc.Load(reader); xdoc.Validate(veh); // Validation error handler never gets called, no matter how I change the schema...?
  2. Anybody know if it's possible to find the reference count of an instance of a class? (strong references obviously)
  3. Quote:Original post by MJP If you do need to change a constant or texture via an EffectParameter inside the Begin/End block, just make sure you call Effect.CommitChanges(). This will make sure that the new state gets set onto the GraphicsDevice. So which is a preferable design pattern, given that I only one to change one shader constant? Will the second choice here be slower than the first? (Or is the fx system smart enough about being lazy that it won't re-set all the states that are already set?) Effect m_fx; m_fx.Begin(); m_fx.CurrentTechnique.Passes[0].Begin(); DrawPrimitives(); MyChangeStates(); m_fx.CommitChanges(); DrawPrimitives(); m_fx.CurrentTechnique.Passes[0].End(); m_fx.End(); OR Effect m_fx; m_fx.Begin(); m_fx.CurrentTechnique.Passes[0].Begin(); DrawPrimitives(); m_fx.CurrentTechnique.Passes[0].End(); m_fx.End(); m_fx.CurrentTechnique = (new technique w/new states) m_fx.Begin(); m_fx.CurrentTechnique.Passes[0].Begin(); DrawPrimitives(); m_fx.CurrentTechnique.Passes[0].End(); m_fx.End(); ?
  4. [XNA Game Studio 3.0, C#] How can I find out what I can do between calls to Begin() and End() w/o penalty? Can I change shader constants? Render states? None of the above? Effect m_fx; m_fx.Begin(); m_fx.CurrentTechnique.Passes[0].Begin(); // ... ? m_fx.CurrentTechnique.Passes[0].End(); m_fx.End(); I know the idea is to batch as many primitives together that use the same shader, render state, etc, but I have some confusion about the Begin()/End() api, and where that lies with respect to where shader constants/render states can be set.
  5. Quote:Original post by jpetrie ...this particular example is relatively foolish. Why on earth would you write vector code that called into the renderer? That's just careless. It's a pet example, there are cases where it's not so black and white. Quote:Original post by jpetrie But since your assumption about the JIT and inlining is bogus (owing largely to the fact that the JIT is probably not inlining stuff anyway), is there some other reason you don't want to make separate assemblies? Nope, performance was the only reason. I had read that the JIT will inline simple funcs but hadn't checked any IL yet to be sure.
  6. Hmm, I realize namespaces could be a potential answer here. Still requires some user discipline though, and there's no sure way to verify the hierarchy.
  7. I miss static libraries from C++. You could make a 'core' static library that pretty much everything depends on, and then a 'gfx' library that depends on 'core', and then a 'physics' library that depends on 'core' and 'gfx'. The compiler will prevent 'core' from ever depending on 'gfx'/'physics', and 'gfx' from ever using any of 'physics', etc. You can do the same in C#, but each module must be a DLL -- no good for a vector library where you want each short routine to inline by the JIT if possible. (I assume the JIT is c*ck-blocked at least a little by the DLL separation.) So my question is: in C#, is there a way to create some non-DLL vector classes in that I can assure never makes a call into my non-DLL 'gfx' classes? That is, how can I introduce some kind of 'code module dependencies' in C#? (I'm happy with using a single .csproj as long as I can do this!) (For now, I just separate groups of .cs files into folders, but that's not strictly enforcing any hierarchy at all.)
  8. Thanks for the advice! Sounds good. I also realized my approach wasn't going to be as nice as a translating-geometry approach once I thought more about stationary props, and how I'd then have to scroll/stream them via a different method than the bg.. :) I do want to keep the shader as simple as possible as well, so scrolling the geometry makes more sense.
  9. I'm looking to scroll a background both horizontally and vertically based on player input. I'm picking a texture size out of the air that sounds efficient and is also compatible with older cards' max limits: 1024x1024. (This is for the BG, no props blended in yet.) Let's pretend for the sake of argument that every 1024x1024 tile will be unique. (I don't mind digging into texture streaming techniques/preloading techniques later, if I have too many textures for video mem to hold.) My plan is to do (at most) four texture lookups in the shader, and render to a screen-aligned quad: See any problem with this, or a better way? I should probably also be preloading textures into video memory (or can I trust the driver (D3D's D3DPOOL_MANAGED, e.g.) to put them & keep them in video mem as long as I don't have too much tex data and I don't modify the system-mem copies of them)?
  10. Quote:Original post by d000hg I have got used to SVN integration, not sure if that's allowed in Express? TortoiseSVN works just fine as an SVN client that is decoupled from VS. It's so easy to use. :)
  11. Cool, thanks all. Looks like we've got most every feature except for macros. I know that we definitely do have intellisense and solutions allowed, even though intellisense can be a bit broken sometimes. I have come to expect that. :) I can definitely live with VS2008EE.. nice! Quote:Original post by ViLiO Quote:Original post by discman1028 - No margin guide allowed (since can't edit registry?) This works fine under the express editions (tried in VC and VC# 2008 Express). The only difference is where you need to put the Guides string. It goes under... [HKEY_CURRENT_USER]\Software\Microsoft\VCExpress\9.0\Text EditorRegards, ViLiO Don't know how I missed that, thanks! EDIT: Here's a nice little PDF comparing all the nitty grity features. Beware though -- it is incorrect at least in that it says that VC2008EE doesn't have the "Find All References" feature... it does!
  12. I'm tallying up a list of things I haven't been able to do in VS2008 Express Edition that have actually hindered my experience (as compared to the Pro edition.). It's a pretty minimal list, but still annoying to have these features gone. Maybe you guys know of some nice workarounds so that I can continue to use the Express Edition. Or maybe you can add to the list. :) - No margin guide allowed (since can't edit registry?) - No macro explorer window (does this mean we can't run VB macros at all from within the IDE?). - Not 100% sure if /MP is gone (fast multi-proc compiles), but it seems to be. :( I think it was an undocumented switch in VS2005Pro, so maybe there's hope. Didn't seem to work though when I tried adding /MP. The lack of "Add-In" support hasn't bugged me thus far, since the more-useful (for me) Custom Build Steps and External Tools are in there. Anyone else have experiences?
  13. Actually, a follow up: Anyone know how I could do this for VS2008 Express Edition? Seems there are zero registry entries under /9.0/ (or probably any of the Express Edition installs).
  14. God.. always happens.. find it right after. :) Guess I forgot to use the word "margin". For the sake of others: http://resharper.blogspot.com/2007/09/visualize-right-margin-in-visual-studio.html :)