Nirtcpp engine features and how-to: nirt::NirtcppDevice
nirt::NirtcppDevice is the most important class of nirtcpp engine. You can access everything in the engine if you have a pointer to an instance of this class.
nirt::NirtcppDevice class instance is created by calling nirt::createDevice or nirt::createDeviceEx .
nirt::NirtcppDevice * device = nirt::createDevice( nirt::video::EDT_BURNINGSVIDEO, // Select driver type: nirt::video::E_DRIVER_TYPE nirt::core::dimension2du{2560, 1440}, // Set window size 32u, // Set bits per pixel in fullscreen mode, ignored if windowed. true, // fullscreen ? true, // stencilbuffer ? Set true if you want to enable shadow feature. true, // vsync ? event_receiver // nirt::IEventReceiver * : Event Receiver Pointer, set nullptr if no reveiver yet );
// params type: nirt::SNirtcppCreationParameters nirt::NirtcppDevice * device = nirt::createDeviceEx(params);
nirt::video::IVideoDriver * video_driver = device->getVideoDriver();
[h2 nirt::io::IFileSystem * file_system = device->getFileSystem();
nirt::gui::IGUIEnvironment * gui = device->getGUIEnvironment();
nirt::scene::ISceneManager * scene = device->getSceneManager();
nirt::gui::ICursorControl * cursor = device->getCursorControl();
nirt::ILogger * logger = device->getLogger();
nirt::video::IVideoModeList * video_mode_list = device->getVideoModeList();
nirt::video::IContextManager * context_manager = device->getContextManager();
nirt::IOSOperator * os_operator = device->getOSOperator();
nirt::ITimer * timer = device->getTimer();
nirt::IRandomizer * randomizer = device->getRandomizer();
nirt::IEventReceiver * event_receiver = device->getEventReceiver();
nirt::core::position2di window_position = device->getWindowPosition();
nirt::video::ECOLOR_FORMAT color_format = device->getColorFormat();
unsigned int double_click_time = device->getDoubleClickTime();
const char * version = device->getVersion();
nirt::E_DEVICE_TYPE device_type = device->getType();
bool success = device->getGammaRamp(red_ref, green_ref, blue_ref, brightness_ref, contrast_ref);
Calling device->drop() to destroy the instance of nirt::NirtcppDevice .
c++ example
#include <nirtcpp/core.hpp> int main() { nirt::NirtcppDevice * device = nirt::createDevice( nirt::video::EDT_BURNINGSVIDEO, nirt::core::dimension2du{2560, 1440}, 32, false, true, false, nullptr ); nirt::video::IVideoDriver * video = device->getVideoDriver(); nirt::scene::ISceneManager * scene = device->getSceneManager(); while (device->run())) { if (device->isWindowActive()) { video->beginScene(true, true, nirt::video::SColor{0xff32779a}); scene->drawAll(); video->endScene(); } else { device->yield(); } } device->drop(); }