[GLExtensions] Remove AGL GetProcAddress. Change dlsym to using RTLD_NEXT. Enable dlsym fallback for OS X

This commit is contained in:
Ryan Houdek
2014-01-06 22:16:03 -06:00
committed by degasus
parent ca96274936
commit 34c9a33807
3 changed files with 2 additions and 32 deletions

View File

@ -21,37 +21,16 @@
#include "ConfigManager.h"
#include <wx/panel.h>
#import <mach-o/dyld.h>
#include "VertexShaderManager.h"
#include "../GLInterface.h"
#include "AGL.h"
// Copied from
// https://developer.apple.com/library/mac/documentation/graphicsimaging/conceptual/opengl-macprogguide/opengl_entrypts/opengl_entrypts.html
void* NSGLGetProcAddress (const char *name)
{
NSSymbol symbol;
char* symbolName;
symbolName = (char*)malloc(strlen (name) + 2); // 1
strcpy(symbolName + 1, name); // 2
symbolName[0] = '_'; // 3
symbol = NULL;
if (NSIsSymbolNameDefined (symbolName)) // 4
symbol = NSLookupAndBindSymbol (symbolName);
free (symbolName); // 5
return symbol ? NSAddressOfSymbol (symbol) : NULL; // 6
}
void cInterfaceAGL::Swap()
{
[GLWin.cocoaCtx flushBuffer];
}
void* cInterfaceAGL::GetProcAddress(std::string name)
{
return NSGLGetProcAddress(name.c_str());
}
// Create rendering window.
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceAGL::Create(void *&window_handle)

View File

@ -27,7 +27,6 @@ class cInterfaceAGL : public cInterfaceBase
{
public:
void Swap();
void* GetProcAddress(std::string name);
bool Create(void *&window_handle);
bool MakeCurrent();
bool ClearCurrent();