aboutsummaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index 5b0de1305..797a2cf39 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -570,16 +570,20 @@ void setXorgClassHint(const video::SExposedVideoData &video_data,
}
#ifndef SERVER
+
v2u32 getWindowSize()
{
return device->getVideoDriver()->getScreenSize();
}
-std::vector<core::vector3d<u32> > getVideoModes()
+std::vector<core::vector3d<u32> > getSupportedVideoModes()
{
+ IrrlichtDevice *nulldevice = createDevice(video::EDT_NULL);
+ sanity_check(nulldevice != NULL);
+
std::vector<core::vector3d<u32> > mlist;
- video::IVideoModeList *modelist = device->getVideoModeList();
+ video::IVideoModeList *modelist = nulldevice->getVideoModeList();
u32 num_modes = modelist->getVideoModeCount();
for (u32 i = 0; i != num_modes; i++) {
@@ -588,6 +592,8 @@ std::vector<core::vector3d<u32> > getVideoModes()
mlist.push_back(core::vector3d<u32>(mode_res.Width, mode_res.Height, mode_depth));
}
+ nulldevice->drop();
+
return mlist;
}