Jack
2010-03-23 08:16:13 UTC
Hi,
First, Thank you guys for the previous replies on my previous questions.
int CAStar::Step(int &sx, int& sy)
{
// ... //
[snip]
D3DXVECTOR2 vec2(m_pBest->x, m_pBest->y);
g_finalArray.push_back(vec2);
RECT rect;
GetClientRect(g_hWndMain, &rect);
InvalidateRect(g_hWndMain, &rect, FALSE);
// ... //
[snip]
}
/////////////////////////////////
The display "code" never gets executed, or executed just a few times, there
was no time slot for me to check the output.
long CALLBACK WndProc(...)
{
//...//
case WM_PAINT:
if (g_finalArray.size() >= 0)
{
DrawRoute(hDC);
}
// ... //
}
void DrawRoute()
{
std::vector<D3DXVECTOR2>::iterator it;
for (it = g_finalArray.begin(); ....
SetPixel(hDC, it->x, it->y, RGB(255,0,255));
}
Does this mean I have to use multi-threading so that
the path (in pixels) can be displayed in the window which shows the results
as soon as it is generated in other part of my program?
Thanks
Jack
First, Thank you guys for the previous replies on my previous questions.
int CAStar::Step(int &sx, int& sy)
{
// ... //
[snip]
D3DXVECTOR2 vec2(m_pBest->x, m_pBest->y);
g_finalArray.push_back(vec2);
RECT rect;
GetClientRect(g_hWndMain, &rect);
InvalidateRect(g_hWndMain, &rect, FALSE);
// ... //
[snip]
}
/////////////////////////////////
The display "code" never gets executed, or executed just a few times, there
was no time slot for me to check the output.
long CALLBACK WndProc(...)
{
//...//
case WM_PAINT:
if (g_finalArray.size() >= 0)
{
DrawRoute(hDC);
}
// ... //
}
void DrawRoute()
{
std::vector<D3DXVECTOR2>::iterator it;
for (it = g_finalArray.begin(); ....
SetPixel(hDC, it->x, it->y, RGB(255,0,255));
}
Does this mean I have to use multi-threading so that
the path (in pixels) can be displayed in the window which shows the results
as soon as it is generated in other part of my program?
Thanks
Jack