Merge branch 'master' of github.com:bkaradzic/bgfx

This commit is contained in:
bkaradzic 2014-01-24 22:38:43 -08:00
commit 47ce754e16
2 changed files with 8 additions and 5 deletions

View file

@ -186,15 +186,16 @@ namespace entry
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
{ {
const SDL_MouseMotionEvent& mev = event.motion; const SDL_MouseMotionEvent& mev = event.motion;
int32_t mx = mev.xrel; m_eventQueue.postMouseEvent(mev.x, mev.y);
int32_t my = mev.yrel;
m_eventQueue.postMouseEvent(mx, my);
} }
break; break;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
{
const SDL_MouseButtonEvent& mev = event.button;
m_eventQueue.postMouseEvent(mev.x, mev.y, MouseButton::Left, mev.type == SDL_MOUSEBUTTONDOWN);
}
break; break;
case SDL_KEYDOWN: case SDL_KEYDOWN:
@ -269,6 +270,7 @@ namespace entry
void setMousePos(int32_t _mx, int32_t _my) void setMousePos(int32_t _mx, int32_t _my)
{ {
BX_UNUSED(_mx, _my);
} }
void setMouseLock(bool _lock) void setMouseLock(bool _lock)
@ -371,6 +373,7 @@ namespace entry
int main(int _argc, const char* _argv[]) int main(int _argc, const char* _argv[])
{ {
BX_UNUSED(_argc, _argv);
using namespace entry; using namespace entry;
s_ctx.run(); s_ctx.run();
return 0; return 0;

View file

@ -106,7 +106,7 @@ namespace bgfx
{ {
SDL_SysWMinfo wmi; SDL_SysWMinfo wmi;
SDL_VERSION(&wmi.version); SDL_VERSION(&wmi.version);
if (-1 == SDL_GetWindowWMInfo(_window, &wmi) ) if (!SDL_GetWindowWMInfo(_window, &wmi) )
{ {
return false; return false;
} }