cdoubleplusgood

Members
  • Content count

    81
  • Joined

  • Last visited

Community Reputation

895 Good

About cdoubleplusgood

  • Rank
    Member
  1. WinAPI WNDPROC to Engine/Game MessageHandler

      This is in general not an option, since Windows sometimes uses an internal message loop instead of the applications loop, e.g. when a menu is opened, the window is resized, when a modal dialog is shown...
  2. C++ exceptions

    Kind of off topic, but: Can you elaborate on this? I've been working with C# for years and don't know of such a functionality. How can I get such a list of potentially thrown exceptions? (I'm not talking of 3rd party tools like Exception Reflector or Ghost Doc.)
  3. Creating a Sphere from a Cube

    Not quite sure if I understand you completely, but it seems to me that the underlying problem is this: It is impossible to cover a sphere with undistorted squares, equilateral triangles, hexagons etc. E.g. with a subdivided cube, there will be 8 corners (the original corners of the cube) with 3 edges, but all other corners have 4 edges. If you start with an icosahedron and subdivide with triangles, you will have corners with 5 and corners with 6 edges.
  4. forget c++

    Languages are overestimated.   Of course, C++ has its specific features (and problems). But after all, it's just a tool. Most programming and design principles are very similar to other C-ish languages, like C# or Java. Sure, you will lose some skill if you don't practice - same as for any other type of ability. So if you can land the job you're after - do it. If you need, you can continue with C++ any time later.
  5. c++ function pointers

    Also missing: lambdas, mem_fn, bind. In modern C++, especially lambdas are a "must know", IMO.
  6. c++ function pointers

    In the "new" standard (C++11), you can use a type alias instead of typedef: using PF = int(*)(int); Or, without typedef or alias, C++11 allows trailing return types; the syntax may be somewhat clearer: auto GiveMeFunctionPointer() -> int (*)(int) { return &AddOne; }
  7. OpenGL Jumping over to DirectX?

    That's a great book; far better than any online tutorial I've seen. With one exception: Luna uses D3DX. kunos already mentioned the DirectX toolkit libraries; these should be used instead in new code.
  8. Why is infinite technically not a number.

    There are ideas how to extend the field of real numbers to include infinity: http://en.wikipedia.org/wiki/Extended_real_number_line (The German article is more elaborate: http://de.wikipedia.org/wiki/Erweiterte_reelle_Zahl) However, the usual arithmetic rules would no longer hold in such a field, because this set is no longer an ordered field: http://en.wikipedia.org/wiki/Ordered_field So in practice it seem to be not very useful to work with such a definition.   Related question: From a mathematical point of view: If you die young, are you longer dead?
  9. Matrix "sign"

    Definitely no. The math doesn't care where the thumbs are attached to your hands. "Handedness" comes into play when you visualize the results in real world, e.g. on the screen. The identity matrix always looks like your 1st matrix. Your 2nd matrix performs a mirror operation. In general, if the determinant is negative, the transformation includes mirroring. In this sense, there is a relationship between this "sign" and handedness: To project vectors from left- to a right handed coordinates, you can use a mirror operation.
  10. Linked List vs std::vector

    There are advantages in specific scenarios. E.g. an iterator to a list element does not get invalid when other elements are inserted or removed. Or, as rip-off said, elements of lists do not get copied / moved, when other elements are inserted or deleted.
  11. The HLSL compiler works with both column major and row major matrixes; command line switches Zpc and Zpr are used to declare the matrix ordering. IIRC Zpc (column major) is default. Maybe your shader was compiled using Zpr?   However, your last paragraph about matrix multiplication is wrong. The notations "row major" and "column major" only apply to storage. They say nothing about how the matrix elements are interpreted, and how the order of multiplication is. When writing "vec * matrix", vec is interpreted as row vector (a 4 * 1 matrix), and the multiplication works out as 4 dot products of vec with the columns of the matrix. With "matrix * vec", vec is assumed to be a column vector (a 1 * 4 matrix), and the multiplications are dot products of vec with the rows of the matrix. Again, this has nothing to do with the ordering of matrix elements in memory or registers.   "Column major" in terms of HLSL means the compiler assumes that each register contains a matrix column; "row major" means each register contains a row. When writing "vec * matrix", the compiler will create different assembly code with Zpr and Zpc; the code created with Zpc (column major) is slightly more efficient, but both is possible and correct.
  12. The topic is about D3D9, so geometry and tesselation shaders do not apply here.
  13. Exactly what's the point of 'int32_t', etc.

    This ain't necessarily so. In MSVC all int types have the same size on 32 and 64 bit; i.e. long is also 32 bit.