Commit ebf3a273 authored by hybrid's avatar hybrid

Support externally created windows under Linux. Patch submitted by cyberwan.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1231 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 0672eea6
This diff is collapsed.
...@@ -50,7 +50,7 @@ namespace irr ...@@ -50,7 +50,7 @@ namespace irr
CIrrDeviceLinux(video::E_DRIVER_TYPE deviceType, CIrrDeviceLinux(video::E_DRIVER_TYPE deviceType,
const core::dimension2d<s32>& windowSize, u32 bits, const core::dimension2d<s32>& windowSize, u32 bits,
bool fullscreen, bool stencilbuffer, bool vsync, bool antiAlias, IEventReceiver* receiver, bool fullscreen, bool stencilbuffer, bool vsync, bool antiAlias, IEventReceiver* receiver,
const char* version); Window window, const char* version);
//! destructor //! destructor
virtual ~CIrrDeviceLinux(); virtual ~CIrrDeviceLinux();
...@@ -90,7 +90,8 @@ namespace irr ...@@ -90,7 +90,8 @@ namespace irr
void createDriver(const core::dimension2d<s32>& windowSize, void createDriver(const core::dimension2d<s32>& windowSize,
bool vsync); bool vsync);
bool createWindow(const core::dimension2d<s32>& windowSize, u32 bits); bool createWindow(const core::dimension2d<s32>& windowSize, u32 bits,
Window externalWindow);
void createKeyMap(); void createKeyMap();
...@@ -184,20 +185,20 @@ namespace irr ...@@ -184,20 +185,20 @@ namespace irr
{ {
XWarpPointer(Device->display, XWarpPointer(Device->display,
None, None,
Device->window, 0, 0, Device->window, 0, 0,
Device->Width, Device->Width,
Device->Height, Device->Height,
ReferenceRect.UpperLeftCorner.X + x, ReferenceRect.UpperLeftCorner.X + x,
ReferenceRect.UpperLeftCorner.Y + y); ReferenceRect.UpperLeftCorner.Y + y);
} }
else else
{ {
XWarpPointer(Device->display, XWarpPointer(Device->display,
None, None,
Device->window, 0, 0, Device->window, 0, 0,
Device->Width, Device->Width,
Device->Height, x, y); Device->Height, x, y);
} }
XFlush(Device->display); XFlush(Device->display);
} }
...@@ -217,7 +218,7 @@ namespace irr ...@@ -217,7 +218,7 @@ namespace irr
virtual core::position2d<f32> getRelativePosition() virtual core::position2d<f32> getRelativePosition()
{ {
updateCursorPos(); updateCursorPos();
if (!UseReferenceRect) if (!UseReferenceRect)
{ {
return core::position2d<f32>(CursorPos.X / (f32)Device->Width, return core::position2d<f32>(CursorPos.X / (f32)Device->Width,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment