I have written a mini windowing toolkit that works on top of CGapiApp.
All the event processing (input, paint events etc) are being driver by CGapiApplication::processNextFrame() ( my app is pretty much synchronized by this function.)
I also implemented something akin to windows modal dialog.
Something that you can call with :
MyDialog mdlg(....);
int result=mdlg.exec();
The actuall exec call is a blocking call , meaning it should not return until the dialog is dismissed.
I implemented this using my own mini-event loop which looks like:
This is basically copy of CGapiApplication internal thread function.
Again, since all the processing in my little toolkit originates from CGapiApplication::processNextFrame() call, it should in effect end up as sort of inner
while() loop inside of CGapiApplication::ThreadFunc(LPVOID pParam) function,
I am just wondering if this is the correct way of doing this kind of processing and if there is something else CGAPi is doing behind my back I should know about ?
Thanks
All the event processing (input, paint events etc) are being driver by CGapiApplication::processNextFrame() ( my app is pretty much synchronized by this function.)
I also implemented something akin to windows modal dialog.
Something that you can call with :
MyDialog mdlg(....);
int result=mdlg.exec();
The actuall exec call is a blocking call , meaning it should not return until the dialog is dismissed.
I implemented this using my own mini-event loop which looks like:
- Code:
int WR_ModalDialog::exec()
{
// Some prolog code here ...
while(iActive)
{
// Doing my windowing processing here
if (GDERR_FRAMETIMEOVERFLOW == wrApp->m_timer.WaitForNextFrame())
{
Sleep(1);
}
wrApp->display()->Flip();
}
// Some other code here ...
return iRetValue;
}
This is basically copy of CGapiApplication internal thread function.
Again, since all the processing in my little toolkit originates from CGapiApplication::processNextFrame() call, it should in effect end up as sort of inner
while() loop inside of CGapiApplication::ThreadFunc(LPVOID pParam) function,
I am just wondering if this is the correct way of doing this kind of processing and if there is something else CGAPi is doing behind my back I should know about ?
Thanks
- Code: