I used the DX9 renderer in Irrlicht, it works very similar to SFML with win32 integration.
Here are my viewport files.
Header
#ifndef Viewport_h
#define Viewport_h
#include <windows.h>
#include <irrlicht.h>
class Viewport
{
public:
Viewport(HWND hWnd, HINSTANCE hInstance);
~Viewport();
void Run();
protected:
HWND irrlichtViewport;
irr::IrrlichtDevice* device;
irr::video::IVideoDriver* driver;
irr::scene::ISceneManager* smgr;
};
#endif
Source File
#include "Viewport.h"
Viewport::Viewport(HWND hWnd, HINSTANCE hInstance)
{
irrlichtViewport = CreateWindowW(L"STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS,
0, 0, 864, 600, hWnd, NULL, hInstance, NULL);
irr::SIrrlichtCreationParameters params;
params.DriverType = irr::video::EDT_DIRECT3D9;
params.WindowId = reinterpret_cast<void*>(irrlichtViewport);
device = irr::createDeviceEx(params);
driver = device->getVideoDriver();
smgr = device->getSceneManager();
smgr->addCameraSceneNode(0, irr::core::vector3df(5,5,5),irr::core::vector3df(0,0,0));
irr::scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../Media/floortile.obj"));
node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
}
Viewport::~Viewport()
{
device->closeDevice();
device->drop();
}
void Viewport::Run()
{
device->getTimer()->tick();
driver->beginScene(true, true, irr::video::SColor(255, 50, 50, 50));
smgr->drawAll();
driver->endScene();
}