Allow to use openglrecorder with gles
This commit is contained in:
parent
2958435f7c
commit
056ee641d1
@ -26,7 +26,7 @@ option(USE_SYSTEM_ENET "Use system ENET instead of the built-in version, when av
|
||||
option(USE_SYSTEM_GLEW "Use system GLEW instead of the built-in version, when available." ON)
|
||||
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_RECORDER "Build opengl recorder" ON
|
||||
"NOT SERVER_ONLY;NOT USE_GLES2;NOT APPLE" OFF)
|
||||
"NOT SERVER_ONLY;NOT APPLE" OFF)
|
||||
|
||||
if((UNIX AND NOT APPLE) AND NOT SERVER_ONLY)
|
||||
option(ENABLE_WAYLAND_DEVICE "Enable Wayland device for linux build" ON)
|
||||
|
@ -200,6 +200,7 @@ void CentralVideoSettings::init()
|
||||
hasSamplerObjects = true;
|
||||
hasVertexType2101010Rev = true;
|
||||
hasInstancedArrays = true;
|
||||
hasPixelBufferObject = true;
|
||||
}
|
||||
|
||||
if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_EXPLICIT_ATTRIB_LOCATION) &&
|
||||
|
@ -616,6 +616,7 @@ void IrrDriver::initDevice()
|
||||
(int x, int y, int w, int h, unsigned int f, unsigned int t, void* d)
|
||||
{ glReadPixels(x, y, w, h, f, t, d); });
|
||||
|
||||
#ifndef USE_GLES2
|
||||
ogrRegPBOFunctions([](int n, unsigned int* b) { glGenBuffers(n, b); },
|
||||
[](unsigned int t, unsigned int b) { glBindBuffer(t, b); },
|
||||
[](unsigned int t, ptrdiff_t s, const void* d, unsigned int u)
|
||||
@ -623,6 +624,16 @@ void IrrDriver::initDevice()
|
||||
[](int n, const unsigned int* b) { glDeleteBuffers(n, b); },
|
||||
[](unsigned int t, unsigned int a) { return glMapBuffer(t, a); },
|
||||
[](unsigned int t) { return glUnmapBuffer(t); });
|
||||
#else
|
||||
ogrRegPBOFunctionsRange([](int n, unsigned int* b) { glGenBuffers(n, b); },
|
||||
[](unsigned int t, unsigned int b) { glBindBuffer(t, b); },
|
||||
[](unsigned int t, ptrdiff_t s, const void* d, unsigned int u)
|
||||
{ glBufferData(t, s, d, u); },
|
||||
[](int n, const unsigned int* b) { glDeleteBuffers(n, b); },
|
||||
[](unsigned int t, ptrdiff_t o, ptrdiff_t l, unsigned int a)
|
||||
{ return glMapBufferRange(t, o, l, a); },
|
||||
[](unsigned int t) { return glUnmapBuffer(t); });
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user