summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-02 19:42:02 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-02 19:42:02 +0300
commite8f92c8a476c35f76212ccaccbbb55901a49058e (patch)
tree741bdd9b2068ded23ab92a06586422b400c53d24 /src/graphics.cpp
parent2d0696abd547cf00fda04f070fb713c92acaf91b (diff)
downloadmv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.gz
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.bz2
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.tar.xz
mv-e8f92c8a476c35f76212ccaccbbb55901a49058e.zip
Add "no frame" option to hide window frame. Disabled by default.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 30aece5dc..5848d8c14 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -49,7 +49,8 @@ Graphics::Graphics():
mDoubleBuffer(false),
mSecure(false),
mOpenGL(0),
- mEnableResize(false)
+ mEnableResize(false),
+ mNoFrame(false)
{
mRect.x = 0;
mRect.y = 0;
@@ -63,7 +64,7 @@ Graphics::~Graphics()
}
bool Graphics::setVideoMode(int w, int h, int bpp, bool fs,
- bool hwaccel, bool resize)
+ bool hwaccel, bool resize, bool noFrame)
{
logger->log("Setting video mode %dx%d %s",
w, h, fs ? "fullscreen" : "windowed");
@@ -76,6 +77,7 @@ bool Graphics::setVideoMode(int w, int h, int bpp, bool fs,
mFullscreen = fs;
mHWAccel = hwaccel;
mEnableResize = resize;
+ mNoFrame = noFrame;
if (fs)
displayFlags |= SDL_FULLSCREEN;
@@ -87,6 +89,9 @@ bool Graphics::setVideoMode(int w, int h, int bpp, bool fs,
else
displayFlags |= SDL_SWSURFACE;
+ if (noFrame)
+ displayFlags |= SDL_NOFRAME;
+
setTarget(SDL_SetVideoMode(w, h, bpp, displayFlags));
if (!mTarget)
@@ -143,7 +148,8 @@ bool Graphics::setFullscreen(bool fs)
if (mFullscreen == fs)
return true;
- return setVideoMode(mWidth, mHeight, mBpp, fs, mHWAccel, mEnableResize);
+ return setVideoMode(mWidth, mHeight, mBpp, fs, mHWAccel,
+ mEnableResize, mNoFrame);
}
bool Graphics::resizeScreen(int width, int height)
@@ -157,14 +163,14 @@ bool Graphics::resizeScreen(int width, int height)
_endDraw();
bool success = setVideoMode(width, height, mBpp,
- mFullscreen, mHWAccel, mEnableResize);
+ mFullscreen, mHWAccel, mEnableResize, mNoFrame);
// If it didn't work, try to restore the previous size. If that didn't
// work either, bail out (but then we're in deep trouble).
if (!success)
{
if (!setVideoMode(prevWidth, prevHeight, mBpp,
- mFullscreen, mHWAccel, mEnableResize))
+ mFullscreen, mHWAccel, mEnableResize, mNoFrame))
{
return false;
}