mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 02:29:59 -06:00
[GLExtensions] Initial code drop for GLExtensions. This drops GLEW entirely from the codebase. This has been tested on Android and Linux+ATI. Of course untested on Windows and Apple. Also untested with Linux + EGL but should be fine there. There are most likely a couple of extensions I'm missing which would result in null pointer runs but not bad for the initial commit.
Conflicts: CMakeLists.txt Externals/GLew/glew.vcxproj Externals/GLew/glew.vcxproj.filters Source/Core/VideoBackends/OGL/CMakeLists.txt Source/Core/VideoBackends/OGL/GLFunctions.cpp Source/Core/VideoBackends/OGL/GLFunctions.h Source/Core/VideoBackends/OGL/GLUtil.h Source/Core/VideoBackends/OGL/Render.cpp Source/VSProps/Base.props
This commit is contained in:
@ -26,11 +26,31 @@
|
||||
#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 = 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)
|
||||
|
Reference in New Issue
Block a user