X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2FIVideoDriver.cpp;h=ea27d4c735a7bb8184b9b59ace5fd0fe543c5692;hb=b226e30a662f768934061c7cb0fefc5f31d3b71f;hp=517275d973d7350b62789a4238ff847b44c4a34b;hpb=abace28761d72d1aa00150f60eafa6723581c65c;p=c-irrlicht.git diff --git a/src/IVideoDriver.cpp b/src/IVideoDriver.cpp index 517275d..ea27d4c 100644 --- a/src/IVideoDriver.cpp +++ b/src/IVideoDriver.cpp @@ -23,37 +23,52 @@ #include "IVideoDriver.h" extern "C" { - bool irr_video_IVideoDriver_beginScene(void* driver, - bool backBuffer, - bool zBuffer, - const irr_video_SColor* color, - void* videoData, // not used for now - const irr_core_rect_s32* sourceRect) + int + irr_video_IVideoDriver_beginScene(irr_video_IVideoDriver* driver, + int backBuffer, + int zBuffer, + const irr_video_SColor* color, + irr_video_SExposedVideoData* videoData, + const irr_core_rect_s32* sourceRect) { // Color irr::video::SColor col = irr::video::SColor(color->a, color->r, color->g, color->b); // Video data + // TODO irr::video::SExposedVideoData vdata = irr::video::SExposedVideoData(); // Source rect - irr::core::rect rect = \ - irr::core::rect(sourceRect->x, - sourceRect->y, - sourceRect->x2, - sourceRect->y2); + irr::core::rect rect; + if (sourceRect != NULL) + { + rect = irr::core::rect(sourceRect->x, + sourceRect->y, + sourceRect->x2, + sourceRect->y2); + } // Begin scene return ((irr::video::IVideoDriver*)driver)->beginScene(backBuffer, - zBuffer, - col, - vdata, - &rect); + zBuffer, + col, + vdata, + sourceRect != NULL ? &rect : 0); } - bool irr_video_IVideoDriver_endScene(void* driver) + int + irr_video_IVideoDriver_endScene(irr_video_IVideoDriver* driver) { return ((irr::video::IVideoDriver*)driver)->endScene(); } + + irr_video_ITexture* + irr_video_IVideoDriver_getTexture(irr_video_IVideoDriver* driver, + const char* filename) + { + return (irr_video_ITexture*) + ((irr::video::IVideoDriver*)driver)->getTexture(filename); + } + }