PrevUpHomeNext

jpp::JimcppDevice


Features and HowTo: jpp::JimcppDevice, jpp::createDevice, jpp::createDeviceEx

Jimcpp engine features and how-to: jpp::JimcppDevice

jpp::JimcppDevice

jpp::JimcppDevice is the most important class of jimcpp engine. You can access everything in the engine if you have a pointer to an instance of this class.

jpp::JimcppDevice class instance is created by calling jpp::createDevice or jpp::createDeviceEx .

jpp::createDevice

Calling Sig

jpp::JimcppDevice * device = jpp::createDevice(
	jpp::video::EDT_BURNINGSVIDEO,		// Select driver type: jpp::video::E_DRIVER_TYPE
	jpp::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		// jpp::IEventReceiver * : Event Receiver Pointer, set nullptr if no reveiver yet
);

jpp::createDeviceEx

Calling Sig

// params type: jpp::SJimcppCreationParameters
jpp::JimcppDevice * device = jpp::createDeviceEx(params);

What can be taken out of the instance of jpp::JimcppDevice ?

jpp::video::IVideoDriver

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

jpp::io::IFileSystem

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

jpp::gui::IGUIEnvironment

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

jpp::scene::ISceneManager

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

jpp::gui::ICursorControl

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

jpp::ILogger

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

jpp::video::IVideoModeList

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

jpp::video::IContextManager

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

jpp::IOSOperator

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

jpp::ITimer

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

jpp::IRandomizer

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

jpp::IEventReceiver

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

Window Position

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

jpp::video::ECOLOR_FORMAT

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

jpp::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 jpp::JimcppDevice .

c++ Example

#include <jimcpp/core.hpp>

int main()
{
	jpp::JimcppDevice * device = jpp::createDevice(
		jpp::video::EDT_BURNINGSVIDEO,
		jpp::core::dimension2du{2560, 1440},
		32,
		false,
		true,
		false,
		nullptr
	);
	jpp::video::IVideoDriver * video = device->getVideoDriver();
	jpp::scene::ISceneManager * scene = device->getSceneManager();
	while (device->run()))
	{
		if (device->isWindowActive())
		{
			video->beginScene(true, true, jpp::video::SColor{0xff32779a});
			scene->drawAll();
			video->endScene();
		}
		else
		{
			device->yield();
		}
	}
	device->drop();
}

Back

Up










K


PrevUpHomeNext