GSdx: window management should be redone next.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4358 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gabest11 2011-02-25 01:01:00 +00:00
parent a820423c4b
commit 959580cd2e
4 changed files with 16 additions and 17 deletions

View File

@ -131,7 +131,7 @@ EXPORT_C_(int) GSinit()
return -1;
}
#else
#endif
if(!SDL_WasInit(SDL_INIT_VIDEO))
{
@ -141,8 +141,6 @@ EXPORT_C_(int) GSinit()
}
}
#endif
return 0;
}
@ -154,6 +152,8 @@ EXPORT_C GSshutdown()
s_renderer = -1;
SDL_Quit();
#ifdef _WINDOWS
if(SUCCEEDED(s_hr))
@ -163,10 +163,6 @@ EXPORT_C GSshutdown()
s_hr = E_FAIL;
}
#else
SDL_Quit();
#endif
}

View File

@ -278,7 +278,7 @@ bool GSDevice11::Create(GSWnd* wnd)
if(m_wnd->IsManaged())
{
SetExclusive(!!theApp.GetConfig("windowed", 1));
SetExclusive(!theApp.GetConfig("windowed", 1));
}
return true;

View File

@ -23,7 +23,7 @@
#include "GSDeviceSDL.h"
GSDeviceSDL::GSDeviceSDL()
: m_init(false)
: m_free_window(false)
, m_window(NULL)
, m_renderer(NULL)
, m_texture(NULL)
@ -42,21 +42,25 @@ GSDeviceSDL::~GSDeviceSDL()
SDL_DestroyRenderer(m_renderer);
}
if(m_window != NULL)
if(m_window != NULL && m_free_window)
{
SDL_DestroyWindow(m_window);
}
if(m_init)
{
SDL_Quit();
}
}
bool GSDeviceSDL::Create(GSWnd* wnd)
{
m_window = (SDL_Window*)wnd->GetHandle();
if(m_window == wnd->GetDisplay())
{
// HACK: no SDL window
m_window = SDL_CreateWindowFrom(wnd->GetHandle());
m_free_window = true;
}
return GSDeviceSW::Create(wnd);
}

View File

@ -26,8 +26,7 @@
class GSDeviceSDL : public GSDeviceSW
{
bool m_init;
bool m_free_window;
SDL_Window* m_window;
SDL_Renderer* m_renderer;
SDL_Texture* m_texture;