PrevUpHomeNext

Features: nirt::NirtcppDevice


Features and HowTo: nirt::NirtcppDevice, nirt::createDevice, nirt::createDeviceEx

Nirtcpp engine features and how-to: nirt::NirtcppDevice

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::createDevice

Calling Sig

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
);

nirt::createDeviceEx

Calling Sig

// params type: nirt::SNirtcppCreationParameters
nirt::NirtcppDevice * device = nirt::createDeviceEx(params);

What can be taken out of the instance of nirt::NirtcppDevice ?

nirt::video::IVideoDriver

nirt::video::IVideoDriver * video_driver = device->getVideoDriver();

nirt::io::IFileSystem

[h2 nirt::io::IFileSystem * file_system = device->getFileSystem();

nirt::gui::IGUIEnvironment

nirt::gui::IGUIEnvironment * gui = device->getGUIEnvironment();

nirt::scene::ISceneManager

nirt::scene::ISceneManager * scene = device->getSceneManager();

nirt::gui::ICursorControl

nirt::gui::ICursorControl * cursor = device->getCursorControl();

nirt::ILogger

nirt::ILogger * logger = device->getLogger();

nirt::video::IVideoModeList

nirt::video::IVideoModeList * video_mode_list = device->getVideoModeList();

nirt::video::IContextManager

nirt::video::IContextManager * context_manager = device->getContextManager();

nirt::IOSOperator

nirt::IOSOperator * os_operator = device->getOSOperator();

nirt::ITimer

nirt::ITimer * timer = device->getTimer();

nirt::IRandomizer

nirt::IRandomizer * randomizer = device->getRandomizer();

nirt::IEventReceiver

nirt::IEventReceiver * event_receiver = device->getEventReceiver();

Window Position

nirt::core::position2di window_position = device->getWindowPosition();

nirt::video::ECOLOR_FORMAT

nirt::video::ECOLOR_FORMAT color_format = device->getColorFormat();

Double Click Time

unsigned int double_click_time = device->getDoubleClickTime();

Engine Version

const char * version = device->getVersion();

Device Type

nirt::E_DEVICE_TYPE device_type = device->getType();

Gamma Ramp

bool success = device->getGammaRamp(red_ref, green_ref, blue_ref, brightness_ref, contrast_ref);

Drop

Calling device->drop() to destroy the instance of nirt::NirtcppDevice .

Example

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();
}

PrevUpHomeNext

utx::print

esv::print