Revert "GLInterface: Fix VideoSW on linux + OSX"
This commit is contained in:
parent
3f56480903
commit
a7e9a154a5
|
@ -15,7 +15,7 @@ void cInterfaceAGL::Swap()
|
||||||
|
|
||||||
// Create rendering window.
|
// Create rendering window.
|
||||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||||
bool cInterfaceAGL::Create(void *window_handle, bool core)
|
bool cInterfaceAGL::Create(void *window_handle)
|
||||||
{
|
{
|
||||||
cocoaWin = reinterpret_cast<NSView*>(window_handle);
|
cocoaWin = reinterpret_cast<NSView*>(window_handle);
|
||||||
NSSize size = [cocoaWin frame].size;
|
NSSize size = [cocoaWin frame].size;
|
||||||
|
@ -33,7 +33,7 @@ bool cInterfaceAGL::Create(void *window_handle, bool core)
|
||||||
s_backbuffer_width = size.width;
|
s_backbuffer_width = size.width;
|
||||||
s_backbuffer_height = size.height;
|
s_backbuffer_height = size.height;
|
||||||
|
|
||||||
NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLPFAAccelerated, core ? NSOpenGLProfileVersion3_2Core : 0u, 0u };
|
NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 };
|
||||||
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
|
NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc]
|
||||||
initWithAttributes: attr];
|
initWithAttributes: attr];
|
||||||
if (fmt == nil)
|
if (fmt == nil)
|
||||||
|
|
|
@ -17,7 +17,7 @@ private:
|
||||||
NSOpenGLContext *cocoaCtx;
|
NSOpenGLContext *cocoaCtx;
|
||||||
public:
|
public:
|
||||||
void Swap();
|
void Swap();
|
||||||
bool Create(void *window_handle, bool core);
|
bool Create(void *window_handle);
|
||||||
bool MakeCurrent();
|
bool MakeCurrent();
|
||||||
bool ClearCurrent();
|
bool ClearCurrent();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
|
@ -96,7 +96,7 @@ void cInterfaceEGL::DetectMode()
|
||||||
|
|
||||||
// Create rendering window.
|
// Create rendering window.
|
||||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||||
bool cInterfaceEGL::Create(void *window_handle, bool core)
|
bool cInterfaceEGL::Create(void *window_handle)
|
||||||
{
|
{
|
||||||
const char *s;
|
const char *s;
|
||||||
EGLint egl_major, egl_minor;
|
EGLint egl_major, egl_minor;
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
void Swap();
|
void Swap();
|
||||||
void SetMode(u32 mode) { s_opengl_mode = mode; }
|
void SetMode(u32 mode) { s_opengl_mode = mode; }
|
||||||
void* GetFuncAddress(const std::string& name);
|
void* GetFuncAddress(const std::string& name);
|
||||||
bool Create(void *window_handle, bool core);
|
bool Create(void *window_handle);
|
||||||
bool MakeCurrent();
|
bool MakeCurrent();
|
||||||
bool ClearCurrent();
|
bool ClearCurrent();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
|
@ -44,7 +44,7 @@ void cInterfaceGLX::Swap()
|
||||||
|
|
||||||
// Create rendering window.
|
// Create rendering window.
|
||||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||||
bool cInterfaceGLX::Create(void *window_handle, bool core)
|
bool cInterfaceGLX::Create(void *window_handle)
|
||||||
{
|
{
|
||||||
dpy = XOpenDisplay(nullptr);
|
dpy = XOpenDisplay(nullptr);
|
||||||
int screen = DefaultScreen(dpy);
|
int screen = DefaultScreen(dpy);
|
||||||
|
@ -107,13 +107,9 @@ bool cInterfaceGLX::Create(void *window_handle, bool core)
|
||||||
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
ctx = nullptr;
|
ctx = glXCreateContextAttribs(dpy, fbconfig, 0, True, context_attribs);
|
||||||
if (core)
|
XSync(dpy, False);
|
||||||
{
|
if (!ctx || s_glxError)
|
||||||
ctx = glXCreateContextAttribs(dpy, fbconfig, 0, True, context_attribs);
|
|
||||||
XSync(dpy, False);
|
|
||||||
}
|
|
||||||
if (core && (!ctx || s_glxError))
|
|
||||||
{
|
{
|
||||||
int context_attribs_33[] =
|
int context_attribs_33[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
void SwapInterval(int Interval) override;
|
void SwapInterval(int Interval) override;
|
||||||
void Swap() override;
|
void Swap() override;
|
||||||
void* GetFuncAddress(const std::string& name) override;
|
void* GetFuncAddress(const std::string& name) override;
|
||||||
bool Create(void *window_handle, bool core) override;
|
bool Create(void *window_handle) override;
|
||||||
bool MakeCurrent() override;
|
bool MakeCurrent() override;
|
||||||
bool ClearCurrent() override;
|
bool ClearCurrent() override;
|
||||||
void Shutdown() override;
|
void Shutdown() override;
|
||||||
|
|
|
@ -57,7 +57,7 @@ bool cInterfaceWGL::PeekMessages()
|
||||||
|
|
||||||
// Create rendering window.
|
// Create rendering window.
|
||||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||||
bool cInterfaceWGL::Create(void *window_handle, bool core)
|
bool cInterfaceWGL::Create(void *window_handle)
|
||||||
{
|
{
|
||||||
if (window_handle == nullptr)
|
if (window_handle == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -13,7 +13,7 @@ public:
|
||||||
void SwapInterval(int Interval);
|
void SwapInterval(int Interval);
|
||||||
void Swap();
|
void Swap();
|
||||||
void* GetFuncAddress(const std::string& name);
|
void* GetFuncAddress(const std::string& name);
|
||||||
bool Create(void *window_handle, bool core);
|
bool Create(void *window_handle);
|
||||||
bool MakeCurrent();
|
bool MakeCurrent();
|
||||||
bool ClearCurrent();
|
bool ClearCurrent();
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
|
@ -29,7 +29,7 @@ public:
|
||||||
virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; }
|
virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; }
|
||||||
virtual u32 GetMode() { return s_opengl_mode; }
|
virtual u32 GetMode() { return s_opengl_mode; }
|
||||||
virtual void* GetFuncAddress(const std::string& name) { return nullptr; }
|
virtual void* GetFuncAddress(const std::string& name) { return nullptr; }
|
||||||
virtual bool Create(void *window_handle, bool core = true) { return true; }
|
virtual bool Create(void *window_handle) { return true; }
|
||||||
virtual bool MakeCurrent() { return true; }
|
virtual bool MakeCurrent() { return true; }
|
||||||
virtual bool ClearCurrent() { return true; }
|
virtual bool ClearCurrent() { return true; }
|
||||||
virtual void Shutdown() {}
|
virtual void Shutdown() {}
|
||||||
|
|
|
@ -78,7 +78,7 @@ bool VideoSoftware::Initialize(void *window_handle)
|
||||||
|
|
||||||
InitInterface();
|
InitInterface();
|
||||||
GLInterface->SetMode(GLInterfaceMode::MODE_DETECT);
|
GLInterface->SetMode(GLInterfaceMode::MODE_DETECT);
|
||||||
if (!GLInterface->Create(window_handle, false))
|
if (!GLInterface->Create(window_handle))
|
||||||
{
|
{
|
||||||
INFO_LOG(VIDEO, "GLInterface::Create failed.");
|
INFO_LOG(VIDEO, "GLInterface::Create failed.");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue