From 7d3142b969c72d9bcaca1836acc8dc69485e18a5 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 2 Jan 2023 21:21:53 +0100 Subject: [PATCH] Remove leftover code from software rendering --- source/Irrlicht/Android/CIrrDeviceAndroid.cpp | 5 - source/Irrlicht/Android/CIrrDeviceAndroid.h | 5 +- source/Irrlicht/CIrrDeviceLinux.cpp | 103 +---------------- source/Irrlicht/CIrrDeviceLinux.h | 7 +- source/Irrlicht/CIrrDeviceOSX.h | 8 +- source/Irrlicht/CIrrDeviceOSX.mm | 104 +----------------- source/Irrlicht/CIrrDeviceSDL.cpp | 100 ----------------- source/Irrlicht/CIrrDeviceSDL.h | 6 +- source/Irrlicht/CIrrDeviceStub.h | 6 - source/Irrlicht/CIrrDeviceWin32.cpp | 66 ----------- source/Irrlicht/CIrrDeviceWin32.h | 6 +- source/Irrlicht/CIrrDeviceiOS.h | 5 +- source/Irrlicht/CIrrDeviceiOS.mm | 5 - source/Irrlicht/CNullDriver.h | 1 - source/Irrlicht/IImagePresenter.h | 36 ------ 15 files changed, 9 insertions(+), 454 deletions(-) delete mode 100644 source/Irrlicht/IImagePresenter.h diff --git a/source/Irrlicht/Android/CIrrDeviceAndroid.cpp b/source/Irrlicht/Android/CIrrDeviceAndroid.cpp index 55668a26..43c5b0f3 100644 --- a/source/Irrlicht/Android/CIrrDeviceAndroid.cpp +++ b/source/Irrlicht/Android/CIrrDeviceAndroid.cpp @@ -180,11 +180,6 @@ void CIrrDeviceAndroid::setWindowCaption(const wchar_t* text) { } -bool CIrrDeviceAndroid::present(video::IImage* surface, void* windowId, core::rect* srcClip) -{ - return true; -} - bool CIrrDeviceAndroid::isWindowActive() const { return (Focused && !Paused); diff --git a/source/Irrlicht/Android/CIrrDeviceAndroid.h b/source/Irrlicht/Android/CIrrDeviceAndroid.h index b29a26e8..a1f13c3a 100644 --- a/source/Irrlicht/Android/CIrrDeviceAndroid.h +++ b/source/Irrlicht/Android/CIrrDeviceAndroid.h @@ -11,7 +11,6 @@ #include "CIrrDeviceStub.h" #include "IrrlichtDevice.h" -#include "IImagePresenter.h" #include "ICursorControl.h" #include @@ -19,7 +18,7 @@ namespace irr { - class CIrrDeviceAndroid : public CIrrDeviceStub, video::IImagePresenter + class CIrrDeviceAndroid : public CIrrDeviceStub { public: CIrrDeviceAndroid(const SIrrlichtCreationParameters& param); @@ -34,8 +33,6 @@ namespace irr virtual void setWindowCaption(const wchar_t* text); - virtual bool present(video::IImage* surface, void* windowId, core::rect* srcClip); - virtual bool isWindowActive() const; virtual bool isWindowFocused() const; diff --git a/source/Irrlicht/CIrrDeviceLinux.cpp b/source/Irrlicht/CIrrDeviceLinux.cpp index d500af06..91d1e470 100644 --- a/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/source/Irrlicht/CIrrDeviceLinux.cpp @@ -110,7 +110,7 @@ namespace irr CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param) : CIrrDeviceStub(param), #ifdef _IRR_COMPILE_WITH_X11_ - XDisplay(0), VisualInfo(0), Screennr(0), XWindow(0), StdHints(0), SoftwareImage(0), + XDisplay(0), VisualInfo(0), Screennr(0), XWindow(0), StdHints(0), XInputMethod(0), XInputContext(0), HasNetWM(false), #endif @@ -211,9 +211,6 @@ CIrrDeviceLinux::~CIrrDeviceLinux() ContextManager->destroySurface(); } - if (SoftwareImage) - XDestroyImage(SoftwareImage); - if (!ExternalWindow) { XDestroyWindow(XDisplay,XWindow); @@ -487,21 +484,6 @@ bool CIrrDeviceLinux::createWindow() long num; XGetWMNormalHints(XDisplay, XWindow, StdHints, &num); - // create an XImage for the software renderer - //(thx to Nadav for some clues on how to do that!) - - if (CreationParams.DriverType == video::EDT_SOFTWARE || CreationParams.DriverType == video::EDT_BURNINGSVIDEO) - { - SoftwareImage = XCreateImage(XDisplay, - VisualInfo->visual, VisualInfo->depth, - ZPixmap, 0, 0, Width, Height, - BitmapPad(XDisplay), 0); - - // use malloc because X will free it later on - if (SoftwareImage) - SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char)); - } - initXInput2(); #endif // #ifdef _IRR_COMPILE_WITH_X11_ @@ -515,20 +497,6 @@ void CIrrDeviceLinux::createDriver() switch(CreationParams.DriverType) { #ifdef _IRR_COMPILE_WITH_X11_ - case video::EDT_SOFTWARE: -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this); -#else - os::Printer::log("No Software driver support compiled in.", ELL_ERROR); -#endif - break; - case video::EDT_BURNINGSVIDEO: -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this); -#else - os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR); -#endif - break; case video::EDT_OPENGL: #ifdef _IRR_COMPILE_WITH_OPENGL_ { @@ -765,21 +733,6 @@ bool CIrrDeviceLinux::run() Width = event.xconfigure.width; Height = event.xconfigure.height; - // resize image data - if (SoftwareImage) - { - XDestroyImage(SoftwareImage); - - SoftwareImage = XCreateImage(XDisplay, - VisualInfo->visual, VisualInfo->depth, - ZPixmap, 0, 0, Width, Height, - BitmapPad(XDisplay), 0); - - // use malloc because X will free it later on - if (SoftwareImage) - SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char)); - } - if (VideoDriver) VideoDriver->OnResize(core::dimension2d(Width, Height)); } @@ -1219,60 +1172,6 @@ void CIrrDeviceLinux::setWindowCaption(const wchar_t* text) } -//! presents a surface in the client area -bool CIrrDeviceLinux::present(video::IImage* image, void* windowId, core::rect* srcRect) -{ -#ifdef _IRR_COMPILE_WITH_X11_ - // this is only necessary for software drivers. - if (!SoftwareImage) - return true; - - // thx to Nadav, who send me some clues of how to display the image - // to the X Server. - - const u32 destwidth = SoftwareImage->width; - const u32 minWidth = core::min_(image->getDimension().Width, destwidth); - const u32 destPitch = SoftwareImage->bytes_per_line; - - video::ECOLOR_FORMAT destColor; - switch (SoftwareImage->bits_per_pixel) - { - case 16: - if (SoftwareImage->depth==16) - destColor = video::ECF_R5G6B5; - else - destColor = video::ECF_A1R5G5B5; - break; - case 24: destColor = video::ECF_R8G8B8; break; - case 32: destColor = video::ECF_A8R8G8B8; break; - default: - os::Printer::log("Unsupported screen depth."); - return false; - } - - u8* srcdata = reinterpret_cast(image->getData()); - u8* destData = reinterpret_cast(SoftwareImage->data); - - const u32 destheight = SoftwareImage->height; - const u32 srcheight = core::min_(image->getDimension().Height, destheight); - const u32 srcPitch = image->getPitch(); - for (u32 y=0; y!=srcheight; ++y) - { - video::CColorConverter::convert_viaFormat(srcdata,image->getColorFormat(), minWidth, destData, destColor); - srcdata+=srcPitch; - destData+=destPitch; - } - - GC gc = DefaultGC(XDisplay, DefaultScreen(XDisplay)); - Window myWindow=XWindow; - if (windowId) - myWindow = reinterpret_cast(windowId); - XPutImage(XDisplay, myWindow, gc, SoftwareImage, 0, 0, 0, 0, destwidth, destheight); -#endif - return true; -} - - //! notifies the device that it should close itself void CIrrDeviceLinux::closeDevice() { diff --git a/source/Irrlicht/CIrrDeviceLinux.h b/source/Irrlicht/CIrrDeviceLinux.h index 1ef76724..fe1ede03 100644 --- a/source/Irrlicht/CIrrDeviceLinux.h +++ b/source/Irrlicht/CIrrDeviceLinux.h @@ -11,7 +11,6 @@ #include "CIrrDeviceStub.h" #include "IrrlichtDevice.h" -#include "IImagePresenter.h" #include "ICursorControl.h" #include "os.h" @@ -33,7 +32,7 @@ namespace irr { - class CIrrDeviceLinux : public CIrrDeviceStub, public video::IImagePresenter + class CIrrDeviceLinux : public CIrrDeviceStub { public: @@ -68,9 +67,6 @@ namespace irr //! returns color format of the window. video::ECOLOR_FORMAT getColorFormat() const override; - //! presents a surface in the client area - bool present(video::IImage* surface, void* windowId=0, core::rect* src=0 ) override; - //! notifies the device that it should close itself void closeDevice() override; @@ -410,7 +406,6 @@ namespace irr Window XWindow; XSetWindowAttributes WndAttributes; XSizeHints* StdHints; - XImage* SoftwareImage; XIM XInputMethod; XIC XInputContext; bool HasNetWM; diff --git a/source/Irrlicht/CIrrDeviceOSX.h b/source/Irrlicht/CIrrDeviceOSX.h index 6eac56d4..b8cdb42b 100644 --- a/source/Irrlicht/CIrrDeviceOSX.h +++ b/source/Irrlicht/CIrrDeviceOSX.h @@ -12,7 +12,6 @@ #include "CIrrDeviceStub.h" #include "IrrlichtDevice.h" -#include "IImagePresenter.h" #include "IGUIEnvironment.h" #include "ICursorControl.h" @@ -36,7 +35,7 @@ namespace irr namespace irr { - class CIrrDeviceMacOSX : public CIrrDeviceStub, video::IImagePresenter + class CIrrDeviceMacOSX : public CIrrDeviceStub { public: @@ -68,9 +67,6 @@ namespace irr //! Checks if the Irrlicht window is minimized bool isWindowMinimized() const override; - //! presents a surface in the client area - bool present(video::IImage* surface, void* windowId=0, core::rect* src=0 ) override; - //! notifies the device that it should close itself void closeDevice() override; @@ -237,14 +233,12 @@ namespace irr NSWindow* Window; CGDirectDisplayID Display; - NSBitmapImageRep* SoftwareDriverTarget; std::map KeyCodes; int DeviceWidth; int DeviceHeight; int ScreenWidth; int ScreenHeight; u32 MouseButtonStates; - u32 SoftwareRendererType; bool IsFullscreen; bool IsActive; bool IsShiftDown; diff --git a/source/Irrlicht/CIrrDeviceOSX.mm b/source/Irrlicht/CIrrDeviceOSX.mm index 16236e04..e3b2a9ab 100644 --- a/source/Irrlicht/CIrrDeviceOSX.mm +++ b/source/Irrlicht/CIrrDeviceOSX.mm @@ -547,8 +547,8 @@ namespace irr //! constructor CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) : CIrrDeviceStub(param), Window(NULL), Display(NULL), - SoftwareDriverTarget(0), DeviceWidth(0), DeviceHeight(0), - ScreenWidth(0), ScreenHeight(0), MouseButtonStates(0), SoftwareRendererType(0), + DeviceWidth(0), DeviceHeight(0), + ScreenWidth(0), ScreenHeight(0), MouseButtonStates(0), IsActive(true), IsFullscreen(false), IsShiftDown(false), IsControlDown(false), IsResizable(false) { struct utsname name; @@ -617,7 +617,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param) CIrrDeviceMacOSX::~CIrrDeviceMacOSX() { - [SoftwareDriverTarget release]; [NSApp setPresentationOptions:(NSApplicationPresentationDefault)]; closeDevice(); #if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) @@ -731,24 +730,6 @@ void CIrrDeviceMacOSX::createDriver() { switch (CreationParams.DriverType) { - case video::EDT_SOFTWARE: -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this); - SoftwareRendererType = 2; -#else - os::Printer::log("No Software driver support compiled in.", ELL_ERROR); -#endif - break; - - case video::EDT_BURNINGSVIDEO: -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this); - SoftwareRendererType = 1; -#else - os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR); -#endif - break; - case video::EDT_OPENGL: #ifdef _IRR_COMPILE_WITH_OPENGL_ { @@ -1358,87 +1339,6 @@ core::position2di CIrrDeviceMacOSX::getWindowPosition() } - -bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect* src ) -{ - // todo: implement window ID and src rectangle - - if (!surface) - return false; - - if (SoftwareRendererType > 0) - { - const u32 colorSamples=3; - // do we need to change the size? - const bool updateSize = !SoftwareDriverTarget || - s32([SoftwareDriverTarget size].width) != surface->getDimension().Width || - s32([SoftwareDriverTarget size].height) != surface->getDimension().Height; - - NSRect areaRect = NSMakeRect(0.0, 0.0, surface->getDimension().Width, surface->getDimension().Height); - const u32 destPitch = (colorSamples * areaRect.size.width); - - // create / update the target - if (updateSize) - { - [SoftwareDriverTarget release]; - // allocate target for IImage - SoftwareDriverTarget = [[NSBitmapImageRep alloc] - initWithBitmapDataPlanes: nil - pixelsWide: areaRect.size.width - pixelsHigh: areaRect.size.height - bitsPerSample: 8 - samplesPerPixel: colorSamples - hasAlpha: NO - isPlanar: NO - colorSpaceName: NSCalibratedRGBColorSpace - bytesPerRow: destPitch - bitsPerPixel: 8*colorSamples]; - } - - if (SoftwareDriverTarget==nil) - return false; - - // get pointer to image data - unsigned char* imgData = (unsigned char*)surface->getData(); - - u8* srcdata = reinterpret_cast(imgData); - u8* destData = reinterpret_cast([SoftwareDriverTarget bitmapData]); - const u32 srcheight = core::min_(surface->getDimension().Height, (u32)areaRect.size.height); - const u32 srcPitch = surface->getPitch(); - const u32 minWidth = core::min_(surface->getDimension().Width, (u32)areaRect.size.width); - for (u32 y=0; y!=srcheight; ++y) - { - if(SoftwareRendererType == 2) - { - if (surface->getColorFormat() == video::ECF_A8R8G8B8) - video::CColorConverter::convert_A8R8G8B8toB8G8R8(srcdata, minWidth, destData); - else if (surface->getColorFormat() == video::ECF_A1R5G5B5) - video::CColorConverter::convert_A1R5G5B5toB8G8R8(srcdata, minWidth, destData); - else - video::CColorConverter::convert_viaFormat(srcdata, surface->getColorFormat(), minWidth, destData, video::ECF_R8G8B8); - } - else - { - if (surface->getColorFormat() == video::ECF_A8R8G8B8) - video::CColorConverter::convert_A8R8G8B8toR8G8B8(srcdata, minWidth, destData); - else if (surface->getColorFormat() == video::ECF_A1R5G5B5) - video::CColorConverter::convert_A1R5G5B5toR8G8B8(srcdata, minWidth, destData); - else - video::CColorConverter::convert_viaFormat(srcdata, surface->getColorFormat(), minWidth, destData, video::ECF_R8G8B8); - } - - srcdata += srcPitch; - destData += destPitch; - } - - // todo: draw properly into a sub-view - [SoftwareDriverTarget draw]; - } - - return false; -} - - #if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) static void joystickRemovalCallback(void * target, IOReturn result, void * refcon, void * sender) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 12574d5a..8452c6b9 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -372,22 +372,6 @@ void CIrrDeviceSDL::createDriver() break; - case video::EDT_SOFTWARE: - #ifdef _IRR_COMPILE_WITH_SOFTWARE_ - VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this); - #else - os::Printer::log("No Software driver support compiled in.", ELL_ERROR); - #endif - break; - - case video::EDT_BURNINGSVIDEO: - #ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this); - #else - os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR); - #endif - break; - case video::EDT_OPENGL: #ifdef _IRR_COMPILE_WITH_OPENGL_ ContextManager = new video::CSDLManager(this); @@ -846,90 +830,6 @@ void CIrrDeviceSDL::setWindowCaption(const wchar_t* text) } -//! presents a surface in the client area -bool CIrrDeviceSDL::present(video::IImage* surface, void* windowId, core::rect* srcClip) -{ -#ifdef _IRR_EMSCRIPTEN_PLATFORM_ - return true; -#else // !_IRR_EMSCRIPTEN_PLATFORM_ - SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom( - surface->getData(), surface->getDimension().Width, surface->getDimension().Height, - surface->getBitsPerPixel(), surface->getPitch(), - surface->getRedMask(), surface->getGreenMask(), surface->getBlueMask(), surface->getAlphaMask()); - if (!sdlSurface) - return false; - SDL_SetSurfaceAlphaMod(sdlSurface, 0); - SDL_SetColorKey(sdlSurface, 0, 0); - sdlSurface->format->BitsPerPixel=surface->getBitsPerPixel(); - sdlSurface->format->BytesPerPixel=surface->getBytesPerPixel(); - if ((surface->getColorFormat()==video::ECF_R8G8B8) || - (surface->getColorFormat()==video::ECF_A8R8G8B8)) - { - sdlSurface->format->Rloss=0; - sdlSurface->format->Gloss=0; - sdlSurface->format->Bloss=0; - sdlSurface->format->Rshift=16; - sdlSurface->format->Gshift=8; - sdlSurface->format->Bshift=0; - if (surface->getColorFormat()==video::ECF_R8G8B8) - { - sdlSurface->format->Aloss=8; - sdlSurface->format->Ashift=32; - } - else - { - sdlSurface->format->Aloss=0; - sdlSurface->format->Ashift=24; - } - } - else if (surface->getColorFormat()==video::ECF_R5G6B5) - { - sdlSurface->format->Rloss=3; - sdlSurface->format->Gloss=2; - sdlSurface->format->Bloss=3; - sdlSurface->format->Aloss=8; - sdlSurface->format->Rshift=11; - sdlSurface->format->Gshift=5; - sdlSurface->format->Bshift=0; - sdlSurface->format->Ashift=16; - } - else if (surface->getColorFormat()==video::ECF_A1R5G5B5) - { - sdlSurface->format->Rloss=3; - sdlSurface->format->Gloss=3; - sdlSurface->format->Bloss=3; - sdlSurface->format->Aloss=7; - sdlSurface->format->Rshift=10; - sdlSurface->format->Gshift=5; - sdlSurface->format->Bshift=0; - sdlSurface->format->Ashift=15; - } - - SDL_Surface* scr = (SDL_Surface* )windowId; - if (!scr) - scr = SDL_GetWindowSurface(Window); - if (scr) - { - if (srcClip) - { - SDL_Rect sdlsrcClip; - sdlsrcClip.x = srcClip->UpperLeftCorner.X; - sdlsrcClip.y = srcClip->UpperLeftCorner.Y; - sdlsrcClip.w = srcClip->getWidth(); - sdlsrcClip.h = srcClip->getHeight(); - SDL_BlitSurface(sdlSurface, &sdlsrcClip, scr, NULL); - } - else - SDL_BlitSurface(sdlSurface, NULL, scr, NULL); - SDL_RenderPresent(SDL_GetRenderer(Window)); - } - - SDL_FreeSurface(sdlSurface); - return (scr != 0); -#endif // !_IRR_EMSCRIPTEN_PLATFORM_ -} - - //! notifies the device that it should close itself void CIrrDeviceSDL::closeDevice() { diff --git a/source/Irrlicht/CIrrDeviceSDL.h b/source/Irrlicht/CIrrDeviceSDL.h index ab809ddc..5a38d774 100644 --- a/source/Irrlicht/CIrrDeviceSDL.h +++ b/source/Irrlicht/CIrrDeviceSDL.h @@ -13,7 +13,6 @@ #include "IrrlichtDevice.h" #include "CIrrDeviceStub.h" -#include "IImagePresenter.h" #include "ICursorControl.h" #ifdef _IRR_EMSCRIPTEN_PLATFORM_ @@ -28,7 +27,7 @@ namespace irr { - class CIrrDeviceSDL : public CIrrDeviceStub, video::IImagePresenter + class CIrrDeviceSDL : public CIrrDeviceStub { public: @@ -62,9 +61,6 @@ namespace irr //! returns color format of the window. video::ECOLOR_FORMAT getColorFormat() const override; - //! presents a surface in the client area - bool present(video::IImage* surface, void* windowId=0, core::rect* src=0) override; - //! notifies the device that it should close itself void closeDevice() override; diff --git a/source/Irrlicht/CIrrDeviceStub.h b/source/Irrlicht/CIrrDeviceStub.h index ab90e501..c6e00593 100644 --- a/source/Irrlicht/CIrrDeviceStub.h +++ b/source/Irrlicht/CIrrDeviceStub.h @@ -6,7 +6,6 @@ #define __C_IRR_DEVICE_STUB_H_INCLUDED__ #include "IrrlichtDevice.h" -#include "IImagePresenter.h" #include "SIrrCreationParameters.h" #include "IContextManager.h" @@ -36,11 +35,6 @@ namespace irr namespace video { - IVideoDriver* createSoftwareDriver(const core::dimension2d& windowSize, - bool fullscreen, io::IFileSystem* io, - video::IImagePresenter* presenter); - IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params, - io::IFileSystem* io, video::IImagePresenter* presenter); IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d& screenSize); } diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index f5508078..0c513040 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -1009,24 +1009,6 @@ void CIrrDeviceWin32::createDriver() case video::EDT_WEBGL1: os::Printer::log("WebGL1 driver not supported on Win32 device.", ELL_ERROR); break; - case video::EDT_SOFTWARE: -#ifdef _IRR_COMPILE_WITH_SOFTWARE_ - switchToFullScreen(); - - VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this); -#else - os::Printer::log("Software driver was not compiled in.", ELL_ERROR); -#endif - break; - case video::EDT_BURNINGSVIDEO: -#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_ - switchToFullScreen(); - - VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this); -#else - os::Printer::log("Burning's Video driver was not compiled in.", ELL_ERROR); -#endif - break; case video::EDT_NULL: VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize); break; @@ -1127,54 +1109,6 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text) } -//! presents a surface in the client area -bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rect* src) -{ - HWND hwnd = HWnd; - if ( windowId ) - hwnd = static_cast(windowId); - - HDC dc = GetDC(hwnd); - - if ( dc ) - { - RECT rect; - GetClientRect(hwnd, &rect); - const void* memory = (const void *)image->getData(); - - BITMAPV4HEADER bi; - ZeroMemory (&bi, sizeof(bi)); - bi.bV4Size = sizeof(BITMAPINFOHEADER); - bi.bV4BitCount = (WORD)image->getBitsPerPixel(); - bi.bV4Planes = 1; - bi.bV4Width = image->getDimension().Width; - bi.bV4Height = -((s32)image->getDimension().Height); - bi.bV4V4Compression = BI_BITFIELDS; - bi.bV4AlphaMask = image->getAlphaMask(); - bi.bV4RedMask = image->getRedMask(); - bi.bV4GreenMask = image->getGreenMask(); - bi.bV4BlueMask = image->getBlueMask(); - - if ( src ) - { - StretchDIBits(dc, 0,0, rect.right, rect.bottom, - src->UpperLeftCorner.X, src->UpperLeftCorner.Y, - src->getWidth(), src->getHeight(), - memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY); - } - else - { - StretchDIBits(dc, 0,0, rect.right, rect.bottom, - 0, 0, image->getDimension().Width, image->getDimension().Height, - memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY); - } - - ReleaseDC(hwnd, dc); - } - return true; -} - - //! notifies the device that it should close itself void CIrrDeviceWin32::closeDevice() { diff --git a/source/Irrlicht/CIrrDeviceWin32.h b/source/Irrlicht/CIrrDeviceWin32.h index 92cdb8f8..8cd324bc 100644 --- a/source/Irrlicht/CIrrDeviceWin32.h +++ b/source/Irrlicht/CIrrDeviceWin32.h @@ -10,7 +10,6 @@ #include "CIrrDeviceStub.h" #include "IrrlichtDevice.h" -#include "IImagePresenter.h" #define WIN32_LEAN_AND_MEAN #include @@ -25,7 +24,7 @@ namespace irr { struct SJoystickWin32Control; - class CIrrDeviceWin32 : public CIrrDeviceStub, video::IImagePresenter + class CIrrDeviceWin32 : public CIrrDeviceStub { friend struct SJoystickWin32Control; public: @@ -58,9 +57,6 @@ namespace irr //! returns if window is minimized bool isWindowMinimized() const override; - //! presents a surface in the client area - bool present(video::IImage* surface, void* windowId=0, core::rect* src=0) override; - //! notifies the device that it should close itself void closeDevice() override; diff --git a/source/Irrlicht/CIrrDeviceiOS.h b/source/Irrlicht/CIrrDeviceiOS.h index 13ebf60b..d383c182 100644 --- a/source/Irrlicht/CIrrDeviceiOS.h +++ b/source/Irrlicht/CIrrDeviceiOS.h @@ -13,12 +13,11 @@ #include "CIrrDeviceStub.h" #include "IrrlichtDevice.h" -#include "IImagePresenter.h" namespace irr { - class CIrrDeviceiOS : public CIrrDeviceStub, public video::IImagePresenter + class CIrrDeviceiOS : public CIrrDeviceStub { public: CIrrDeviceiOS(const SIrrlichtCreationParameters& params); @@ -34,8 +33,6 @@ namespace irr bool isWindowFocused() const override; bool isWindowMinimized() const override; - bool present(video::IImage* surface, void * windowId = 0, core::rect* src = 0) override; - void closeDevice() override; void setResizable(bool resize = false) override; diff --git a/source/Irrlicht/CIrrDeviceiOS.mm b/source/Irrlicht/CIrrDeviceiOS.mm index 8386e1e3..3a0575d3 100644 --- a/source/Irrlicht/CIrrDeviceiOS.mm +++ b/source/Irrlicht/CIrrDeviceiOS.mm @@ -480,11 +480,6 @@ namespace irr #endif } - bool CIrrDeviceiOS::present(video::IImage* image, void * windowId, core::rect* src) - { - return false; - } - void CIrrDeviceiOS::closeDevice() { CFRunLoopStop(CFRunLoopGetMain()); diff --git a/source/Irrlicht/CNullDriver.h b/source/Irrlicht/CNullDriver.h index 81993085..e6cdce66 100644 --- a/source/Irrlicht/CNullDriver.h +++ b/source/Irrlicht/CNullDriver.h @@ -7,7 +7,6 @@ #include "IVideoDriver.h" #include "IFileSystem.h" -#include "IImagePresenter.h" #include "IGPUProgrammingServices.h" #include "irrArray.h" #include "irrString.h" diff --git a/source/Irrlicht/IImagePresenter.h b/source/Irrlicht/IImagePresenter.h deleted file mode 100644 index c93fc855..00000000 --- a/source/Irrlicht/IImagePresenter.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2002-2012 Nikolaus Gebhardt -// This file is part of the "Irrlicht Engine". -// For conditions of distribution and use, see copyright notice in irrlicht.h - -#ifndef __I_IMAGE_PRESENTER_H_INCLUDED__ -#define __I_IMAGE_PRESENTER_H_INCLUDED__ - -#include "IImage.h" - -namespace irr -{ -namespace video -{ - -/*! - Interface for a class which is able to present an IImage - an the Screen. Usually only implemented by an IrrDevice for - presenting Software Device Rendered images. - - This class should be used only internally. -*/ - - class IImagePresenter - { - public: - - virtual ~IImagePresenter() {}; - //! presents a surface in the client area - virtual bool present(video::IImage* surface, void* windowId=0, core::rect* src=0 ) = 0; - }; - -} // end namespace video -} // end namespace irr - -#endif -