mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07: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:
+1
-15
@@ -653,21 +653,7 @@ else()
|
||||
include_directories(Externals/SOIL)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
find_library(GLEW glew32s PATHS Externals/GLew)
|
||||
include_directories(Externals/GLew/include)
|
||||
else()
|
||||
if(NOT USE_GLES3)
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
include(FindGLEW)
|
||||
endif()
|
||||
if(NOT GLEW_FOUND OR NOT GLEW_HAS_1_10_METHODS)
|
||||
message("Using static GLEW from Externals")
|
||||
add_subdirectory(Externals/GLew)
|
||||
include_directories(Externals/GLew/include)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
include_directories(Externals/GL)
|
||||
|
||||
if (ANDROID)
|
||||
message("Using static iconv from Externals")
|
||||
|
||||
Vendored
+2194
File diff suppressed because it is too large
Load Diff
Vendored
+11024
File diff suppressed because it is too large
Load Diff
Vendored
-1034
File diff suppressed because it is too large
Load Diff
Vendored
-24
@@ -1,24 +0,0 @@
|
||||
#ifndef __gl3ext_h_
|
||||
#define __gl3ext_h_
|
||||
|
||||
/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* OpenGL ES 3 Extensions
|
||||
*
|
||||
* After an OES extension's interactions with OpenGl ES 3.0 have been documented,
|
||||
* its tokens and function definitions should be added to this file in a manner
|
||||
* that does not conflict with gl2ext.h or gl3.h.
|
||||
*
|
||||
* Tokens and function definitions for extensions that have become standard
|
||||
* features in OpenGL ES 3.0 will not be added to this file.
|
||||
*
|
||||
* Applications using OpenGL-ES-2-only extensions should include gl2ext.h
|
||||
*/
|
||||
|
||||
#endif /* __gl3ext_h_ */
|
||||
|
||||
Vendored
-30
@@ -1,30 +0,0 @@
|
||||
#ifndef __gl3platform_h_
|
||||
#define __gl3platform_h_
|
||||
|
||||
/* $Revision: 18437 $ on $Date:: 2012-07-08 23:31:39 -0700 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __gl3platform_h_ */
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
include_directories(include)
|
||||
|
||||
set(SRCS src/glew.c)
|
||||
|
||||
add_library(GLEW STATIC ${SRCS})
|
||||
Vendored
-59
@@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\glew.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\GL\glew.h" />
|
||||
<ClInclude Include="include\GL\wglew.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{2A3F751D-69E9-45F2-9199-9A00BFB6CC72}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration">
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\..\Source\VSProps\Base.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>GLEW_STATIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\glew.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\GL\glew.h" />
|
||||
<ClInclude Include="include\GL\wglew.h" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Vendored
-18062
File diff suppressed because it is too large
Load Diff
Vendored
-1669
File diff suppressed because it is too large
Load Diff
Vendored
-1421
File diff suppressed because it is too large
Load Diff
Vendored
-18123
File diff suppressed because it is too large
Load Diff
Vendored
-10681
File diff suppressed because it is too large
Load Diff
Vendored
-1178
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
|
||||
@@ -28,6 +28,7 @@ class cInterfaceAGL : public cInterfaceBase
|
||||
{
|
||||
public:
|
||||
void Swap();
|
||||
void* GetProcAddress(std::string name);
|
||||
bool Create(void *&window_handle);
|
||||
bool MakeCurrent();
|
||||
bool ClearCurrent();
|
||||
|
||||
@@ -35,6 +35,11 @@ void cInterfaceEGL::SwapInterval(int Interval)
|
||||
eglSwapInterval(GLWin.egl_dpy, Interval);
|
||||
}
|
||||
|
||||
void* cInterfaceEGL::GetProcAddress(std::string name)
|
||||
{
|
||||
return (void*)eglGetProcAddress(name.c_str());
|
||||
}
|
||||
|
||||
// Create rendering window.
|
||||
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
|
||||
bool cInterfaceEGL::Create(void *&window_handle)
|
||||
|
||||
@@ -18,11 +18,7 @@
|
||||
#define _INTERFACEEGL_H_
|
||||
|
||||
#if USE_GLES
|
||||
#ifdef USE_GLES3
|
||||
#include <GLES3/gl3.h>
|
||||
#else
|
||||
#include <GLES2/gl2.h>
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#else
|
||||
#include <GL/glxew.h>
|
||||
#include <GL/gl.h>
|
||||
@@ -41,6 +37,7 @@ public:
|
||||
void SwapInterval(int Interval);
|
||||
void Swap();
|
||||
void UpdateFPSDisplay(const char *Text);
|
||||
void* GetProcAddress(std::string name);
|
||||
bool Create(void *&window_handle);
|
||||
bool MakeCurrent();
|
||||
void Shutdown();
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
#include "../GLInterface.h"
|
||||
#include "GLX.h"
|
||||
|
||||
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI = NULL;
|
||||
|
||||
// Show the current FPS
|
||||
void cInterfaceGLX::UpdateFPSDisplay(const char *text)
|
||||
{
|
||||
@@ -35,6 +38,10 @@ void cInterfaceGLX::SwapInterval(int Interval)
|
||||
else
|
||||
ERROR_LOG(VIDEO, "No support for SwapInterval (framerate clamped to monitor refresh rate).");
|
||||
}
|
||||
void* cInterfaceGLX::GetProcAddress(std::string name)
|
||||
{
|
||||
return (void*)glXGetProcAddress((const GLubyte*)name.c_str());
|
||||
}
|
||||
|
||||
void cInterfaceGLX::Swap()
|
||||
{
|
||||
@@ -116,6 +123,7 @@ bool cInterfaceGLX::Create(void *&window_handle)
|
||||
PanicAlert("Unable to create GLX context.");
|
||||
return false;
|
||||
}
|
||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)GLInterface->GetProcAddress("glXSwapIntervalSGI");
|
||||
|
||||
GLWin.x = _tx;
|
||||
GLWin.y = _ty;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user