From 08cb1e218075c0e15c9012274b534748d4844176 Mon Sep 17 00:00:00 2001 From: dnxa <76252391+dnxa@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:26:48 +0400 Subject: [PATCH] Add FAQ about default laptop GPU usage. --- Frequently-Asked-Questions.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Frequently-Asked-Questions.md b/Frequently-Asked-Questions.md index f4c298d..834be82 100644 --- a/Frequently-Asked-Questions.md +++ b/Frequently-Asked-Questions.md @@ -21,6 +21,7 @@ - [How do I setup a custom icon for my executable?](#how-do-i-setup-a-custom-icon-for-my-executable) - [How I deal with UTF-16 strings?](#how-i-deal-with-utf-16-strings) - [Why does `DrawMeshInstanced` not draw anything?](#why-does-drawmeshinstanced-not-draw-anything) +- [Why is raylib using integrated graphics when a dedicated GPU is available?](#Why-is-raylib-using-integrated-graphics-when-a-dedicated-GPU-is-available) ## Can I run raylib in my old PC? @@ -420,3 +421,19 @@ void main() ``` + +## Why is raylib using integrated graphics when a dedicated GPU is available? + +The GPU used is set by the user through the GPU vendor’s control panel. If you think it’s crucial that a dedicated GPU is used in your program, you can add the following code anywhere in your code to force the use of dedicated AMD or NVIDIA GPUs. +```c +#ifdef __cplusplus +extern "C" { +#endif + +__declspec(dllexport) unsigned long NvOptimusEnablement = 1; +__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; + +#ifdef __cplusplus +} +#endif +```