* Initializes the window. * * @param width The width of the window. * @param height The height of the window. * @param title The desired title of the window. * @param flags The ConfigFlags to set prior to initializing the window. See SetConfigFlags for more details. * * @see ::SetConfigFlags() * @see ConfigFlags * * @throws raylib::RaylibException
| 64 | * @throws raylib::RaylibException Thrown if the window failed to initiate. |
| 65 | */ |
| 66 | static void Init(int width = 800, int height = 450, const std::string& title = "raylib", unsigned int flags = 0, TraceLogLevel logLevel = LOG_ALL) { |
| 67 | if (flags != 0) { |
| 68 | ::SetConfigFlags(flags); |
| 69 | } |
| 70 | ::SetTraceLogLevel(logLevel); |
| 71 | ::InitWindow(width, height, title.c_str()); |
| 72 | if (!::IsWindowReady()) { |
| 73 | throw RaylibException("Failed to create Window"); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Check if KEY_ESCAPE pressed or Close icon pressed |
nothing calls this directly
no test coverage detected