Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Sep 2012
Offline Last Active Jul 23 2013 04:32 PM

Topics I've Started

Is there any practical use of private inheritance ?

04 February 2013 - 12:32 AM

Hello there.


As asked in topic I wonder if there is any sense of using private inheritance as this:


class Foo

    void Bar();

class Derived : private Foo



pretty much means the same as that:

class Foo

    void Bar();

class Derived : public Foo


Only difference I see is that I choose if I want public elements of Foo class to be inherited as private or if I'd rather like to inherit them as public, but is that flexibility helpful in any way ? I mean, in my opinion private inheritance could possibly just bring mess and chaos to code, but maybe some people in here had an occasion to find that solution helpful ? Thank you very much in advance.

XNAMath vs D3DX10Math && *.fx files vs *.psh and *.vsh

13 October 2012 - 08:55 AM

As mentioned in one of my topics I was lately reading "Beginning DirectX 11 Game Programming" book, which introduced me to XNAMAth library and *.fx files, which are used to store shaders code.

As I always like to learn from many sources (I'm also studying MSDN and DirectX SDK samples) I was looking for some more sources of knowledge and I found http://www.rastertek.com. Author of D3D11 tutorials on this website uses D3DX10Math library and *.psh, *.vsh files for shaders.
I read in the book that D3DXVECTOR3 is old way of doing the same thing by XMFLOAT3, but now I'm a bit lost. What's better to do ? Should I store Vertex Shaders in *.vsh files and Pixel Shaders in *.psh files or maybe it just doesn't matter if I store them in one *.fx file ? Should I use XNAMath library or stick to D3DX10Math ?

I'll be much grateful for any help.

Beginner Question: Why do we use ZeroMemory macro for Swap Chain object ?

04 October 2012 - 11:04 PM

As I mentioned in topic I'm curious why does Swap Chain object require to use ZeroMemory macro before filling it with data? I know what ZeroMemory macro does - from what I read on MSDN it fills a block of memory with zeros, but why?

Thanks a lot in advance for satisfying my curiosity.

Is that way of using constructor really better ?

03 October 2012 - 06:08 PM

Not so long ago I started to learn D3D11 and at the moment I'm swimming through "Beginning DirectX 11 Game Programming" book. I found one thing, which I'm curious about. Author said that constructor’s member initialize list can be more efficient and is better programming practice than letting a constructor do the job in default way.

My question is as in topic, is that way of initializing members really better ?

Example from book:

D3DBase::D3DBase() : driverType_( D3D_DRIVER_TYPE_NULL ), featureLevel_( D3D_FEATURE_LEVEL_11_0 ),
                    d3dDevice_( 0 ), d3dContext_( 0 ), swapChain_( 0 ), backBufferTarget_( 0 )

Thank you in advance for any help.