mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
OpenGL3: new version format
This commit is contained in:
@ -32,5 +32,19 @@ namespace video
|
||||
typedef COpenGLCoreRenderTarget<COpenGL3DriverBase, COpenGL3Texture> COpenGL3RenderTarget;
|
||||
typedef COpenGLCoreCacheHandler<COpenGL3DriverBase, COpenGL3Texture> COpenGL3CacheHandler;
|
||||
|
||||
enum class OpenGLSpec: u8 {
|
||||
Core,
|
||||
Compat,
|
||||
ES,
|
||||
// WebGL, // TODO
|
||||
};
|
||||
|
||||
struct OpenGLVersion {
|
||||
OpenGLSpec Spec;
|
||||
u8 Major;
|
||||
u8 Minor;
|
||||
u8 Release;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -203,8 +203,7 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
||||
QuadIndexCount = QuadsIndices.size();
|
||||
}
|
||||
|
||||
bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)
|
||||
{
|
||||
void COpenGL3DriverBase::initVersion() {
|
||||
Name = glGetString(GL_VERSION);
|
||||
printVersion();
|
||||
|
||||
@ -212,7 +211,12 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
||||
VendorName = glGetString(GL_VENDOR);
|
||||
os::Printer::log(VendorName.c_str(), ELL_INFORMATION);
|
||||
|
||||
// load extensions
|
||||
Version = getVersionFromOpenGL();
|
||||
}
|
||||
|
||||
bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)
|
||||
{
|
||||
initVersion();
|
||||
initExtensions();
|
||||
|
||||
// reset cache handler
|
||||
@ -231,7 +235,7 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
|
||||
DriverAttributes->setAttribute("MaxIndices", (s32)MaxIndices);
|
||||
DriverAttributes->setAttribute("MaxTextureSize", (s32)MaxTextureSize);
|
||||
DriverAttributes->setAttribute("MaxTextureLODBias", MaxTextureLODBias);
|
||||
DriverAttributes->setAttribute("Version", Version);
|
||||
DriverAttributes->setAttribute("Version", 100 * Version.Major + Version.Minor);
|
||||
DriverAttributes->setAttribute("AntiAlias", AntiAlias);
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||
|
@ -285,6 +285,9 @@ namespace video
|
||||
//! inits the opengl-es driver
|
||||
virtual bool genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer);
|
||||
|
||||
void initVersion();
|
||||
virtual OpenGLVersion getVersionFromOpenGL() const = 0;
|
||||
|
||||
void chooseMaterial2D();
|
||||
|
||||
ITexture* createDeviceDependentTexture(const io::path& name, IImage* image) override;
|
||||
@ -341,6 +344,7 @@ namespace video
|
||||
core::stringw Name;
|
||||
core::stringc VendorName;
|
||||
SIrrlichtCreationParameters Params;
|
||||
OpenGLVersion Version;
|
||||
|
||||
//! bool to make all renderstates reset if set to true.
|
||||
bool ResetRenderStates;
|
||||
|
Reference in New Issue
Block a user