PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

really newbie question :)

hi all ,
first sorry for mi english

im a newbie in c\c++ so my question....... :oops:

how to drawn a rect en i press stylus down?

if i put then in ProcessNextFrame this works fine ,but i want
to see the rect only i press the stylusdown

thanks .
Set a bool flag in StylusDown( ) then reset it in StylusUp( ). If the flag is set in ProcessNextFrame( ) then display whatever image you want.

I hope this is what you were asking for.
thanks ,
yes is this but ave you a littel example to make the bool flag :oops:

thanks :)
Sure :)

Let's use the Simple sample program supplied with GapiDraw for our example.

In myapplication.h add a boolean member for the flag:

Code:

...
// Attributes
protected:
bool m_bStylusDown; // our flag for the stylus tap
CGapiBitmapFont m_font;
...


Now, in myapplication.cpp we'll need to initialize the flag:

Code:

HRESULT CMyApplication::InitInstance()
{
m_bStylusDown = false;

return S_OK;
}


Next, we need to set and reset the flag as necessary:

Code:

HRESULT CMyApplication::StylusDown(POINT p)
{
m_bStylusDown = true;

...

return S_OK;
}

HRESULT CMyApplication::StylusUp(POINT p)
{
m_bStylusDown = false;

return S_OK;
}


Finally, we need to watch for the flag to be set in our game loop:

Code:

HRESULT CMyAplication::ProcessNextFrame(CGapiSurface* pBackBuffer, DWORD dwFlags)
{
...

if(m_bStylusDown) {
// do something here
}

return S_OK;
}
Great many thanks :D :D