MCPcopy Create free account
hub / github.com/cginternals/glbinding / request

Function request

source/tools/glqueries/main.cpp:165–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164 template <typename T, size_t count>
165 bool request(const GLenum pname, std::array<T, count> & data)
166 {
167 glrequest<T>(pname, data.data());
168
169 static const size_t MAX_PSTRING_LENGTH { 37 }; // actually, it's 44 / average is 23,
170 // but 37 works for 452 of 462 glGet enums (98%)
171
172 const std::string pstring{ glbinding::aux::Meta::getString(pname) };
173 const std::string spaces{ std::string((glbinding::aux::Meta::getString(pname).length() > 37) ? 0 : (MAX_PSTRING_LENGTH - pstring.length()), ' ') };
174
175 if (glGetError() != gl::GL_NO_ERROR)
176 {
177 std::cout << "\t" << pstring << spaces << " = NOT AVAILABLE";
178 return false;
179 }
180 std::cout << "\t" << glbinding::aux::Meta::getString(pname) << spaces << " = " << string<T, count>(data);
181 return true;
182 }
183
184 template <typename T>
185 bool request(const GLenum pname, std::vector<T> & data, size_t count)

Callers

nothing calls this directly

Calls 4

stringFunction · 0.85
glGetErrorFunction · 0.85
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected