]> git.lizzy.rs Git - irrlicht.git/commitdiff
Resolve conflicts with master
authornumzero <numzer0@yandex.ru>
Sat, 25 Mar 2023 07:42:11 +0000 (10:42 +0300)
committernumzero <numzer0@yandex.ru>
Sat, 25 Mar 2023 07:42:47 +0000 (10:42 +0300)
1  2 
examples/AutomatedTest/main.cpp
include/IVideoDriver.h
include/SIrrCreationParameters.h
source/Irrlicht/CIrrDeviceSDL.cpp
source/Irrlicht/CMakeLists.txt
source/Irrlicht/CNullDriver.cpp
source/Irrlicht/CNullDriver.h
source/Irrlicht/Irrlicht.cpp

index 6e9d646dd14d40496a8cef916c73e9bb1b930da3,5df7a291c2700ca67889aba0502d691054407757..96cbc7388b3c7bfac375574cd0b1689269232363
@@@ -20,8 -20,6 +20,8 @@@ static video::E_DRIVER_TYPE chooseDrive
                return video::EDT_OGLES2;\r
        if (arg_ == "opengl")\r
                return video::EDT_OPENGL;\r
 +      if (arg_ == "opengl3")\r
 +              return video::EDT_OPENGL3;\r
        std::cerr << "Unknown driver type: " << arg_.c_str() << ". Trying OpenGL." << std::endl;\r
        return video::EDT_OPENGL;\r
  }\r
@@@ -87,8 -85,12 +87,12 @@@ int main(int argc, char *argv[]
  \r
        const io::path mediaPath = getExampleMediaPath();\r
  \r
-       scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "coolguy_opt.x");\r
+       auto mesh_file = device->getFileSystem()->createAndOpenFile(mediaPath + "coolguy_opt.x");\r
+       check(mesh_file, "mesh file loading");\r
+       scene::IAnimatedMesh* mesh = smgr->getMesh(mesh_file);\r
        check(mesh, "mesh loading");\r
