mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix some issues with mt_opengl
This commit is contained in:
parent
1fb7202028
commit
a799a54894
3 changed files with 46 additions and 24 deletions
|
@ -5,7 +5,7 @@
|
|||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
OpenGLProcedures GL = OpenGLProcedures();
|
||||
OpenGLProcedures GL;
|
||||
|
||||
void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr)
|
||||
{
|
||||
|
@ -758,9 +758,11 @@ void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr)
|
|||
if (!NamedBufferPageCommitment) NamedBufferPageCommitment = (PFNGLNAMEDBUFFERPAGECOMMITMENTPROC_MT)cmgr->getProcAddress("glNamedBufferPageCommitmentARB");
|
||||
if (!TexPageCommitment) TexPageCommitment = (PFNGLTEXPAGECOMMITMENTPROC_MT)cmgr->getProcAddress("glTexPageCommitmentARB");
|
||||
|
||||
// OpenGL 3 way to enumerate extensions
|
||||
/* OpenGL 3 & ES 3 way to enumerate extensions */
|
||||
GLint ext_count = 0;
|
||||
GetIntegerv(NUM_EXTENSIONS, &ext_count);
|
||||
// clear error which is raised if unsupported
|
||||
while (GetError() != GL.NO_ERROR) {}
|
||||
extensions.reserve(ext_count);
|
||||
for (GLint k = 0; k < ext_count; k++) {
|
||||
auto tmp = GetStringi(EXTENSIONS, k);
|
||||
|
@ -770,14 +772,13 @@ void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr)
|
|||
if (!extensions.empty())
|
||||
return;
|
||||
|
||||
// OpenGL 2 / ES 2 way to enumerate extensions
|
||||
/* OpenGL 2 / ES 2 way to enumerate extensions */
|
||||
auto ext_str = GetString(EXTENSIONS);
|
||||
if (!ext_str)
|
||||
return;
|
||||
// get the extension string, chop it up
|
||||
std::stringstream ext_ss((char*)ext_str);
|
||||
std::istringstream ext_ss((char*)ext_str);
|
||||
std::string tmp;
|
||||
while (std::getline(ext_ss, tmp, ' '))
|
||||
extensions.emplace(tmp);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue