Jimcpp engine features and how-to: 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::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 );
// params type: jpp::SJimcppCreationParameters jpp::JimcppDevice * device = jpp::createDeviceEx(params);
jpp::video::IVideoDriver * video_driver = device->getVideoDriver();
[h2 jpp::io::IFileSystem * file_system = device->getFileSystem();
jpp::gui::IGUIEnvironment * gui = device->getGUIEnvironment();
jpp::scene::ISceneManager * scene = device->getSceneManager();
jpp::gui::ICursorControl * cursor = device->getCursorControl();
jpp::ILogger * logger = device->getLogger();
jpp::video::IVideoModeList * video_mode_list = device->getVideoModeList();
jpp::video::IContextManager * context_manager = device->getContextManager();
jpp::IOSOperator * os_operator = device->getOSOperator();
jpp::ITimer * timer = device->getTimer();
jpp::IRandomizer * randomizer = device->getRandomizer();
jpp::IEventReceiver * event_receiver = device->getEventReceiver();
jpp::core::position2di window_position = device->getWindowPosition();
jpp::video::ECOLOR_FORMAT color_format = device->getColorFormat();
unsigned int double_click_time = device->getDoubleClickTime();
const char * version = device->getVersion();
jpp::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 jpp::JimcppDevice .
#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(); }