How can I open windows to show errors while using SDL? I know that with GDI you can simply call MessageBox(), I want something similar with SDL.
This is a discussion on How to show error messages with SDL... within the C++ Programming forums, part of the General Programming Boards category; How can I open windows to show errors while using SDL? I know that with GDI you can simply call ...
How can I open windows to show errors while using SDL? I know that with GDI you can simply call MessageBox(), I want something similar with SDL.
You could always use the Windows API MessageBox() function directly (through windows.h), if you don't care about platform independency. For example:
A portable way would be to use SDL in conjunction with wxWidgets, although I am not certain exactly how you would do that (haven't tried it myself).Code:#include <windows.h> #include <SDL.h> int main(int argc, char* argv[]) { if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO) != 0) { MessageBox(NULL, "Could not initialize SDL.", "Error", MB_OK | MB_ICONERROR); return 1; } // code }