+       if (mesh_file)\r
+               mesh_file->drop();\r
        if (mesh)\r
        {\r
                video::ITexture* tex = driver->getTexture(mediaPath + "cooltexture.png");\r
diff --combined include/IVideoDriver.h
index 9bf7afd83778bda10fb504843bab6a9ffc361398,2fcb0ab9a248150295e18660d3c7e490809378d9..f93d761261ef53f1b58cd04ea3b09029e4b8cd89
@@@ -717,6 -717,23 +717,6 @@@ namespace vide
                virtual void draw3DLine(const core::vector3df& start,\r
                        const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;\r
  \r
 -              //! Draws a 3d triangle.\r
 -              /** This method calls drawVertexPrimitiveList for some triangles.\r
 -              This method works with all drivers because it simply calls\r
 -              drawVertexPrimitiveList, but it is hence not very fast.\r
 -              Note that the triangle is drawn using the current\r
 -              transformation matrix and material. So if you need to draw it\r
 -              independently of the current transformation, use\r
 -              \code\r
 -              driver->setMaterial(someMaterial);\r
 -              driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);\r
 -              \endcode\r
 -              for some properly set up material before drawing the triangle.\r
 -              \param triangle The triangle to draw.\r
 -              \param color Color of the line. */\r
 -              virtual void draw3DTriangle(const core::triangle3df& triangle,\r
 -                      SColor color = SColor(255,255,255,255)) =0;\r
 -\r
                //! Draws a 3d axis aligned box.\r
                /** This method simply calls draw3DLine for the edges of the\r
                box. Note that the box is drawn using the current transformation\r
                \param texture Texture to be drawn.\r
                \param destPos Upper left 2d destination position where the\r
                image will be drawn.\r
-               \param sourceRect Source rectangle in the image.\r
+               \param sourceRect Source rectangle in the texture (based on it's OriginalSize)\r
                \param clipRect Pointer to rectangle on the screen where the\r
                image is clipped to.\r
                If this pointer is NULL the image is not clipped.\r
                        const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,\r
                        SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;\r
  \r
 -              //! Draws a set of 2d images, using a color and the alpha channel of the texture.\r
 -              /** The images are drawn beginning at pos and concatenated in\r
 -              one line. All drawings are clipped against clipRect (if != 0).\r
 -              The subtextures are defined by the array of sourceRects and are\r
 -              chosen by the indices given.\r
 -              \param texture Texture to be drawn.\r
 -              \param pos Upper left 2d destination position where the image\r
 -              will be drawn.\r
 -              \param sourceRects Source rectangles of the texture (based on it's OriginalSize)\r
 -              \param indices List of indices which choose the actual\r
 -              rectangle used each time.\r
 -              \param kerningWidth Offset to Position on X\r
 -              \param clipRect Pointer to rectangle on the screen where the\r
 -              image is clipped to.\r
 -              If this pointer is 0 then the image is not clipped.\r
 -              \param color Color with which the image is drawn.\r
 -              Note that the alpha component is used. If alpha is other than\r
 -              255, the image will be transparent.\r
 -              \param useAlphaChannelOfTexture: If true, the alpha channel of\r
 -              the texture is used to draw the image. */\r
 -              virtual void draw2DImageBatch(const video::ITexture* texture,\r
 -                              const core::position2d<s32>& pos,\r
 -                              const core::array<core::rect<s32> >& sourceRects,\r
 -                              const core::array<s32>& indices,\r
 -                              s32 kerningWidth=0,\r
 -                              const core::rect<s32>* clipRect=0,\r
 -                              SColor color=SColor(255,255,255,255),\r
 -                              bool useAlphaChannelOfTexture=false) =0;\r
 -\r
                //! Draws a set of 2d images, using a color and the alpha channel of the texture.\r
                /** All drawings are clipped against clipRect (if != 0).\r
                The subtextures are defined by the array of sourceRects and are\r
                \param texture Texture to be drawn.\r
                \param positions Array of upper left 2d destinations where the\r
                images will be drawn.\r
-               \param sourceRects Source rectangles of the image.\r
+               \param sourceRects Source rectangles of the texture (based on it's OriginalSize)\r
                \param clipRect Pointer to rectangle on the screen where the\r
                images are clipped to.\r
                If this pointer is 0 then the image is not clipped.\r
                /** Suggested and first implemented by zola.\r
                \param texture The texture to draw from\r
                \param destRect The rectangle to draw into\r
-               \param sourceRect The rectangle denoting a part of the texture\r
+               \param sourceRect The rectangle denoting a part of the texture (based on it's OriginalSize)\r
                \param clipRect Clips the destination rectangle (may be 0)\r
                \param colors Array of 4 colors denoting the color values of\r
                the corners of the destRect\r
                                SColor colorLeftDown, SColor colorRightDown,\r
                                const core::rect<s32>* clip =0) =0;\r
  \r
 -              //! Draws the outline of a 2D rectangle.\r
 -              /** \param pos Position of the rectangle.\r
 -              \param color Color of the rectangle to draw. The alpha component\r
 -              specifies how transparent the rectangle outline will be. */\r
 -              virtual void draw2DRectangleOutline(const core::recti& pos,\r
 -                              SColor color=SColor(255,255,255,255)) =0;\r
 -\r
                //! Draws a 2d line.\r
                /** In theory both start and end will be included in coloring.\r
                BUG: Currently d3d ignores the last pixel\r
                                        const core::position2d<s32>& end,\r
                                        SColor color=SColor(255,255,255,255)) =0;\r
  \r
 -              //! Draws a pixel.\r
 -              /** \param x The x-position of the pixel.\r
 -              \param y The y-position of the pixel.\r
 -              \param color Color of the pixel to draw. */\r
 -              virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;\r
 -\r
 -              //! Draws a non filled concyclic regular 2d polygon.\r
 -              /** This method can be used to draw circles, but also\r
 -              triangles, tetragons, pentagons, hexagons, heptagons, octagons,\r
 -              enneagons, decagons, hendecagons, dodecagon, triskaidecagons,\r
 -              etc. I think you'll got it now. And all this by simply\r
 -              specifying the vertex count. Welcome to the wonders of\r
 -              geometry.\r
 -              \param center Position of center of circle (pixels).\r
 -              \param radius Radius of circle in pixels.\r
 -              \param color Color of the circle.\r
 -              \param vertexCount Amount of vertices of the polygon. Specify 2\r
 -              to draw a line, 3 to draw a triangle, 4 for tetragons and a lot\r
 -              (>10) for nearly a circle. */\r
 -              virtual void draw2DPolygon(core::position2d<s32> center,\r
 -                              f32 radius,\r
 -                              video::SColor color=SColor(100,255,255,255),\r
 -                              s32 vertexCount=10) =0;\r
 -\r
 -              //! Draws a shadow volume into the stencil buffer.\r
 -              /** To draw a stencil shadow, do this: First, draw all geometry.\r
 -              Then use this method, to draw the shadow volume. Then, use\r
 -              IVideoDriver::drawStencilShadow() to visualize the shadow.\r
 -              Please note that the code for the opengl version of the method\r
 -              is based on free code sent in by Philipp Dortmann, lots of\r
 -              thanks go to him!\r
 -              \param triangles Array of 3d vectors, specifying the shadow\r
 -              volume.\r
 -              \param zfail If set to true, zfail method is used, otherwise\r
 -              zpass.\r
 -              \param debugDataVisible The debug data that is enabled for this\r
 -              shadow node\r
 -              */\r
 -              virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;\r
 -\r
 -              //! Fills the stencil shadow with color.\r
 -              /** After the shadow volume has been drawn into the stencil\r
 -              buffer using IVideoDriver::drawStencilShadowVolume(), use this\r
 -              to draw the color of the shadow.\r
 -              Please note that the code for the opengl version of the method\r
 -              is based on free code sent in by Philipp Dortmann, lots of\r
 -              thanks go to him!\r
 -              \param clearStencilBuffer Set this to false, if you want to\r
 -              draw every shadow with the same color, and only want to call\r
 -              drawStencilShadow() once after all shadow volumes have been\r
 -              drawn. Set this to true, if you want to paint every shadow with\r
 -              its own color.\r
 -              \param leftUpEdge Color of the shadow in the upper left corner\r
 -              of screen.\r
 -              \param rightUpEdge Color of the shadow in the upper right\r
 -              corner of screen.\r
 -              \param leftDownEdge Color of the shadow in the lower left\r
 -              corner of screen.\r
 -              \param rightDownEdge Color of the shadow in the lower right\r
 -              corner of screen. */\r
 -              virtual void drawStencilShadow(bool clearStencilBuffer=false,\r
 -                      video::SColor leftUpEdge = video::SColor(255,0,0,0),\r
 -                      video::SColor rightUpEdge = video::SColor(255,0,0,0),\r
 -                      video::SColor leftDownEdge = video::SColor(255,0,0,0),\r
 -                      video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;\r
 -\r
                //! Draws a mesh buffer\r
                /** \param mb Buffer to draw */\r
                virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;\r
                E_MATERIAL_TYPE enum or a value which was returned by\r
                addMaterialRenderer().\r
                \param name: New name of the material renderer. */\r
-               virtual void setMaterialRendererName(s32 idx, const c8* name) =0;\r
+               virtual void setMaterialRendererName(u32 idx, const c8* name) =0;\r
  \r
                //! Swap the material renderers used for certain id's\r
                /** Swap the IMaterialRenderers responsible for rendering specific\r
index 743960489bcdd504023570537d288e7b4c7ca6a3,5c1f8da9293a3eb2fec5abc5ff2661dc5fdea030..1ac150bbac4da1aadd9a5f4fe881e974ab68a528
@@@ -24,7 -24,7 +24,7 @@@ namespace ir
                //! Constructs a SIrrlichtCreationParameters structure with default values.\r
                SIrrlichtCreationParameters() :\r
                        DeviceType(EIDT_BEST),\r
 -                      DriverType(video::EDT_BURNINGSVIDEO),\r
 +                      DriverType(video::EDT_OPENGL),\r
                        WindowSize(core::dimension2d<u32>(800, 600)),\r
                        WindowPosition(core::position2di(-1,-1)),\r
                        Bits(32),\r
                /** If this is set to a value other than 0, the Irrlicht Engine\r
                will be created in an already existing window.\r
                For Windows, set this to the HWND of the window you want.\r
-               For iOS, assign UIView to this variable.\r
                The windowSize and FullScreen options will be ignored when using\r
                the WindowId parameter. Default this is set to 0.\r
                To make Irrlicht run inside the custom window, you still will\r
index b0c774797be01d5793304d12c05a187e9bae9b1a,26683a72a347337fbe6c8dc80a4c5b6f3be3ce4b..c1e7527b9856715724607a644332cde0ce7bae9a
  #include <SDL_video.h>\r
  \r
  #ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
 -#ifdef _IRR_COMPILE_WITH_OGLES2_\r
 -#include "CEGLManager.h"\r
 -#endif\r
  #include <emscripten.h>\r
  #endif\r
  \r
 -#ifdef _IRR_COMPILE_WITH_OPENGL_\r
  #include "CSDLManager.h"\r
 -#endif\r
  \r
  static int SDLDeviceInstances = 0;\r
  \r
@@@ -33,42 -38,14 +33,42 @@@ namespace ir
        {\r
                #ifdef _IRR_COMPILE_WITH_OPENGL_\r
                IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);\r
 +              #else\r
 +              static IVideoDriver* createOpenGLDriver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)\r
 +              {\r
 +                      os::Printer::log("No OpenGL support compiled in.", ELL_ERROR);\r
 +                      return nullptr;\r
 +              }\r
 +              #endif\r
 +\r
 +              #ifdef ENABLE_OPENGL3\r
 +              IVideoDriver* createOpenGL3Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);\r
 +              #else\r
 +              static IVideoDriver* createOpenGL3Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)\r
 +              {\r
 +                      os::Printer::log("No OpenGL 3 support compiled in.", ELL_ERROR);\r
 +                      return nullptr;\r
 +              }\r
                #endif\r
  \r
                #ifdef _IRR_COMPILE_WITH_OGLES2_\r
                IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);\r
 +              #else\r
 +              static IVideoDriver* createOGLES2Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)\r
 +              {\r
 +                      os::Printer::log("No OpenGL ES 2 support compiled in.", ELL_ERROR);\r
 +                      return nullptr;\r
 +              }\r
                #endif\r
  \r
                #ifdef _IRR_COMPILE_WITH_WEBGL1_\r
                IVideoDriver* createWebGL1Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);\r
 +              #else\r
 +              static IVideoDriver* createWebGL1Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager)\r
 +              {\r
 +                      os::Printer::log("No WebGL 1 support compiled in.", ELL_ERROR);\r
 +                      return nullptr;\r
 +              }\r
                #endif\r
        } // end namespace video\r
  \r
@@@ -243,7 -220,7 +243,7 @@@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrr
  #endif\r
                if (SDL_Init(flags) < 0)\r
                {\r
-                       os::Printer::log( "Unable to initialize SDL!", SDL_GetError());\r
+                       os::Printer::log("Unable to initialize SDL!", SDL_GetError());\r
                        Close = true;\r
                }\r
                else\r
        // create keymap\r
        createKeyMap();\r
  \r
 -      if (CreationParams.Fullscreen) {\r
 -#ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
 -              SDL_Flags |= SDL_WINDOW_FULLSCREEN;\r
 -#else\r
 -              SDL_Flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;\r
 -#endif\r
 -      }\r
 -      if (Resizable)\r
 -              SDL_Flags |= SDL_WINDOW_RESIZABLE;\r
 -      if (CreationParams.WindowMaximized)\r
 -              SDL_Flags |= SDL_WINDOW_MAXIMIZED;\r
 -\r
 -      if (CreationParams.DriverType == video::EDT_OPENGL)\r
 -      {\r
 -              SDL_Flags |= SDL_WINDOW_OPENGL;\r
 -              if (!CreationParams.Doublebuffer)\r
 -                      SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);\r
 -      }\r
 -#ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
 -      SDL_Flags |= SDL_WINDOW_OPENGL;\r
 -#endif //_IRR_EMSCRIPTEN_PLATFORM_\r
 -\r
        // create window\r
        if (CreationParams.DriverType != video::EDT_NULL)\r
        {\r
@@@ -344,19 -343,6 +344,19 @@@ void CIrrDeviceSDL::logAttributes(
  \r
  bool CIrrDeviceSDL::createWindow()\r
  {\r
 +      if (CreationParams.Fullscreen) {\r
 +#ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
 +              SDL_Flags |= SDL_WINDOW_FULLSCREEN;\r
 +#else\r
 +              SDL_Flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;\r
 +#endif\r
 +      }\r
 +      if (Resizable)\r
 +              SDL_Flags |= SDL_WINDOW_RESIZABLE;\r
 +      if (CreationParams.WindowMaximized)\r
 +              SDL_Flags |= SDL_WINDOW_MAXIMIZED;\r
 +      SDL_Flags |= SDL_WINDOW_OPENGL;\r
 +\r
  #ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
        if ( Width != 0 || Height != 0 )\r
                emscripten_set_canvas_size( Width, Height);\r
        if ( Close )\r
                return false;\r
  \r
 -      if (CreationParams.DriverType == video::EDT_OPENGL) {\r
 -              if (CreationParams.Bits == 16) {\r
 -                      SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 4);\r
 -                      SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 4);\r
 -                      SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 4);\r
 -                      SDL_GL_SetAttribute(\r
 -                                      SDL_GL_ALPHA_SIZE, CreationParams.WithAlphaChannel ? 1 : 0);\r
 -              } else {\r
 -                      SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);\r
 -                      SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);\r
 -                      SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);\r
 -                      SDL_GL_SetAttribute(\r
 -                                      SDL_GL_ALPHA_SIZE, CreationParams.WithAlphaChannel ? 8 : 0);\r
 -              }\r
 -              SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, CreationParams.ZBufferBits);\r
 -              if (CreationParams.Doublebuffer)\r
 -                      SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);\r
 -              SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, CreationParams.Stencilbuffer ? 8 : 0);\r
 -              if (CreationParams.Stereobuffer)\r
 -                      SDL_GL_SetAttribute(SDL_GL_STEREO, 1);\r
 -              if (CreationParams.AntiAlias > 1) {\r
 -                      SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);\r
 +      switch (CreationParams.DriverType) {\r
 +              case video::EDT_OPENGL:\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);\r
 +                      break;\r
 +              case video::EDT_OPENGL3:\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);\r
 +                      break;\r
 +              case video::EDT_OGLES1:\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);\r
 +                      break;\r
 +              case video::EDT_OGLES2:\r
 +              case video::EDT_WEBGL1:\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);\r
 +                      SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);\r
 +                      break;\r
 +              default:;\r
 +      }\r
 +\r
 +#ifdef _DEBUG\r
 +      SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG | SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG);\r
 +#endif\r
 +\r
 +      if (CreationParams.Bits == 16) {\r
 +              SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);\r
 +              SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);\r
 +              SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);\r
 +              SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, CreationParams.WithAlphaChannel ? 1 : 0);\r
 +      } else {\r
 +              SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);\r
 +              SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);\r
 +              SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);\r
 +              SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, CreationParams.WithAlphaChannel ? 8 : 0);\r
 +      }\r
 +      SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, CreationParams.ZBufferBits);\r
 +      SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, CreationParams.Doublebuffer);\r
 +      SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, CreationParams.Stencilbuffer ? 8 : 0);\r
 +      SDL_GL_SetAttribute(SDL_GL_STEREO, CreationParams.Stereobuffer);\r
 +      if (CreationParams.AntiAlias > 1) {\r
 +              SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);\r
 +              SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, CreationParams.AntiAlias);\r
 +      }\r
 +      if (!Window)\r
 +              Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 +      if (!Window) {\r
 +              os::Printer::log("Could not create window...", SDL_GetError(), ELL_WARNING);\r
 +      }\r
 +      if (!Window && CreationParams.AntiAlias > 1) {\r
 +              while (--CreationParams.AntiAlias > 1) {\r
                        SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, CreationParams.AntiAlias);\r
 -              }\r
 -              if (!Window)\r
                        Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 -              if (!Window && CreationParams.AntiAlias > 1) {\r
 -                      while (--CreationParams.AntiAlias > 1) {\r
 -                              SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, CreationParams.AntiAlias);\r
 -                              Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 -                              if (Window)\r
 -                                      break;\r
 -                      }\r
 -                      if (!Window) {\r
 -                              SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);\r
 -                              SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);\r
 -                              Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 -                              if (Window)\r
 -                                      os::Printer::log("AntiAliasing disabled due to lack of support!");\r
 -                      }\r
 +                      if (Window)\r
 +                              break;\r
                }\r
 -\r
 -              if (Window)\r
 -              {\r
 -                      Context = SDL_GL_CreateContext(Window);\r
 +              if (!Window) {\r
 +                      SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0);\r
 +                      SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);\r
 +                      Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 +                      if (Window)\r
 +                              os::Printer::log("AntiAliasing disabled due to lack of support!", ELL_WARNING);\r
                }\r
 -      } else if (!Window)\r
 -              Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 +      }\r
  \r
        if ( !Window && CreationParams.Doublebuffer)\r
        {\r
        }\r
        if ( !Window )\r
        {\r
 -              os::Printer::log("Could not initialize display!" );\r
 +              os::Printer::log("Could not initialize display", SDL_GetError(), ELL_ERROR);\r
 +              return false;\r
 +      }\r
 +\r
 +      Context = SDL_GL_CreateContext(Window);\r
 +      if (!Context) {\r
 +              os::Printer::log("Could not initialize context", SDL_GetError(), ELL_ERROR);\r
 +              SDL_DestroyWindow(Window);\r
                return false;\r
        }\r
  \r
  //! create the driver\r
  void CIrrDeviceSDL::createDriver()\r
  {\r
 -      switch(CreationParams.DriverType)\r
 -      {\r
 -      case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:\r
 -              os::Printer::log("DIRECT3D8 Driver is no longer supported in Irrlicht. Try another one.", ELL_ERROR);\r
 -              break;\r
 -\r
 -      case video::EDT_DIRECT3D9:\r
 -              #ifdef _IRR_COMPILE_WITH_DIRECT3D_9_\r
 -              os::Printer::log("SDL device does not support DIRECT3D9 driver. Try another one.", ELL_ERROR);\r
 -              #else\r
 -              os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR);\r
 -              #endif // _IRR_COMPILE_WITH_DIRECT3D_9_\r
 -\r
 -              break;\r
 -\r
 -      case video::EDT_OPENGL:\r
 -              #ifdef _IRR_COMPILE_WITH_OPENGL_\r
 -              ContextManager = new video::CSDLManager(this);\r
 -              VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, ContextManager);\r
 -              #else\r
 -              os::Printer::log("No OpenGL support compiled in.", ELL_ERROR);\r
 -              #endif\r
 -              break;\r
 -\r
 -      case video::EDT_OGLES2:\r
 -#if defined(_IRR_COMPILE_WITH_OGLES2_) && defined(_IRR_EMSCRIPTEN_PLATFORM_)\r
 -              {\r
 -                      video::SExposedVideoData data;\r
 -\r
 -                      ContextManager = new video::CEGLManager();\r
 -                      ContextManager->initialize(CreationParams, data);\r
 -\r
 -                      VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, ContextManager);\r
 -              }\r
 -#else\r
 -              os::Printer::log("No OpenGL-ES2 support compiled in.", ELL_ERROR);\r
 -#endif\r
 -              break;\r
 -\r
 -      case video::EDT_WEBGL1:\r
 -#if defined(_IRR_COMPILE_WITH_WEBGL1_) && defined(_IRR_EMSCRIPTEN_PLATFORM_)\r
 -              {\r
 -                      video::SExposedVideoData data;\r
 -\r
 -                      ContextManager = new video::CEGLManager();\r
 -                      ContextManager->initialize(CreationParams, data);\r
 -\r
 -                      VideoDriver = video::createWebGL1Driver(CreationParams, FileSystem, ContextManager);\r
 -              }\r
 -#else\r
 -              os::Printer::log("No WebGL1 support compiled in.", ELL_ERROR);\r
 -#endif\r
 -              break;\r
 -\r
 -      case video::EDT_NULL:\r
 +      if (CreationParams.DriverType == video::EDT_NULL) {\r
                VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);\r
 -              break;\r
 -\r
 -      default:\r
 -              os::Printer::log("Unable to create video driver of unknown type.", ELL_ERROR);\r
 -              break;\r
 +              return;\r
        }\r
  \r
 -      // In case we got the size from the canvas\r
 -      if ( VideoDriver && CreationParams.WindowSize.Width == 0 && CreationParams.WindowSize.Height == 0 && Width > 0 && Height > 0 )\r
 +      ContextManager = new video::CSDLManager(this);\r
 +      switch(CreationParams.DriverType)\r
        {\r
 -#ifdef _IRR_EMSCRIPTEN_PLATFORM_\r
 -              SDL_CreateWindowAndRenderer(Width, Height, SDL_Flags, &Window, &Renderer);\r
 -#else //_IRR_EMSCRIPTEN_PLATFORM_\r
 -              Window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, Width, Height, SDL_Flags);\r
 -#endif //_IRR_EMSCRIPTEN_PLATFOR\r
 -              VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));\r
 +      case video::EDT_OPENGL: VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, ContextManager); break;\r
 +      case video::EDT_OPENGL3: VideoDriver = video::createOpenGL3Driver(CreationParams, FileSystem, ContextManager); break;\r
 +      case video::EDT_OGLES2: VideoDriver = video::createOGLES2Driver(CreationParams, FileSystem, ContextManager); break;\r
 +      case video::EDT_WEBGL1: VideoDriver = video::createWebGL1Driver(CreationParams, FileSystem, ContextManager); break;\r
 +      default:;\r
        }\r
 +      if (!VideoDriver)\r
 +              os::Printer::log("Could not create video driver", ELL_ERROR);\r
  }\r
  \r
  \r
index fa345cadd46871b6912ac393ede037caf4dc5df5,e993ace12d1b403ed6360384e92aaf4036a6d073..ad11dd45aa46adfc4aace25eee6cabf6cd3b4ce3
@@@ -77,28 -77,20 +77,19 @@@ add_definitions
  if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
        set(SOLARIS TRUE)
  endif()
- if(APPLE AND NOT IOS)
-       set(OSX TRUE)
- endif()
  
  # Device
  
  if(WIN32)
        add_definitions(-D_IRR_WINDOWS_ -D_IRR_WINDOWS_API_)
        set(DEVICE "WINDOWS")
- elseif(IOS)
-       add_definitions(-D_IRR_IOS_PLATFORM_ -D_IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_)
-       if(USE_SDL2)
-               message(SEND_ERROR "SDL2 backend is not supported on iOS")
-       endif()
-       set(DEVICE "IOS")
- elseif(OSX)
+ elseif(APPLE)
        add_definitions(-D_IRR_OSX_PLATFORM_)
        set(DEVICE "OSX")
  elseif(ANDROID)
        add_definitions(-D_IRR_ANDROID_PLATFORM_ -D_IRR_COMPILE_ANDROID_ASSET_READER_)
        if(USE_SDL2)
 -              message(WARNING "SDL2 backend is not supported on Android")
 -              set(USE_SDL2 FALSE)
 +              message(SEND_ERROR "SDL2 backend is not supported on Android")
        endif()
        set(DEVICE "Android")
  elseif(EMSCRIPTEN)
@@@ -148,28 -140,26 +139,28 @@@ endif(
  
  # OpenGL
  
- if(IOS OR ANDROID OR EMSCRIPTEN)
 +option(ENABLE_OPENGL3 "Enable OpenGL 3+" FALSE)
 +
+ if(ANDROID OR EMSCRIPTEN)
        set(ENABLE_OPENGL FALSE)
  else()
        option(ENABLE_OPENGL "Enable OpenGL" TRUE)
  endif()
  
- if(EMSCRIPTEN OR OSX)
+ if(EMSCRIPTEN OR APPLE)
        set(ENABLE_GLES1 FALSE)
  else()
-       if(ANDROID OR IOS)
+       if(ANDROID)
                set(DEFAULT_GLES1 TRUE)
        endif()
        option(ENABLE_GLES1 "Enable OpenGL ES" ${DEFAULT_GLES1})
  endif()
  
- if(OSX)
+ if(APPLE)
        set(ENABLE_GLES2 FALSE)
        set(ENABLE_WEBGL1 FALSE)
  else()
-       if(ANDROID OR IOS OR EMSCRIPTEN)
+       if(ANDROID OR EMSCRIPTEN)
                set(DEFAULT_GLES2 TRUE)
        endif()
        if(EMSCRIPTEN)
@@@ -195,23 -185,10 +186,21 @@@ if(ENABLE_OPENGL
        endif()
  endif()
  
 +if(ENABLE_OPENGL3)
 +      if (NOT USE_SDL2)
 +              message(SEND_ERROR "OpenGL3 support requires SDL2")
 +      endif()
 +      set(USE_SDLGL ON)
 +      set(USE_SDLGL3 ON)
 +endif()
 +
  if(ENABLE_GLES1)
 +      if (USE_SDL2)
 +              message(SEND_ERROR "OpenGL ES 1 is not supported with SDL2")
 +      endif()
        add_definitions(-D_IRR_COMPILE_WITH_OGLES1_)
        if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$")
                add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES1_USE_EXTPOINTER_)
-       elseif(DEVICE STREQUAL "IOS")
-               add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_)
        endif()
  endif()
  
@@@ -219,11 -196,6 +208,9 @@@ if(ENABLE_GLES2
        add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
        if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
                add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES2_USE_EXTPOINTER_)
-       elseif(DEVICE STREQUAL "IOS")
-               add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_)
 +      elseif(DEVICE STREQUAL "SDL")
 +              set(USE_SDLGL ON)
 +              set(USE_SDLGLES2 ON)
        endif()
  endif()
  
@@@ -243,7 -215,6 +230,7 @@@ endif(
  
  message(STATUS "Device: ${DEVICE}")
  message(STATUS "OpenGL: ${ENABLE_OPENGL}")
 +message(STATUS "OpenGL 3: ${ENABLE_OPENGL3}")
  message(STATUS "OpenGL ES: ${ENABLE_GLES1}")
  message(STATUS "OpenGL ES 2: ${ENABLE_GLES2}")
  message(STATUS "WebGL: ${ENABLE_WEBGL1}")
@@@ -365,6 -336,12 +352,6 @@@ set(IRRDRVROB
        COpenGLExtensionHandler.cpp
        COGLESDriver.cpp
        COGLESExtensionHandler.cpp
 -      COGLES2Driver.cpp
 -      COGLES2ExtensionHandler.cpp
 -      COGLES2FixedPipelineRenderer.cpp
 -      COGLES2MaterialRenderer.cpp
 -      COGLES2Renderer2D.cpp
 -      CWebGL1Driver.cpp
        CGLXManager.cpp
        CWGLManager.cpp
        CEGLManager.cpp
@@@ -389,37 -366,6 +376,37 @@@ add_library(IRRVIDEOOBJ OBJEC
        ${IRRIMAGEOBJ}
  )
  
 +if(USE_SDLGL)
 +      target_sources(IRRVIDEOOBJ PUBLIC
 +              OpenGL/Driver.cpp
 +              OpenGL/ExtensionHandler.cpp
 +              OpenGL/FixedPipelineRenderer.cpp
 +              OpenGL/MaterialRenderer.cpp
 +              OpenGL/Renderer2D.cpp
 +      )
 +endif()
 +
 +if(USE_SDLGL3)
 +      target_sources(IRRVIDEOOBJ PUBLIC
 +              OpenGL3/Driver.cpp
 +      )
 +endif()
 +
 +if(USE_SDLGLES2)
 +      target_sources(IRRVIDEOOBJ PUBLIC
 +              OpenGLES2/Driver.cpp
 +      )
 +else()
 +      target_sources(IRRVIDEOOBJ PUBLIC
 +              COGLES2Driver.cpp
 +              COGLES2ExtensionHandler.cpp
 +              COGLES2FixedPipelineRenderer.cpp
 +              COGLES2MaterialRenderer.cpp
 +              COGLES2Renderer2D.cpp
 +              CWebGL1Driver.cpp
 +      )
 +endif()
 +
  add_library(IRRIOOBJ OBJECT
        CFileList.cpp
        CFileSystem.cpp
@@@ -442,10 -388,6 +429,10 @@@ add_library(IRROTHEROBJ OBJEC
        os.cpp
  )
  
 +if(ENABLE_OPENGL3)
 +      target_compile_definitions(IRROTHEROBJ PRIVATE ENABLE_OPENGL3)
 +endif()
 +
  if(ANDROID)
        target_sources(IRROTHEROBJ PRIVATE
                Android/CIrrDeviceAndroid.cpp
index a76dbecf4e41254143bd000e5b655a70759e911a,21e143a4cf35e76c2286365840f1b4232ac3cdcf..a02431cf8f51b44d2032619129786a05d6d53bc7
@@@ -719,6 -719,27 +719,6 @@@ void CNullDriver::draw3DLine(const core
  }\r
  \r
  \r
 -//! Draws a 3d triangle.\r
 -void CNullDriver::draw3DTriangle(const core::triangle3df& triangle, SColor color)\r
 -{\r
 -      S3DVertex vertices[3];\r
 -      vertices[0].Pos=triangle.pointA;\r
 -      vertices[0].Color=color;\r
 -      vertices[0].Normal=triangle.getNormal().normalize();\r
 -      vertices[0].TCoords.set(0.f,0.f);\r
 -      vertices[1].Pos=triangle.pointB;\r
 -      vertices[1].Color=color;\r
 -      vertices[1].Normal=vertices[0].Normal;\r
 -      vertices[1].TCoords.set(0.5f,1.f);\r
 -      vertices[2].Pos=triangle.pointC;\r
 -      vertices[2].Color=color;\r
 -      vertices[2].Normal=vertices[0].Normal;\r
 -      vertices[2].TCoords.set(1.f,0.f);\r
 -      const u16 indexList[] = {0,1,2};\r
 -      drawVertexPrimitiveList(vertices, 3, indexList, 1, EVT_STANDARD, scene::EPT_TRIANGLES, EIT_16BIT);\r
 -}\r
 -\r
 -\r
  //! Draws a 3d axis aligned box.\r
  void CNullDriver::draw3DBox(const core::aabbox3d<f32>& box, SColor color)\r
  {\r
@@@ -758,6 -779,31 +758,6 @@@ void CNullDriver::draw2DImage(const vid
  }\r
  \r
  \r
 -\r
 -//! draws a set of 2d images, using a color and the alpha channel of the\r
 -//! texture if desired. The images are drawn beginning at pos and concatenated\r
 -//! in one line. All drawings are clipped against clipRect (if != 0).\r
 -//! The subtextures are defined by the array of sourceRects and are chosen\r
 -//! by the indices given.\r
 -void CNullDriver::draw2DImageBatch(const video::ITexture* texture,\r
 -                              const core::position2d<s32>& pos,\r
 -                              const core::array<core::rect<s32> >& sourceRects,\r
 -                              const core::array<s32>& indices,\r
 -                              s32 kerningWidth,\r
 -                              const core::rect<s32>* clipRect, SColor color,\r
 -                              bool useAlphaChannelOfTexture)\r
 -{\r
 -      core::position2d<s32> target(pos);\r
 -\r
 -      for (u32 i=0; i<indices.size(); ++i)\r
 -      {\r
 -              draw2DImage(texture, target, sourceRects[indices[i]],\r
 -                              clipRect, color, useAlphaChannelOfTexture);\r
 -              target.X += sourceRects[indices[i]].getWidth();\r
 -              target.X += kerningWidth;\r
 -      }\r
 -}\r
 -\r
  //! draws a set of 2d images, using a color and the alpha channel of the\r
  //! texture if desired.\r
  void CNullDriver::draw2DImageBatch(const video::ITexture* texture,\r
@@@ -798,6 -844,16 +798,6 @@@ void CNullDriver::draw2DImage(const vid
  }\r
  \r
  \r
 -//! Draws the outline of a 2d rectangle\r
 -void CNullDriver::draw2DRectangleOutline(const core::recti& pos, SColor color)\r
 -{\r
 -      draw2DLine(pos.UpperLeftCorner, core::position2di(pos.LowerRightCorner.X, pos.UpperLeftCorner.Y), color);\r
 -      draw2DLine(core::position2di(pos.LowerRightCorner.X, pos.UpperLeftCorner.Y), pos.LowerRightCorner, color);\r
 -      draw2DLine(pos.LowerRightCorner, core::position2di(pos.UpperLeftCorner.X, pos.LowerRightCorner.Y), color);\r
 -      draw2DLine(core::position2di(pos.UpperLeftCorner.X, pos.LowerRightCorner.Y), pos.UpperLeftCorner, color);\r
 -}\r
 -\r
 -\r
  //! Draw a 2d rectangle\r
  void CNullDriver::draw2DRectangle(SColor color, const core::rect<s32>& pos, const core::rect<s32>* clip)\r
  {\r
@@@ -821,6 -877,38 +821,6 @@@ void CNullDriver::draw2DLine(const core
  {\r
  }\r
  \r
 -//! Draws a pixel\r
 -void CNullDriver::drawPixel(u32 x, u32 y, const SColor & color)\r
 -{\r
 -}\r
 -\r
 -\r
 -//! Draws a non filled concyclic regular 2d polygon.\r
 -void CNullDriver::draw2DPolygon(core::position2d<s32> center,\r
 -      f32 radius, video::SColor color, s32 count)\r
 -{\r
 -      if (count < 2)\r
 -              return;\r
 -\r
 -      core::position2d<s32> first;\r
 -      core::position2d<s32> a,b;\r
 -\r
 -      for (s32 j=0; j<count; ++j)\r
 -      {\r
 -              b = a;\r
 -\r
 -              f32 p = j / (f32)count * (core::PI*2);\r
 -              a = center + core::position2d<s32>((s32)(sin(p)*radius), (s32)(cos(p)*radius));\r
 -\r
 -              if (j==0)\r
 -                      first = a;\r
 -              else\r
 -                      draw2DLine(a, b, color);\r
 -      }\r
 -\r
 -      draw2DLine(a, first, color);\r
 -}\r
 -\r
  \r
  //! returns color format\r
  ECOLOR_FORMAT CNullDriver::getColorFormat() const\r
@@@ -891,6 -979,25 +891,6 @@@ const wchar_t* CNullDriver::getName() c
  }\r
  \r
  \r
 -\r
 -//! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do\r
 -//! this: First, draw all geometry. Then use this method, to draw the shadow\r
 -//! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.\r
 -void CNullDriver::drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail, u32 debugDataVisible)\r
 -{\r
 -}\r
 -\r
 -\r
 -//! Fills the stencil shadow with color. After the shadow volume has been drawn\r
 -//! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this\r
 -//! to draw the color of the shadow.\r
 -void CNullDriver::drawStencilShadow(bool clearStencilBuffer,\r
 -              video::SColor leftUpEdge, video::SColor rightUpEdge,\r
 -              video::SColor leftDownEdge, video::SColor rightDownEdge)\r
 -{\r
 -}\r
 -\r
 -\r
  //! Creates a boolean alpha channel of the texture based of an color key.\r
  void CNullDriver::makeColorKeyTexture(video::ITexture* texture,\r
                                                                        video::SColor color,\r
@@@ -1717,10 -1824,10 +1717,10 @@@ s32 CNullDriver::addMaterialRenderer(IM
  \r
  \r
  //! Sets the name of a material renderer.\r
- void CNullDriver::setMaterialRendererName(s32 idx, const char* name)\r
+ void CNullDriver::setMaterialRendererName(u32 idx, const char* name)\r
  {\r
-       if (idx < s32(sizeof(sBuiltInMaterialTypeNames) / sizeof(char*))-1 ||\r
-               idx >= (s32)MaterialRenderers.size())\r
+       if (idx < (sizeof(sBuiltInMaterialTypeNames) / sizeof(char*))-1 ||\r
+               idx >= MaterialRenderers.size())\r
                return;\r
  \r
        MaterialRenderers[idx].Name = name;\r
index 33620452df6f4db6b7d0cc5abfbc5061f7b5f586,625ff1a6c45204846a0e7d599f39ba4ad41941aa..e6b27d87718b3397c7f8ad9e9c0ecce24ebc1a9a
@@@ -126,8 -126,9 +126,8 @@@ namespace vide
                virtual void draw3DLine(const core::vector3df& start,\r
                        const core::vector3df& end, SColor color = SColor(255,255,255,255)) override;\r
  \r
 -              //! Draws a 3d triangle.\r
 -              virtual void draw3DTriangle(const core::triangle3df& triangle,\r
 -                      SColor color = SColor(255,255,255,255)) override;\r
 +              [[deprecated]] virtual void draw3DTriangle(const core::triangle3df& triangle,\r
 +                      SColor color = SColor(255,255,255,255)) {}\r
  \r
                //! Draws a 3d axis aligned box.\r
                virtual void draw3DBox(const core::aabbox3d<f32>& box,\r
                Note that the alpha component is used: If alpha is other than 255, the image will be transparent.\r
                \param useAlphaChannelOfTexture: If true, the alpha channel of the texture is\r
                used to draw the image. */\r
 -              virtual void draw2DImageBatch(const video::ITexture* texture,\r
 +              [[deprecated]] virtual void draw2DImageBatch(const video::ITexture* texture,\r
                                const core::position2d<s32>& pos,\r
                                const core::array<core::rect<s32> >& sourceRects,\r
                                const core::array<s32>& indices,\r
                                s32 kerningWidth = 0,\r
                                const core::rect<s32>* clipRect = 0,\r
                                SColor color=SColor(255,255,255,255),\r
 -                              bool useAlphaChannelOfTexture=false) override;\r
 +                              bool useAlphaChannelOfTexture=false) {}\r
  \r
                //! Draws a set of 2d images, using a color and the alpha channel of the texture.\r
                /** All drawings are clipped against clipRect (if != 0).\r
                        const core::rect<s32>* clip = 0) override;\r
  \r
                //! Draws the outline of a 2d rectangle\r
 -              void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255)) override;\r
 +              [[deprecated]] virtual void draw2DRectangleOutline(const core::recti& pos, SColor color=SColor(255,255,255,255)) {}\r
  \r
                //! Draws a 2d line.\r
                virtual void draw2DLine(const core::position2d<s32>& start,\r
                                        SColor color=SColor(255,255,255,255)) override;\r
  \r
                //! Draws a pixel\r
 -              void drawPixel(u32 x, u32 y, const SColor & color) override;\r
 +              [[deprecated]] virtual void drawPixel(u32 x, u32 y, const SColor & color) {}\r
  \r
                //! Draws a non filled concyclic reqular 2d polygon.\r
 -              virtual void draw2DPolygon(core::position2d<s32> center,\r
 -                      f32 radius, video::SColor Color, s32 vertexCount) override;\r
 +              [[deprecated]] virtual void draw2DPolygon(core::position2d<s32> center,\r
 +                      f32 radius, video::SColor Color, s32 vertexCount) {}\r
  \r
                virtual void setFog(SColor color=SColor(0,255,255,255),\r
                                E_FOG_TYPE fogType=EFT_FOG_LINEAR,\r
                //! Draws a shadow volume into the stencil buffer. To draw a stencil shadow, do\r
                //! this: First, draw all geometry. Then use this method, to draw the shadow\r
                //! volume. Then, use IVideoDriver::drawStencilShadow() to visualize the shadow.\r
 -              virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles,\r
 -                      bool zfail=true, u32 debugDataVisible=0) override;\r
 +              [[deprecated]] virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles,\r
 +                      bool zfail=true, u32 debugDataVisible=0) {}\r
  \r
                //! Fills the stencil shadow with color. After the shadow volume has been drawn\r
                //! into the stencil buffer using IVideoDriver::drawStencilShadowVolume(), use this\r
                //! to draw the color of the shadow.\r
 -              virtual void drawStencilShadow(bool clearStencilBuffer=false,\r
 +              [[deprecated]] virtual void drawStencilShadow(bool clearStencilBuffer=false,\r
                        video::SColor leftUpEdge = video::SColor(0,0,0,0),\r
                        video::SColor rightUpEdge = video::SColor(0,0,0,0),\r
                        video::SColor leftDownEdge = video::SColor(0,0,0,0),\r
 -                      video::SColor rightDownEdge = video::SColor(0,0,0,0)) override;\r
 +                      video::SColor rightDownEdge = video::SColor(0,0,0,0)) {}\r
  \r
  \r
                //! Removes a texture from the texture cache and deletes it, freeing lot of\r
                bool writeImageToFile(IImage* image, io::IWriteFile * file, u32 param = 0) override;\r
  \r
                //! Sets the name of a material renderer.\r
-               void setMaterialRendererName(s32 idx, const char* name) override;\r
+               void setMaterialRendererName(u32 idx, const char* name) override;\r
  \r
                //! Swap the material renderers used for certain id's\r
                void swapMaterialRenderers(u32 idx1, u32 idx2, bool swapNames) override;\r
index ed6b0828fdc6af59caa6b328e856bc507cd38489,e598ec355647e42882e552711b6f052d6af0a3bd..d1d26780c249dd57d1d5133123cebcab8b8c65de
@@@ -29,10 -29,6 +29,6 @@@ static const char* const copyright = "I
  #include "CIrrDeviceSDL.h"\r
  #endif\r
  \r
- #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_\r
- #include "CIrrDeviceiOS.h"\r
- #endif\r
\r
  #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_\r
  #include "Android/CIrrDeviceAndroid.h"\r
  #endif\r
@@@ -78,11 -74,6 +74,6 @@@ namespace ir
                if (params.DeviceType == EIDT_X11 || (!dev && params.DeviceType == EIDT_BEST))\r
                        dev = new CIrrDeviceLinux(params);\r
  #endif\r
-         \r
- #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_\r
-               if (params.DeviceType == EIDT_IOS || (!dev && params.DeviceType == EIDT_BEST))\r
-                       dev = new CIrrDeviceiOS(params);\r
- #endif\r
  \r
  #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_\r
                if (params.DeviceType == EIDT_ANDROID || (!dev && params.DeviceType == EIDT_BEST))\r
@@@ -118,9 -109,6 +109,9 @@@ namespace vide
        {\r
                switch (driver) {\r
                        case EDT_NULL: return true;\r
 +#ifdef ENABLE_OPENGL3\r
 +                      case EDT_OPENGL3: return true;\r
 +#endif\r
  #ifdef _IRR_COMPILE_WITH_OPENGL_\r
                        case EDT_OPENGL: return true;\r
  #endif\r