| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include "BsGLSupport.h"
- #include "BsGLTexture.h"
- #include "GL/glew.h"
- GLenum GLEWAPIENTRY glewContextInit(BansheeEngine::GLSupport *glSupport);
- namespace BansheeEngine
- {
- void GLSupport::initializeExtensions()
- {
- glewContextInit(this);
- // Set version string
- const GLubyte* pcVer = glGetString(GL_VERSION);
- assert(pcVer && "Problems getting GL version string using glGetString");
-
- String tmpStr = (const char*)pcVer;
- mVersion = tmpStr.substr(0, tmpStr.find(" "));
- // Get vendor
- const GLubyte* pcVendor = glGetString(GL_VENDOR);
- tmpStr = (const char*)pcVendor;
- mVendor = tmpStr.substr(0, tmpStr.find(" "));
- // Set extension list
- int numExtensions = 0;
- glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
- for (int i = 0; i < numExtensions; i++)
- {
- extensionList.insert(String((char*)glGetStringi(GL_EXTENSIONS, i)));
- }
- }
- bool GLSupport::checkExtension(const String& ext) const
- {
- if(extensionList.find(ext) == extensionList.end())
- return false;
-
- return true;
- }
- }
|