I have correctly exported a scene from max, but there are a lot white spaces about the main object.
I think there is something to do with window size.
https://www.asuswebs...hare/GYYKA9NG5Y
https://www.asuswebstorage.com/navigate/share/GYYQKIAG5Y
Thanks
Jack
Show differencesHistory of post edits
#3lucky6969b
Posted 07 August 2012 - 09:58 PM
I have correctly exported a scene from max, but there are a lot white spaces about the main object.
I think there is something to do with window size.
https://www.asuswebstorage.com/navigate/share/GYYKA9NG5Y
Thanks
Jack
I think there is something to do with window size.
https://www.asuswebstorage.com/navigate/share/GYYKA9NG5Y
Thanks
Jack
#2lucky6969b
Posted 07 August 2012 - 04:51 AM
I have correctly exported a scene from max, but there are a lot white spaces about the main object.
I think there is something to do with window size.
What is wrong with this coding?
And one more point, when the window is resized, i get g_pEffect error, I've set g_pEffect->OnResetDevice() and g_pEffect->OnLostDevice();
Thanks
Jack
I think there is something to do with window size.
HRESULT Application::Init(HINSTANCE hInstance, bool windowed)
{
HRESULT hr = S_OK;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.hInstance = hInstance;
wc.lpszClassName = _T("PerfectSim");
RECT rc = { 0, 0, 800, 600 };
AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, false);
RegisterClass(&wc);
m_mainWindow = CreateWindow(_T("PerfectSim"),
_T("Perfect Simulation"),
WS_OVERLAPPEDWINDOW,
0,
0,
rc.right - rc.left,
rc.bottom - rc.top,
NULL,
NULL,
hInstance,
0);
SetCursor( LoadCursor( NULL, IDC_CROSS ) );
ShowWindow(m_mainWindow, SW_SHOW);
UpdateWindow(m_mainWindow);
IDirect3D9 *d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
if (d3d9 == NULL)
{
return E_FAIL;
}
D3DCAPS9 caps;
d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps);
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0) || caps.PixelShaderVersion < D3DPS_VERSION(2,0))
{
return E_FAIL;
}
g_present.BackBufferWidth = windowWidth;
g_present.BackBufferHeight = windowHeight;
g_present.BackBufferFormat = D3DFMT_A8R8G8B8;
g_present.BackBufferCount = 2;
g_present.MultiSampleType = D3DMULTISAMPLE_NONE;
g_present.MultiSampleQuality = 0;
g_present.SwapEffect = D3DSWAPEFFECT_DISCARD;
g_present.hDeviceWindow = m_mainWindow;
g_present.Windowed = windowed;
g_present.EnableAutoDepthStencil = true;
g_present.AutoDepthStencilFormat = D3DFMT_D24S8;
g_present.Flags = 0;
g_present.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
g_present.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
int vp = 0;
if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
vp = D3DCREATE_HARDWARE_VERTEXPROCESSING;
else
vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
if (FAILED(d3d9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_mainWindow, vp, &g_present
, &g_pDevice)))
{
return E_FAIL;
}
d3d9->Release();
What is wrong with this coding?
And one more point, when the window is resized, i get g_pEffect error, I've set g_pEffect->OnResetDevice() and g_pEffect->OnLostDevice();
Thanks
Jack
#1lucky6969b
Posted 07 August 2012 - 04:46 AM
I have correctly exported a scene from max, but there are a lot white spaces about the main object.
I think there is something to do with window size.
What is wrong with this coding?
Thanks
Jack
I think there is something to do with window size.
HRESULT Application::Init(HINSTANCE hInstance, bool windowed)
{
HRESULT hr = S_OK;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.hInstance = hInstance;
wc.lpszClassName = _T("PerfectSim");
RECT rc = { 0, 0, 800, 600 };
AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, false);
RegisterClass(&wc);
m_mainWindow = CreateWindow(_T("PerfectSim"),
_T("Perfect Simulation"),
WS_OVERLAPPEDWINDOW,
0,
0,
rc.right - rc.left,
rc.bottom - rc.top,
NULL,
NULL,
hInstance,
0);
SetCursor( LoadCursor( NULL, IDC_CROSS ) );
ShowWindow(m_mainWindow, SW_SHOW);
UpdateWindow(m_mainWindow);
IDirect3D9 *d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
if (d3d9 == NULL)
{
return E_FAIL;
}
D3DCAPS9 caps;
d3d9->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &caps);
if (caps.VertexShaderVersion < D3DVS_VERSION(2,0) || caps.PixelShaderVersion < D3DPS_VERSION(2,0))
{
return E_FAIL;
}
g_present.BackBufferWidth = windowWidth;
g_present.BackBufferHeight = windowHeight;
g_present.BackBufferFormat = D3DFMT_A8R8G8B8;
g_present.BackBufferCount = 2;
g_present.MultiSampleType = D3DMULTISAMPLE_NONE;
g_present.MultiSampleQuality = 0;
g_present.SwapEffect = D3DSWAPEFFECT_DISCARD;
g_present.hDeviceWindow = m_mainWindow;
g_present.Windowed = windowed;
g_present.EnableAutoDepthStencil = true;
g_present.AutoDepthStencilFormat = D3DFMT_D24S8;
g_present.Flags = 0;
g_present.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
g_present.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
int vp = 0;
if (caps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
vp = D3DCREATE_HARDWARE_VERTEXPROCESSING;
else
vp = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
if (FAILED(d3d9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_mainWindow, vp, &g_present
, &g_pDevice)))
{
return E_FAIL;
}
d3d9->Release();
What is wrong with this coding?
Thanks
Jack