Jump to content
  • Advertisement
Sign in to follow this  
zalthar

Wierd?

This topic is 5100 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem. When Visual Studio .NET runs my program in debug mode (and in release) it skips lines of code.
////////////////////////////////////////////////////////////
// CreateD3DDevice()
////////////////////////////////////////////////////////////
HRESULT CDirect3D::CreateD3DDevice()
{
// ================= INSTEAD OF STARTING HERE!!!
	D3DPRESENT_PARAMETERS D3DPresent_Params;
    ZeroMemory(&D3DPresent_Params, sizeof(D3DPRESENT_PARAMETERS));
    D3DPresent_Params.Windowed = FALSE;
    D3DPresent_Params.BackBufferCount = y;
    D3DPresent_Params.BackBufferWidth = 640;
    D3DPresent_Params.BackBufferHeight = 480;
    D3DPresent_Params.BackBufferFormat = D3DFMT_X8R8G8B8;
    D3DPresent_Params.SwapEffect = D3DSWAPEFFECT_DISCARD;
    D3DPresent_Params.hDeviceWindow = m_hWnd;
    HRESULT hResult = m_pD3D->CreateDevice(D3DADAPTER_DEFAULT,
		D3DDEVTYPE_HAL, m_hWnd, 
// ================= IT STARTS HERE!!!
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
		&D3DPresent_Params, &m_pD3DDevice);
    if (FAILED(hResult))
    {
		MessageBox(m_hWnd, "Failed to create Direct3D device.",
            "DirectX Error", MB_OK);
            strcpy(m_szErrorMsg, "CreateD3DDevice()");
        return hResult;
    }

    return hResult;
}
What is wrong? I have tried other applications with the same function and it works. But not with this program. HELP ME! /Zalthar

Share this post


Link to post
Share on other sites
Advertisement

{
// ================= INSTEAD OF STARTING HERE!!!
D3DPRESENT_PARAMETERS D3DPresent_Params;
ZeroMemory(&D3DPresent_Params, sizeof(D3DPRESENT_PARAMETERS));
D3DPresent_Params.Windowed = FALSE;
D3DPresent_Params.BackBufferCount = y;
D3DPresent_Params.BackBufferWidth = 640;
D3DPresent_Params.BackBufferHeight = 480;
D3DPresent_Params.BackBufferFormat = D3DFMT_X8R8G8B8;
D3DPresent_Params.SwapEffect = D3DSWAPEFFECT_DISCARD;
D3DPresent_Params.hDeviceWindow = m_hWnd;
HRESULT hResult = m_pD3D->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL, m_hWnd)

you forgot the final parentheses or screwed up the params or both on the createdevice function

Share this post


Link to post
Share on other sites
No you are wrong the parentes comes after the comment IT STARTS HERE. The thing is that it starts in the middle of the CreateDevice call.

Share this post


Link to post
Share on other sites
I did notice now that this function doesn't return anything to g_hWnd. Anyone know why?


////////////////////////////////////////////////////////////
// CreateAppWindow()
////////////////////////////////////////////////////////////
void CreateAppWindow(HINSTANCE hInstance)
{
g_hWnd = CreateWindowEx(
NULL,
"Bricker",
"Bricker",
WS_POPUP,
100,
100,
648,
514,
GetDesktopWindow(),
NULL,
hInstance,
NULL);
}

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!