Graphic Card

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
elektrikboy
Posts: 17
Joined: Wed Dec 22, 2021 2:30 am

Graphic Card

Post by elektrikboy »

hi guys
noob question again lol
I have a ASUS with i7 and a dedicated nvidia geforce gt 650M (2Gb dedicated) laptop...how can I make Irrlicht use this nvidia instead of Intel integrated video card??
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Graphic Card

Post by CuteAlien »

I have no system here to test (my cpu graphicard is made inaccessible by the board...), but for Windows there is this trick. Add this code in your application:

Code: Select all

#if defined(_WIN32)
// Tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU 
// Trick found here: https://gist.github.com/statico/6809850727c708f08458
// NOTE: Those lines cause our project to create .exp and .lib files additional to .exe files.
extern "C" 
{
	// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
	__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;

	// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
	__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif

For D3D9 we've also added DisplayAdapter parameter in SIrrCreationParameters (which you can pass when creating a new device) in the svn trunk version of Irrlicht.

For Linux - I simply don't know yet, sorry.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
elektrikboy
Posts: 17
Joined: Wed Dec 22, 2021 2:30 am

Re: Graphic Card

Post by elektrikboy »

Thx again man!!
It's working perfectly now!
Post Reply