Skip to main content
GameDev.net gamedev.net
🔒 Locked

Wierd?

Started by zalthar Jul 7, 2004 at 1:06 PM 3 replies 1k views
Original Post
zalthar
zalthar
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
------------------------------- Zalthar -Joakim Karlsson------------------------------
a3a2004
a3a2004
{// ================= 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
zalthar
zalthar
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.
------------------------------- Zalthar -Joakim Karlsson------------------------------
zalthar
zalthar
It doens't even set the variables in the D3DParent_Params.
------------------------------- Zalthar -Joakim Karlsson------------------------------
zalthar
zalthar
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);}
------------------------------- Zalthar -Joakim Karlsson------------------------------

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.