DirectX10: WARNING: ID3D10Buffer

Started by
-1 comments, last by Shomismo 12 years, 10 months ago
Im trying to reproduce de sample code #2 from the book "Advanced 3D Game Programming with DirectX 10.0" (files http://samples.jbpub.com/9781598220544/DX10_Source.zip)
It just initializes a w32 prog. with its window, and set up the basics for directX (swap chain", "direct3d device", "render target" and the "viewport"...).
Finally, it defines a Direct3D Font, and a sprite that fonts will use to draw with.
Just after defining the sprite, the next warning appears:
D3D10: WARNING: ID3D10Buffer::SetPrivateData: Existing private data of same name with different size found! [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS ]

I dont find anything wrong, but, i'm a newbie... what can i say... :D

I've been looking for that warning in the internet, but i cant find any help!
This is an extract of the code, any help will be appreciated!!:

//some global variables first
HWND m_hWnd;
ID3D10Device* m_pDevice;
ID3D10Texture2D* m_pBackBuffer;
ID3D10RenderTargetView* m_pRenderTargetView;
IDXGISwapChain* m_pSwapChain;
RECT m_rcScreenRect;
static cGraphicsLayer* m_pGlobalGLayer;

ID3DX10Font* m_pFont;
ID3DX10Sprite* m_pFontSprite;

ID3D10InfoQueue* m_pMessageQueue;

static const UINT m_uiMAX_CHARS_PER_FRAME = 512;



//The method that throws a warning
void cGraphicsLayer::InitD3D(int width, int height, int bpp)
{
HRESULT r = 0;

/*1.- The Swap Chain ***********************************************/
DXGI_SWAP_CHAIN_DESC swapDesc;
ZeroMemory(&swapDesc, sizeof(swapDesc)); // initializes it with zeros
swapDesc.BufferCount = 1;
swapDesc.BufferDesc.Width = 640;
swapDesc.BufferDesc.Height = 480;
swapDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
swapDesc.BufferDesc.RefreshRate.Numerator = 60;
swapDesc.BufferDesc.RefreshRate.Denominator = 1;
swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
swapDesc.OutputWindow = m_hWnd;
swapDesc.SampleDesc.Count = 1;
swapDesc.SampleDesc.Quality = 0;
swapDesc.Windowed = TRUE;


/*2.- Creating the Direct3D Device ***********************************************/
r = D3D10CreateDeviceAndSwapChain(
NULL,
D3D10_DRIVER_TYPE_HARDWARE,
NULL,
D3D10_CREATE_DEVICE_DEBUG,
D3D10_SDK_VERSION,
&swapDesc,
&m_pSwapChain,
&m_pDevice
);

if(FAILED®)
{
throw cGameError(L"Could not create IDirect3DDevice10");
}

// Try to create IDirect3DDevice10 message queue
r = m_pDevice->QueryInterface(__uuidof(ID3D10InfoQueue), (LPVOID*)&m_pMessageQueue);

if(FAILED®)
{
throw cGameError(L"Could not create IDirect3DDevice10 message queue");
}

m_pMessageQueue->SetMuteDebugOutput(false);
m_pMessageQueue->SetMessageCountLimit(-1);


// Keep a copy of the screen dimensions
m_rcScreenRect.left = m_rcScreenRect.top = 0;
m_rcScreenRect.right = width;
m_rcScreenRect.bottom = height;

// Get a copy of the pointer to the back buffer from the swap chain
r = m_pSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)&m_pBackBuffer);

if(FAILED®)
{
throw cGameError(L"Could not get back buffer");
}


/*3.- Attaching the Render Target view ******************************************/
r = m_pDevice->CreateRenderTargetView(
m_pBackBuffer, NULL, &m_pRenderTargetView);

if(FAILED®)
{
throw cGameError(L"Could not create render target view");
}


m_pDevice->OMSetRenderTargets(1, &m_pRenderTargetView, NULL);

/*4.- The Viewport ***************************************************************/
D3D10_VIEWPORT vp;
vp.Width = width;
vp.Height = height;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = 0;
vp.TopLeftY = 0;
// Set the viewport
m_pDevice->RSSetViewports( 1, &vp );


/* Direct3D Fonts - Creating a Font System Using Sprites **************/
D3DX10CreateFont
(
m_pDevice,
15, 0,
FW_BOLD,
1,
FALSE,
DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS,
DEFAULT_QUALITY,
DEFAULT_PITCH | FF_DONTCARE,
L"Arial",
&m_pFont
);

assert(m_pFont);


// Create the sprite that fonts will use to draw with
D3DX10CreateSprite
(
m_pDevice,
m_uiMAX_CHARS_PER_FRAME,
&m_pFontSprite
);

// At this point, the warning is thrown

This topic is closed to new replies.

Advertisement