Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
|
Class for holding Nirtcpp Device creation parameters. More...
#include <nirtcpp/core/engine/SIrrCreationParameters.hpp>
Public Member Functions | |
SNirtcppCreationParameters () | |
Constructs a SNirtcppCreationParameters class with default values. | |
SNirtcppCreationParameters (const SNirtcppCreationParameters &other) | |
SNirtcppCreationParameters & | operator= (const SNirtcppCreationParameters &other) |
Public Attributes | |
E_DEVICE_TYPE | DeviceType |
Type of the device. | |
video::E_DRIVER_TYPE | DriverType |
Type of video driver used to render graphics. | |
core::dimension2d< u32 > | WindowSize |
Size of the window or the video mode in fullscreen mode. Default: 800x600. | |
core::position2di | WindowPosition |
Position of the window on-screen. Default: (-1, -1) or centered. | |
u8 | Bits |
Minimum Bits per pixel of the color buffer in fullscreen mode. Ignored if windowed mode. Default: 32. | |
u8 | ZBufferBits |
Minimum Bits per pixel of the depth buffer. Default: 24. | |
bool | Fullscreen |
Should be set to true if the device should run in fullscreen. | |
u8 | WindowResizable |
Should a non-fullscreen window be resizable. | |
bool | Stencilbuffer |
Specifies if the stencil buffer should be enabled. | |
bool | Vsync |
Specifies vertical synchronization. | |
u8 | AntiAlias |
Specifies if the device should use fullscreen anti aliasing. | |
bool | HandleSRGB |
Flag to enable proper sRGB and linear color handling. | |
bool | WithAlphaChannel |
Whether the main framebuffer uses an alpha channel. | |
bool | Doublebuffer |
Whether the main framebuffer uses doublebuffering. | |
bool | IgnoreInput |
Specifies if the device should ignore input events. | |
bool | Stereobuffer |
Specifies if the device should use stereo buffers. | |
bool | HighPrecisionFPU |
Specifies if the device should use high precision FPU setting. | |
IEventReceiver * | EventReceiver |
A user created event receiver. | |
void * | WindowId |
Window Id. | |
ELOG_LEVEL | LoggingLevel |
Specifies the logging level used in the logging interface. | |
u32 | DisplayAdapter |
Allows to select which graphic card is used for rendering when more than one card is in the system. | |
bool | DriverMultithreaded |
Create the driver multithreaded. | |
bool | UsePerformanceTimer |
Enables use of high performance timers on Windows platform. | |
const c8 *const | SDK_version_do_not_use |
Don't use or change this parameter. | |
Class for holding Nirtcpp Device creation parameters.
This class is used in the createDeviceEx() function.
u8 nirt::SNirtcppCreationParameters::AntiAlias |
Specifies if the device should use fullscreen anti aliasing.
Makes sharp/pixelated edges softer, but requires more performance. Also, 2D elements might look blurred with this switched on. The resulting rendering quality also depends on the hardware and driver you are using, your program might look different on different hardware with this. So if you are writing a game/application with AntiAlias switched on, it would be a good idea to make it possible to switch this option off again by the user. The value is the maximal antialiasing factor requested for the device. The creation method will automatically try smaller values if no window can be created with the given value. Value one is usually the same as 0 (disabled), but might be a special value on some platforms. On D3D devices it maps to NONMASKABLE. Default value: 0 - disabled
E_DEVICE_TYPE nirt::SNirtcppCreationParameters::DeviceType |
Type of the device.
This setting decides the windowing system used by the device, most device types are native to a specific operating system and so may not be available. EIDT_WIN32 is only available on Windows desktops, EIDT_WINCE is only available on Windows mobile devices, EIDT_COCOA is only available on Mac OSX, EIDT_X11 is available on Linux, Solaris, BSD and other operating systems which use X11, EIDT_SFML is available on most systems if compiled in, EIDT_CONSOLE is usually available but can only render to text, EIDT_BEST will select the best available device for your operating system. Default: EIDT_BEST.
u32 nirt::SNirtcppCreationParameters::DisplayAdapter |
Allows to select which graphic card is used for rendering when more than one card is in the system.
So far only supported on D3D
bool nirt::SNirtcppCreationParameters::Doublebuffer |
Whether the main framebuffer uses doublebuffering.
This should be usually enabled, in order to avoid render artifacts on the visible framebuffer. However, it might be useful to use only one buffer on very small devices. If no doublebuffering is available, the drivers will fall back to single buffers. Default value: true
bool nirt::SNirtcppCreationParameters::DriverMultithreaded |
Create the driver multithreaded.
Default is false. Enabling this can slow down your application. Note that this does not make Nirtcpp threadsafe, but only the underlying driver-API for the graphiccard. So far only supported on D3D.
video::E_DRIVER_TYPE nirt::SNirtcppCreationParameters::DriverType |
Type of video driver used to render graphics.
This can currently be video::EDT_NULL, video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9, and video::EDT_OPENGL. Default: EDT_BURNINGSVIDEO.
bool nirt::SNirtcppCreationParameters::Fullscreen |
Should be set to true if the device should run in fullscreen.
Otherwise the device runs in windowed mode. Default: false.
bool nirt::SNirtcppCreationParameters::HandleSRGB |
Flag to enable proper sRGB and linear color handling.
In most situations, it is desirable to have the color handling in non-linear sRGB color space, and only do the intermediate color calculations in linear RGB space. If this flag is enabled, the device and driver try to assure that all color input and output are color corrected and only the internal color representation is linear. This means, that the color output is properly gamma-adjusted to provide the brighter colors for monitor display. And that blending and lighting give a more natural look, due to proper conversion from non-linear colors into linear color space for blend operations. If this flag is enabled, all texture colors (which are usually in sRGB space) are correctly displayed. However vertex colors and other explicitly set values have to be manually encoded in linear color space. Default value: false.
bool nirt::SNirtcppCreationParameters::HighPrecisionFPU |
Specifies if the device should use high precision FPU setting.
This is only relevant for DirectX Devices, which switch to low FPU precision by default for performance reasons. However, this may lead to problems with the other computations of the application. In this case setting this flag to true should help
bool nirt::SNirtcppCreationParameters::IgnoreInput |
Specifies if the device should ignore input events.
This is only relevant when using external I/O handlers. External windows need to take care of this themselves. Currently only supported by X11. Default value: false
ELOG_LEVEL nirt::SNirtcppCreationParameters::LoggingLevel |
Specifies the logging level used in the logging interface.
The default value is ELL_INFORMATION. You can access the ILogger interface later on from the NirtcppDevice with getLogger() and set another level. But if you need more or less logging information already from device creation, then you have to change it here.
const c8* const nirt::SNirtcppCreationParameters::SDK_version_do_not_use |
Don't use or change this parameter.
Always set it to NIRTCPP_SDK_VERSION, which is done by default. This is needed for sdk version checks.
bool nirt::SNirtcppCreationParameters::Stencilbuffer |
Specifies if the stencil buffer should be enabled.
Set this to true, if you want the engine be able to draw stencil buffer shadows. Note that not all drivers are able to use the stencil buffer, hence it can be ignored during device creation. Without the stencil buffer no shadows will be drawn. Default: true.
bool nirt::SNirtcppCreationParameters::Stereobuffer |
Specifies if the device should use stereo buffers.
Some high-end gfx cards support two framebuffers for direct support of stereoscopic output devices. If this flag is set the device tries to create a stereo context. Currently only supported by OpenGL. Default value: false
bool nirt::SNirtcppCreationParameters::UsePerformanceTimer |
Enables use of high performance timers on Windows platform.
When performance timers are not used, standard GetTickCount() is used instead which usually has worse resolution, but also less problems with speed stepping and other techniques.
bool nirt::SNirtcppCreationParameters::Vsync |
Specifies vertical synchronization.
If set to true, the driver will wait for the vertical retrace period, otherwise not. May be silently ignored. Default: false
void* nirt::SNirtcppCreationParameters::WindowId |
Window Id.
If this is set to a value other than 0, the Nirtcpp Engine will be created in an already existing window. For windows, set this to the HWND of the window you want. The windowSize and FullScreen options will be ignored when using the WindowId parameter. Default this is set to 0. To make Nirtcpp run inside the custom window, you still will have to draw Nirtcpp on your own. You can use this loop, as usual:
Instead of this, you can also simply use your own message loop using GetMessage, DispatchMessage and whatever. Calling NirtcppDevice::run() will cause Nirtcpp to dispatch messages internally too. You need not call Device->run() if you want to do your own message dispatching loop, but Nirtcpp will not be able to fetch user input then and you have to do it on your own using the window messages, DirectInput, or whatever. Also, you'll have to increment the Nirtcpp timer. An alternative, own message dispatching loop without device->run() would look like this:
However, there is no need to draw the picture this often. Just do it how you like.
u8 nirt::SNirtcppCreationParameters::WindowResizable |
Should a non-fullscreen window be resizable.
Might not be supported by all devices. Ignored when Fullscreen is true. Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself Default: 2
bool nirt::SNirtcppCreationParameters::WithAlphaChannel |
Whether the main framebuffer uses an alpha channel.
In some situations it might be desirable to get a color buffer with an alpha channel, e.g. when rendering into a transparent window or overlay. If this flag is set the device tries to create a framebuffer with alpha channel. If this flag is set, only color buffers with alpha channel are considered. Otherwise, it depends on the actual hardware if the colorbuffer has an alpha channel or not. Default value: false