PrevUpHomeNext

constructors: dcpp::shared_device


dcpp::shared_device constructors:

constructor-0

Calling Sig:

shared_device(
	edt__,		// driver type
	window_size__,
	color_bits__, // color bits is only useful for fullscreen, set to 24, 32, etc.
	fullscreen__,		// true or false
	stencilbuffer_,		// true or false
	vsync__,		// true or false
	event_receiver__,		// a pointer to dcpp::IEventReceiver
);

constructor-0 parameters of dcpp::shared_device are matching dcpp::createDevice parameters. The difference is that constructor-0 parameters of dcpp::shared_device have no default values.

constructor-1

Calling Sig:

shared_device(
	width__,		// window width
	height__,		// window height
	title__,		// window title,	std::wstring
	fullscreen__ = false,		// default false
	edt__ = dcpp::video::EDT_EGXU		// driver type
);

constructor-3

shared_device(
	width__,		// window width
	height__,		// window height
	title__ = "Duckcpp Window, c++ engine", // window title,	std::string
	fullscreen__ = false,		// default false
	edt__ = dcpp::video::EDT_EGXU	// driver type
);

constructor-5

shared_device(
	edt__		// driver type
);

constructor-5 is designed for fullscreen mode only, the fullscreen resolution will be the same as the desktop resolution by automatical calculation. It only has one argument: the driver type.

default constructor is marked =delete

shared_device() = delete;

As no parameter constructor (default constructor) can be used mistakingly, it is marked =delete .

Note

The numbers of the constructors: -0, -1, -2, etc. are hardcoded into header comments. Unlisted constructor numbers might not exist or not be designed, or be removed, or not be useful.

Exception will be thrown if the device creation fails. No exception caught means the device is created successfully.

c++ example

#include <duckcpp/core.hpp>

int main()
{
	dcpp::shared_device device1{2560, 1440};
	dcpp::shared_device device2{2560, 1440, false};
	dcpp::shared_device device3 = device1;
}

Back

Up

c++

Duckcpp

cppfx.xyz


PrevUpHomeNext