};\r
\r
\r
-void APIENTRY COpenGL3Driver::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)\r
+void APIENTRY COpenGL3DriverBase::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)\r
{\r
- ((COpenGL3Driver *)userParam)->debugCb(source, type, id, severity, length, message);\r
+ ((COpenGL3DriverBase *)userParam)->debugCb(source, type, id, severity, length, message);\r
}\r
\r
-void COpenGL3Driver::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message)\r
+void COpenGL3DriverBase::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message)\r
{\r
printf("%04x %04x %x %x %.*s\n", source, type, id, severity, length, message);\r
}\r
\r
-COpenGL3Driver::COpenGL3Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) :\r
+COpenGL3DriverBase::COpenGL3DriverBase(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) :\r
CNullDriver(io, params.WindowSize), COpenGL3ExtensionHandler(), CacheHandler(0),\r
Params(params), ResetRenderStates(true), LockRenderStateMode(false), AntiAlias(params.AntiAlias),\r
MaterialRenderer2DActive(0), MaterialRenderer2DTexture(0), MaterialRenderer2DNoTexture(0),\r
initQuadsIndices();\r
}\r
\r
-COpenGL3Driver::~COpenGL3Driver()\r
+COpenGL3DriverBase::~COpenGL3DriverBase()\r
{\r
deleteMaterialRenders();\r
\r
}\r
}\r
\r
- void COpenGL3Driver::initQuadsIndices(int max_vertex_count)\r
+ void COpenGL3DriverBase::initQuadsIndices(int max_vertex_count)\r
{\r
int max_quad_count = max_vertex_count / 4;\r
QuadsIndices.reserve(6 * max_quad_count);\r
}\r
}\r
\r
- bool COpenGL3Driver::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)\r
+ bool COpenGL3DriverBase::genericDriverInit(const core::dimension2d<u32>& screenSize, bool stencilBuffer)\r
{\r
Name = glGetString(GL_VERSION);\r
printVersion();\r
return true;\r
}\r
\r
- void COpenGL3Driver::loadShaderData(const io::path& vertexShaderName, const io::path& fragmentShaderName, c8** vertexShaderData, c8** fragmentShaderData)\r
+ void COpenGL3DriverBase::loadShaderData(const io::path& vertexShaderName, const io::path& fragmentShaderName, c8** vertexShaderData, c8** fragmentShaderData)\r
{\r
io::path vsPath(OGLES2ShaderPath);\r
vsPath += vertexShaderName;\r
fsFile->drop();\r
}\r
\r
- void COpenGL3Driver::createMaterialRenderers()\r
+ void COpenGL3DriverBase::createMaterialRenderers()\r
{\r
// Create callbacks.\r
\r
delete[] fs2DData;\r
}\r
\r
- bool COpenGL3Driver::setMaterialTexture(irr::u32 layerIdx, const irr::video::ITexture* texture)\r
+ bool COpenGL3DriverBase::setMaterialTexture(irr::u32 layerIdx, const irr::video::ITexture* texture)\r
{\r
Material.TextureLayer[layerIdx].Texture = const_cast<ITexture*>(texture); // function uses const-pointer for texture because all draw functions use const-pointers already\r
return CacheHandler->getTextureCache().set(0, texture);\r
}\r
\r
- bool COpenGL3Driver::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)\r
+ bool COpenGL3DriverBase::beginScene(u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil, const SExposedVideoData& videoData, core::rect<s32>* sourceRect)\r
{\r
CNullDriver::beginScene(clearFlag, clearColor, clearDepth, clearStencil, videoData, sourceRect);\r
\r
return true;\r
}\r
\r
- bool COpenGL3Driver::endScene()\r
+ bool COpenGL3DriverBase::endScene()\r
{\r
CNullDriver::endScene();\r
\r
\r
\r
//! Returns the transformation set by setTransform\r
- const core::matrix4& COpenGL3Driver::getTransform(E_TRANSFORMATION_STATE state) const\r
+ const core::matrix4& COpenGL3DriverBase::getTransform(E_TRANSFORMATION_STATE state) const\r
{\r
return Matrices[state];\r
}\r
\r
\r
//! sets transformation\r
- void COpenGL3Driver::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat)\r
+ void COpenGL3DriverBase::setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat)\r
{\r
Matrices[state] = mat;\r
Transformation3DChanged = true;\r
}\r
\r
\r
- bool COpenGL3Driver::updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)\r
+ bool COpenGL3DriverBase::updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)\r
{\r
if (!HWBuffer)\r
return false;\r
}\r
\r
\r
- bool COpenGL3Driver::updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)\r
+ bool COpenGL3DriverBase::updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)\r
{\r
if (!HWBuffer)\r
return false;\r
\r
\r
//! updates hardware buffer if needed\r
- bool COpenGL3Driver::updateHardwareBuffer(SHWBufferLink *HWBuffer)\r
+ bool COpenGL3DriverBase::updateHardwareBuffer(SHWBufferLink *HWBuffer)\r
{\r
if (!HWBuffer)\r
return false;\r
\r
\r
//! Create hardware buffer from meshbuffer\r
- COpenGL3Driver::SHWBufferLink *COpenGL3Driver::createHardwareBuffer(const scene::IMeshBuffer* mb)\r
+ COpenGL3DriverBase::SHWBufferLink *COpenGL3DriverBase::createHardwareBuffer(const scene::IMeshBuffer* mb)\r
{\r
if (!mb || (mb->getHardwareMappingHint_Index() == scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex() == scene::EHM_NEVER))\r
return 0;\r
}\r
\r
\r
- void COpenGL3Driver::deleteHardwareBuffer(SHWBufferLink *_HWBuffer)\r
+ void COpenGL3DriverBase::deleteHardwareBuffer(SHWBufferLink *_HWBuffer)\r
{\r
if (!_HWBuffer)\r
return;\r
\r
\r
//! Draw hardware buffer\r
- void COpenGL3Driver::drawHardwareBuffer(SHWBufferLink *_HWBuffer)\r
+ void COpenGL3DriverBase::drawHardwareBuffer(SHWBufferLink *_HWBuffer)\r
{\r
if (!_HWBuffer)\r
return;\r
}\r
\r
\r
- IRenderTarget* COpenGL3Driver::addRenderTarget()\r
+ IRenderTarget* COpenGL3DriverBase::addRenderTarget()\r
{\r
COpenGL3RenderTarget* renderTarget = new COpenGL3RenderTarget(this);\r
RenderTargets.push_back(renderTarget);\r
\r
\r
//! draws a vertex primitive list\r
- void COpenGL3Driver::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
+ void COpenGL3DriverBase::drawVertexPrimitiveList(const void* vertices, u32 vertexCount,\r
const void* indexList, u32 primitiveCount,\r
E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, E_INDEX_TYPE iType)\r
{\r
}\r
\r
\r
- void COpenGL3Driver::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,\r
+ void COpenGL3DriverBase::draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,\r
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect, SColor color,\r
bool useAlphaChannelOfTexture)\r
{\r
}\r
\r
\r
- void COpenGL3Driver::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,\r
+ void COpenGL3DriverBase::draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,\r
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,\r
const video::SColor* const colors, bool useAlphaChannelOfTexture)\r
{\r
testGLError(__LINE__);\r
}\r
\r
- void COpenGL3Driver::draw2DImage(const video::ITexture* texture, u32 layer, bool flip)\r
+ void COpenGL3DriverBase::draw2DImage(const video::ITexture* texture, u32 layer, bool flip)\r
{\r
if (!texture)\r
return;\r
drawQuad(vt2DImage, quad2DVertices);\r
}\r
\r
- void COpenGL3Driver::draw2DImageBatch(const video::ITexture* texture,\r
+ void COpenGL3DriverBase::draw2DImageBatch(const video::ITexture* texture,\r
const core::array<core::position2d<s32> >& positions,\r
const core::array<core::rect<s32> >& sourceRects,\r
const core::rect<s32>* clipRect,\r
\r
\r
//! draw a 2d rectangle\r
- void COpenGL3Driver::draw2DRectangle(SColor color,\r
+ void COpenGL3DriverBase::draw2DRectangle(SColor color,\r
const core::rect<s32>& position,\r
const core::rect<s32>* clip)\r
{\r
\r
\r
//! draw an 2d rectangle\r
- void COpenGL3Driver::draw2DRectangle(const core::rect<s32>& position,\r
+ void COpenGL3DriverBase::draw2DRectangle(const core::rect<s32>& position,\r
SColor colorLeftUp, SColor colorRightUp,\r
SColor colorLeftDown, SColor colorRightDown,\r
const core::rect<s32>* clip)\r
\r
\r
//! Draws a 2d line.\r
- void COpenGL3Driver::draw2DLine(const core::position2d<s32>& start,\r
+ void COpenGL3DriverBase::draw2DLine(const core::position2d<s32>& start,\r
const core::position2d<s32>& end, SColor color)\r
{\r
if (start==end)\r
\r
\r
//! Draws a pixel\r
- void COpenGL3Driver::drawPixel(u32 x, u32 y, const SColor &color)\r
+ void COpenGL3DriverBase::drawPixel(u32 x, u32 y, const SColor &color)\r
{\r
const core::dimension2d<u32>& renderTargetSize = getCurrentRenderTargetSize();\r
if (x > (u32)renderTargetSize.Width || y > (u32)renderTargetSize.Height)\r
drawArrays(GL_POINTS, vtPrimitive, vertices, 1);\r
}\r
\r
- void COpenGL3Driver::drawQuad(const VertexType &vertexType, const S3DVertex (&vertices)[4])\r
+ void COpenGL3DriverBase::drawQuad(const VertexType &vertexType, const S3DVertex (&vertices)[4])\r
{\r
drawArrays(GL_TRIANGLE_FAN, vertexType, vertices, 4);\r
}\r
\r
- void COpenGL3Driver::drawArrays(GLenum primitiveType, const VertexType &vertexType, const void *vertices, int vertexCount)\r
+ void COpenGL3DriverBase::drawArrays(GLenum primitiveType, const VertexType &vertexType, const void *vertices, int vertexCount)\r
{\r
beginDraw(vertexType, reinterpret_cast<uintptr_t>(vertices));\r
glDrawArrays(primitiveType, 0, vertexCount);\r
endDraw(vertexType);\r
}\r
\r
- void COpenGL3Driver::drawElements(GLenum primitiveType, const VertexType &vertexType, const void *vertices, const u16 *indices, int indexCount)\r
+ void COpenGL3DriverBase::drawElements(GLenum primitiveType, const VertexType &vertexType, const void *vertices, const u16 *indices, int indexCount)\r
{\r
beginDraw(vertexType, reinterpret_cast<uintptr_t>(vertices));\r
glDrawElements(primitiveType, indexCount, GL_UNSIGNED_SHORT, indices);\r
endDraw(vertexType);\r
}\r
\r
- void COpenGL3Driver::beginDraw(const VertexType &vertexType, uintptr_t verticesBase)\r
+ void COpenGL3DriverBase::beginDraw(const VertexType &vertexType, uintptr_t verticesBase)\r
{\r
for (auto attr: vertexType) {\r
glEnableVertexAttribArray(attr.Index);\r
}\r
}\r
\r
- void COpenGL3Driver::endDraw(const VertexType &vertexType)\r
+ void COpenGL3DriverBase::endDraw(const VertexType &vertexType)\r
{\r
for (auto attr: vertexType)\r
glDisableVertexAttribArray(attr.Index);\r
}\r
\r
- ITexture* COpenGL3Driver::createDeviceDependentTexture(const io::path& name, IImage* image)\r
+ ITexture* COpenGL3DriverBase::createDeviceDependentTexture(const io::path& name, IImage* image)\r
{\r
core::array<IImage*> imageArray(1);\r
imageArray.push_back(image);\r
return texture;\r
}\r
\r
- ITexture* COpenGL3Driver::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image)\r
+ ITexture* COpenGL3DriverBase::createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image)\r
{\r
COpenGL3Texture* texture = new COpenGL3Texture(name, image, ETT_CUBEMAP, this);\r
\r
}\r
\r
//! Sets a material.\r
- void COpenGL3Driver::setMaterial(const SMaterial& material)\r
+ void COpenGL3DriverBase::setMaterial(const SMaterial& material)\r
{\r
Material = material;\r
OverrideMaterial.apply(Material);\r
}\r
\r
//! prints error if an error happened.\r
- bool COpenGL3Driver::testGLError(int code)\r
+ bool COpenGL3DriverBase::testGLError(int code)\r
{\r
#ifdef _DEBUG\r
GLenum g = glGetError();\r
}\r
\r
//! prints error if an error happened.\r
- bool COpenGL3Driver::testEGLError()\r
+ bool COpenGL3DriverBase::testEGLError()\r
{\r
#if defined(EGL_VERSION_1_0) && defined(_DEBUG)\r
EGLint g = eglGetError();\r
}\r
\r
\r
- void COpenGL3Driver::setRenderStates3DMode()\r
+ void COpenGL3DriverBase::setRenderStates3DMode()\r
{\r
if ( LockRenderStateMode )\r
return;\r
}\r
\r
//! Can be called by an IMaterialRenderer to make its work easier.\r
- void COpenGL3Driver::setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial, bool resetAllRenderStates)\r
+ void COpenGL3DriverBase::setBasicRenderStates(const SMaterial& material, const SMaterial& lastmaterial, bool resetAllRenderStates)\r
{\r
// ZBuffer\r
switch (material.ZBuffer)\r
}\r
\r
//! Compare in SMaterial doesn't check texture parameters, so we should call this on each OnRender call.\r
- void COpenGL3Driver::setTextureRenderStates(const SMaterial& material, bool resetAllRenderstates)\r
+ void COpenGL3DriverBase::setTextureRenderStates(const SMaterial& material, bool resetAllRenderstates)\r
{\r
// Set textures to TU/TIU and apply filters to them\r
\r
\r
\r
// Get OpenGL ES2.0 texture wrap mode from Irrlicht wrap mode.\r
- GLint COpenGL3Driver::getTextureWrapMode(u8 clamp) const\r
+ GLint COpenGL3DriverBase::getTextureWrapMode(u8 clamp) const\r
{\r
switch (clamp)\r
{\r
\r
\r
//! sets the needed renderstates\r
- void COpenGL3Driver::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel)\r
+ void COpenGL3DriverBase::setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel)\r
{\r
if ( LockRenderStateMode )\r
return;\r
}\r
\r
\r
- void COpenGL3Driver::chooseMaterial2D()\r
+ void COpenGL3DriverBase::chooseMaterial2D()\r
{\r
if (!OverrideMaterial2DEnabled)\r
Material = InitMaterial2D;\r
\r
\r
//! \return Returns the name of the video driver.\r
- const wchar_t* COpenGL3Driver::getName() const\r
+ const wchar_t* COpenGL3DriverBase::getName() const\r
{\r
return Name.c_str();\r
}\r
\r
- void COpenGL3Driver::setViewPort(const core::rect<s32>& area)\r
+ void COpenGL3DriverBase::setViewPort(const core::rect<s32>& area)\r
{\r
core::rect<s32> vp = area;\r
core::rect<s32> rendert(0, 0, getCurrentRenderTargetSize().Width, getCurrentRenderTargetSize().Height);\r
}\r
\r
\r
- void COpenGL3Driver::setViewPortRaw(u32 width, u32 height)\r
+ void COpenGL3DriverBase::setViewPortRaw(u32 width, u32 height)\r
{\r
CacheHandler->setViewport(0, 0, width, height);\r
ViewPort = core::recti(0, 0, width, height);\r
\r
\r
//! Draws a 3d line.\r
- void COpenGL3Driver::draw3DLine(const core::vector3df& start,\r
+ void COpenGL3DriverBase::draw3DLine(const core::vector3df& start,\r
const core::vector3df& end, SColor color)\r
{\r
setRenderStates3DMode();\r
\r
//! Only used by the internal engine. Used to notify the driver that\r
//! the window was resized.\r
- void COpenGL3Driver::OnResize(const core::dimension2d<u32>& size)\r
+ void COpenGL3DriverBase::OnResize(const core::dimension2d<u32>& size)\r
{\r
CNullDriver::OnResize(size);\r
CacheHandler->setViewport(0, 0, size.Width, size.Height);\r
\r
\r
//! Returns type of video driver\r
- E_DRIVER_TYPE COpenGL3Driver::getDriverType() const\r
+ E_DRIVER_TYPE COpenGL3DriverBase::getDriverType() const\r
{\r
return EDT_OPENGL3;\r
}\r
\r
\r
//! returns color format\r
- ECOLOR_FORMAT COpenGL3Driver::getColorFormat() const\r
+ ECOLOR_FORMAT COpenGL3DriverBase::getColorFormat() const\r
{\r
return ColorFormat;\r
}\r
\r
\r
//! Get a vertex shader constant index.\r
- s32 COpenGL3Driver::getVertexShaderConstantID(const c8* name)\r
+ s32 COpenGL3DriverBase::getVertexShaderConstantID(const c8* name)\r
{\r
return getPixelShaderConstantID(name);\r
}\r
\r
//! Get a pixel shader constant index.\r
- s32 COpenGL3Driver::getPixelShaderConstantID(const c8* name)\r
+ s32 COpenGL3DriverBase::getPixelShaderConstantID(const c8* name)\r
{\r
os::Printer::log("Error: Please call services->getPixelShaderConstantID(), not VideoDriver->getPixelShaderConstantID().");\r
return -1;\r
}\r
\r
//! Sets a vertex shader constant.\r
- void COpenGL3Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
+ void COpenGL3DriverBase::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
{\r
os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
}\r
\r
//! Sets a pixel shader constant.\r
- void COpenGL3Driver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
+ void COpenGL3DriverBase::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
{\r
os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
}\r
\r
//! Sets a constant for the vertex shader based on an index.\r
- bool COpenGL3Driver::setVertexShaderConstant(s32 index, const f32* floats, int count)\r
+ bool COpenGL3DriverBase::setVertexShaderConstant(s32 index, const f32* floats, int count)\r
{\r
os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
return false;\r
}\r
\r
//! Int interface for the above.\r
- bool COpenGL3Driver::setVertexShaderConstant(s32 index, const s32* ints, int count)\r
+ bool COpenGL3DriverBase::setVertexShaderConstant(s32 index, const s32* ints, int count)\r
{\r
os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
return false;\r
}\r
\r
- bool COpenGL3Driver::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+ bool COpenGL3DriverBase::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
{\r
os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
return false;\r
}\r
\r
//! Sets a constant for the pixel shader based on an index.\r
- bool COpenGL3Driver::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
+ bool COpenGL3DriverBase::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
return false;\r
}\r
\r
//! Int interface for the above.\r
- bool COpenGL3Driver::setPixelShaderConstant(s32 index, const s32* ints, int count)\r
+ bool COpenGL3DriverBase::setPixelShaderConstant(s32 index, const s32* ints, int count)\r
{\r
os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
return false;\r
}\r
\r
- bool COpenGL3Driver::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+ bool COpenGL3DriverBase::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
{\r
os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
return false;\r
\r
//! Adds a new material renderer to the VideoDriver, using pixel and/or\r
//! vertex shaders to render geometry.\r
- s32 COpenGL3Driver::addShaderMaterial(const c8* vertexShaderProgram,\r
+ s32 COpenGL3DriverBase::addShaderMaterial(const c8* vertexShaderProgram,\r
const c8* pixelShaderProgram,\r
IShaderConstantSetCallBack* callback,\r
E_MATERIAL_TYPE baseMaterial, s32 userData)\r
\r
\r
//! Adds a new material renderer to the VideoDriver, using GLSL to render geometry.\r
- s32 COpenGL3Driver::addHighLevelShaderMaterial(\r
+ s32 COpenGL3DriverBase::addHighLevelShaderMaterial(\r
const c8* vertexShaderProgram,\r
const c8* vertexShaderEntryPointName,\r
E_VERTEX_SHADER_TYPE vsCompileTarget,\r
\r
//! Returns a pointer to the IVideoDriver interface. (Implementation for\r
//! IMaterialRendererServices)\r
- IVideoDriver* COpenGL3Driver::getVideoDriver()\r
+ IVideoDriver* COpenGL3DriverBase::getVideoDriver()\r
{\r
return this;\r
}\r
\r
\r
//! Returns pointer to the IGPUProgrammingServices interface.\r
- IGPUProgrammingServices* COpenGL3Driver::getGPUProgrammingServices()\r
+ IGPUProgrammingServices* COpenGL3DriverBase::getGPUProgrammingServices()\r
{\r
return this;\r
}\r
\r
- ITexture* COpenGL3Driver::addRenderTargetTexture(const core::dimension2d<u32>& size,\r
+ ITexture* COpenGL3DriverBase::addRenderTargetTexture(const core::dimension2d<u32>& size,\r
const io::path& name, const ECOLOR_FORMAT format)\r
{\r
//disable mip-mapping\r
return renderTargetTexture;\r
}\r
\r
- ITexture* COpenGL3Driver::addRenderTargetTextureCubemap(const irr::u32 sideLen, const io::path& name, const ECOLOR_FORMAT format)\r
+ ITexture* COpenGL3DriverBase::addRenderTargetTextureCubemap(const irr::u32 sideLen, const io::path& name, const ECOLOR_FORMAT format)\r
{\r
//disable mip-mapping\r
bool generateMipLevels = getTextureCreationFlag(ETCF_CREATE_MIP_MAPS);\r
\r
\r
//! Returns the maximum amount of primitives\r
- u32 COpenGL3Driver::getMaximalPrimitiveCount() const\r
+ u32 COpenGL3DriverBase::getMaximalPrimitiveCount() const\r
{\r
return 65535;\r
}\r
\r
- bool COpenGL3Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)\r
+ bool COpenGL3DriverBase::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor clearColor, f32 clearDepth, u8 clearStencil)\r
{\r
- if (target && target->getDriverType() != EDT_OPENGL3)\r
+ if (target && target->getDriverType() != getDriverType())\r
{\r
os::Printer::log("Fatal Error: Tried to set a render target not owned by OpenGL 3 driver.", ELL_ERROR);\r
return false;\r
return true;\r
}\r
\r
- void COpenGL3Driver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)\r
+ void COpenGL3DriverBase::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)\r
{\r
GLbitfield mask = 0;\r
u8 colorMask = 0;\r
// We want to read the front buffer to get the latest render finished.\r
// This is not possible under ogl-es, though, so one has to call this method\r
// outside of the render loop only.\r
- IImage* COpenGL3Driver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target)\r
+ IImage* COpenGL3DriverBase::createScreenShot(video::ECOLOR_FORMAT format, video::E_RENDER_TARGET target)\r
{\r
if (target==video::ERT_MULTI_RENDER_TEXTURES || target==video::ERT_RENDER_TEXTURE || target==video::ERT_STEREO_BOTH_BUFFERS)\r
return 0;\r
return newImage;\r
}\r
\r
- void COpenGL3Driver::removeTexture(ITexture* texture)\r
+ void COpenGL3DriverBase::removeTexture(ITexture* texture)\r
{\r
CacheHandler->getTextureCache().remove(texture);\r
CNullDriver::removeTexture(texture);\r
}\r
\r
//! Set/unset a clipping plane.\r
- bool COpenGL3Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable)\r
+ bool COpenGL3DriverBase::setClipPlane(u32 index, const core::plane3df& plane, bool enable)\r
{\r
if (index >= UserClipPlane.size())\r
UserClipPlane.push_back(SUserClipPlane());\r
}\r
\r
//! Enable/disable a clipping plane.\r
- void COpenGL3Driver::enableClipPlane(u32 index, bool enable)\r
+ void COpenGL3DriverBase::enableClipPlane(u32 index, bool enable)\r
{\r
UserClipPlane[index].Enabled = enable;\r
}\r
\r
//! Get the ClipPlane Count\r
- u32 COpenGL3Driver::getClipPlaneCount() const\r
+ u32 COpenGL3DriverBase::getClipPlaneCount() const\r
{\r
return UserClipPlane.size();\r
}\r
\r
- const core::plane3df& COpenGL3Driver::getClipPlane(irr::u32 index) const\r
+ const core::plane3df& COpenGL3DriverBase::getClipPlane(irr::u32 index) const\r
{\r
if (index < UserClipPlane.size())\r
return UserClipPlane[index].Plane;\r
}\r
}\r
\r
- core::dimension2du COpenGL3Driver::getMaxTextureSize() const\r
+ core::dimension2du COpenGL3DriverBase::getMaxTextureSize() const\r
{\r
return core::dimension2du(MaxTextureSize, MaxTextureSize);\r
}\r
\r
- GLenum COpenGL3Driver::getGLBlend(E_BLEND_FACTOR factor) const\r
+ GLenum COpenGL3DriverBase::getGLBlend(E_BLEND_FACTOR factor) const\r
{\r
static GLenum const blendTable[] =\r
{\r
return blendTable[factor];\r
}\r
\r
- bool COpenGL3Driver::getColorFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLenum& pixelFormat,\r
+ bool COpenGL3DriverBase::getColorFormatParameters(ECOLOR_FORMAT format, GLint& internalFormat, GLenum& pixelFormat,\r
GLenum& pixelType, void(**converter)(const void*, s32, void*)) const\r
{\r
bool supported = false;\r
return supported;\r
}\r
\r
- bool COpenGL3Driver::queryTextureFormat(ECOLOR_FORMAT format) const\r
+ bool COpenGL3DriverBase::queryTextureFormat(ECOLOR_FORMAT format) const\r
{\r
GLint dummyInternalFormat;\r
GLenum dummyPixelFormat;\r
return getColorFormatParameters(format, dummyInternalFormat, dummyPixelFormat, dummyPixelType, &dummyConverter);\r
}\r
\r
- bool COpenGL3Driver::needsTransparentRenderPass(const irr::video::SMaterial& material) const\r
+ bool COpenGL3DriverBase::needsTransparentRenderPass(const irr::video::SMaterial& material) const\r
{\r
return CNullDriver::needsTransparentRenderPass(material) || material.isAlphaBlendOperation();\r
}\r
\r
- const SMaterial& COpenGL3Driver::getCurrentMaterial() const\r
+ const SMaterial& COpenGL3DriverBase::getCurrentMaterial() const\r
{\r
return Material;\r
}\r
\r
- COpenGL3CacheHandler* COpenGL3Driver::getCacheHandler() const\r
+ COpenGL3CacheHandler* COpenGL3DriverBase::getCacheHandler() const\r
{\r
return CacheHandler;\r
}\r
\r
-\r
-IVideoDriver* createOpenGL3Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)\r
-{\r
- COpenGL3Driver* driver = new COpenGL3Driver(params, io, contextManager);\r
- driver->genericDriverInit(params.WindowSize, params.Stencilbuffer); // don't call in constructor, it uses virtual function calls of driver\r
- return driver;\r
-}\r
-\r
} // end namespace\r
} // end namespace\r