Senior Moderators
  • Content count

  • Joined

  • Last visited

Community Reputation

1788 Excellent

About Sneftel

  • Rank
    Moderator - Consoles, PDAs, and Cell Phones
  1. OpenMP omp_get_num_procs

    [quote name='Misery' timestamp='1313398274' post='4849300'] So what is wrong? [/quote] You need to include the OpenMP library. [quote] I have read OpenMP manual and there's not mentioned that omp requires any additional libs or dlls. [/quote] That's because the manual is about the OpenMP standard, not the particular OpenMP implementation you're using.
  2. It's common for the first phone screen to be a non-technical one with an HR rep. They'll briefly discuss your interests, background, skills, salary requirements, and availability. The primary purpose is to weed out the people who are utterly unqualified for the position. A technical phone screen is generally rapid-fire questions -- what's the size of a 'double', how does virtual function binding work, what's the cross product, that sort of thing. It's likewise a method for weeding out unqualified people before the real interview, in particular the ones who lied to the HR rep about their skills. Fairly basic stuff, mostly. If there's something you don't know the answer to, say what you can, but don't dwell on it by audibly agonizing about the tip of your tongue.
  3. What's the name of this algorithm?

    What you've got there is the "power set" of your set of objects.
  4. I need headphones...

    Sennheiser has a wide range of price/quality headphones options available, and I used a pair for about six years (until the ear cushions broke down from head sweat saturation ... the sound was still fine). Their customer support seems good, from my limited interaction with it; I screwed up the cable once, and they sent me a replacement immediately and for free.
  5. [quote name='intyuh' timestamp='1309740228' post='4830743'] I "think" this is safe in my case, but I found the IntToPtr "cleaner", and I wanted to know what were the implications of doing this, and if there is a "clean" (as in "safe", it won't screw something later) way of replacing those 2 functions I used on Windows ^^ [/quote] It is safe in your case: architectures where sizeof(void*) < sizeof(int) are few and far between, and do not include anything that runs DXUT. I wouldn't use IntToPtr and PtrToInt, though. As you've seen, those are simply wrappers around casts, and ones that will make people wonder whether they are or are not just wrappers around casts. As a rule of thumb, avoid using WINAPI idioms except when dealing directly with the WINAPI: in any other context, they decrease code readability (and, of course, cross-platform compatibility).
  6. x64 Build Questions

    [quote name='ryan20fun' timestamp='1308842550' post='4826835'] from what i read INT_PRT will work be the correct byte size in the respective build configuration, right ?[/quote] I have no idea. INT_PTR is not a standard type, and I would not use it in my own code. [quote] i dont fore-see myself using more then 4GB, but i would still like to have 64Bit compatible code. what do you mean by ugly ?[/quote] By ugly, I mean that indices may no longer fit into a 32-bit int, causing silent bugs when you iterate over or access arrays. [quote][quote name='Sneftel' timestamp='1308839710' post='4826805'] The really, really important thing, though: Read <a href="[url=""]http://www.codeproje...bit-Errors.aspx[/url]">this</a>. Over and over. Take it to bed with you. Make a song out of it. It's a great resource, but only if you memorize its patterns. [/quote] unfortunetly that link does not work for me [/quote] Fixed above.
  7. x64 Build Questions

    [quote name='ryan20fun' timestamp='1308838789' post='4826790'] Hi All. ive now decided that i should start using the x64 architecture. now i've lloked around a bit and found out that you are supposed to use INT_PTR, DWORD_PTR, ETC instead of INT, DWORD, ETC and you should use the PTR version of windows functions when avaliable. is there anything else i should know ? are there any things i should avoid ? [/quote] There's a couple of categories of gotchas. First are the ones that apply when you don't actually need to play with 64-bit values. If you're doing int<->ptr conversions, then you are a bad person and probably going to programmer hell anyway, but take a look at that too. Unsafe use of unions is a related concern, now that ints and ptrs are different lengths. The second category comes into play if you are actually going to have containers larger than 4 GB (actually, things get ugly around 2 GB too), or actually will use 64-bit arithmetic. You need to take a hard look at where you are using int and where you need to use size_t and ptrdiff_t and long long. The really, really important thing, though: Read <a href="">this</a>. Over and over. Take it to bed with you. Make a song out of it. It's a great resource, but only if you memorize its patterns.
  8. Use Directinput or not ?

    XInput is useful for 360 controllers, and for very little else. Unless you are specifically targeting Windows+360 controller as a hardware target, and need the extra readout capabilities that DI doesn't offer, I'd go the simpler route of just using DirectInput. Incidentally, DirectInput is NOT deprecated. It hasn't been the source of major revisions in a while, but that's more a reflection of input technology changing more slowly than graphics technology, than it is of Microsoft planning to stop supporting it.
  9. Parallel Axis - rotating inertia sum?

    Transforming inertial tensors doesn't work like that. You obtain the inertial tensor I transformed by a reference frame rotation R as R<sup>T</sup>*I*R.
  10. WTF Sleep sort

    Under the hood, I guess that counts as heapsort.
  11. Strange Memory Leak

    Data breakpoints are not an effective way to debug memory leaks. They show you when the memory location is being accessed, not when it's NOT being accessed. The most straightforward way to debug memory leaks with the MSVC debug CRT is to (1) make your program deterministic enough, (2) grab the ID of the leaked allocation, then (3) tell the CRT to break on its allocation with _crtBreakAlloc. My offhand guess is that you don't have a leak at all, the memory is being freed by something that runs after _CrtDumpMemoryLeaks, and that data breakpoint is showing you the debug heap writing garbage into the block on deallocation.
  12. C++ decltype troubles

    As currently implemented in compilers, that code is wrong; a modification to the standard which would allow it happened just a couple of months ago, though. Workaround: [code] template<typename T> struct BarGetter { typedef typename T::Bar BarType; }; int main() { Foo f; BarGetter<decltype(f)>::BarType x = 5; } [/code]
  13. [quote name='Rasterman' timestamp='1307471576' post='4820616'] Found the solution, after changing the Include Directories property you have to unload and reload the entire solution for it to pickup any changes, only doing a rescan on the solution doesn't work. Wow! Yet another reason I [b]hate [/b]VS2010... [/quote] I've never had to do reload the solution OR "rescan" it.... are you making your changes through the properties window, or directly to the vcxproj file?
  14. Circular health bars

    In general, GUI stuff like this isn't done with a clever shader. The most commonly used tech for game GUIs is Flash, using ScaleForm to render it into the game (RAD game tools recently released Iggy, with equivalent functionality). In this case, the health bar -- whatever its shape -- would be an animation, with the player's health level determining which frame was shown. This lets your GUI artist use content creation tools he's comfortable with, and lets him iterate without constant support from a programmer. Obviously a ScaleForm license is out of the reach of most indie devs, but if you're using UDK, good news -- it's in there. (Crytek might have it available too, but I'm not sure.)
  15. How do ddx and ddy work?

    The fragments are processed in the 2x2 blocks; ddx will compute the difference from either the rightward or leftward fragment, depending on which side of the 2x2 block it is on. You can confirm this by observing that ddx always produces the same values for both pixels.