1
Feature requests / Re: Next modules
« on: June 04, 2013, 02:34:09 am »
other libraries?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
while(mySFMLwindow.Run()
{
while(mySFMLwindow.GetEvent())
{ }
MSG Message;
while (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
//cross platform stuff of the library
if( keyboard ) //keyborad enabled
{
keyboard ->capture(); //capture the event
if( !keyboard ->buffered() )
handleUnBufferedKeys();
}
//some rendering
}
all OSes allow windows events to be dispatched to multiple listeners
Why? Your library should be able to work even if SFML continues to process events on its side.
Why do you need to care about how SFML handles events internally? Can't you just ignore SFML events and use your library directly in your code?
while(myWindow->isOpened())
{
keyboard->capture();
//other SFML & openGL stuff
}
void WindowImplWin32::processEvents()
{
// We update the window only if we own it
if (!myCallback)
{
MSG Message;
while (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
}
}
MSG Message;
while (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage(&Message);
DispatchMessage(&Message);
}
///the following piece of code will be ideally added to "processEvents"
//cross platform stuff of the library
if( keyboard )
{
keyboard ->capture(); //capture the event
if( !keyboard ->buffered() )
handleUnBufferedKeys();
}