mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 14:26:06 +02:00
Resync mt_opengl_loader.cpp with BindingGenerator.lua
also add a warning that you can't edit it by hand
This commit is contained in:
@ -410,6 +410,9 @@ f:close();
|
||||
-- Write loader implementation
|
||||
f = io.open( sourceTreePath .. "/source/Irrlicht/mt_opengl_loader.cpp", "wb" );
|
||||
f:write[[
|
||||
// This code was generated by scripts/BindingGenerator.lua
|
||||
// Do not modify it, modify and run the generator instead.
|
||||
|
||||
#include "mt_opengl.h"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
@ -423,9 +426,21 @@ void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr)
|
||||
f:write( loader:Concat() );
|
||||
f:write[[
|
||||
|
||||
// OpenGL 3 way to enumerate extensions
|
||||
int ext_count = 0;
|
||||
GetIntegerv(NUM_EXTENSIONS, &ext_count);
|
||||
extensions.reserve(ext_count);
|
||||
for (int k = 0; k < ext_count; k++)
|
||||
extensions.emplace((char *)GetStringi(EXTENSIONS, k));
|
||||
if (ext_count)
|
||||
return;
|
||||
|
||||
// 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::string ext_string = std::string((char*)GetString(EXTENSIONS));
|
||||
std::stringstream ext_ss(ext_string);
|
||||
std::stringstream ext_ss((char*)ext_str);
|
||||
std::string tmp;
|
||||
while (std::getline(ext_ss, tmp, ' '))
|
||||
extensions.emplace(tmp);
|
||||
|
Reference in New Issue
Block a user