#include <SDL2/SDL.h> #include <iostream> using namespace std; int main() { if (SDL_Init(SDL_INIT_VIDEO) != 0) { cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << endl; } else { SDL_Window* window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); if (window == nullptr) { cout << "Window could not be created! SDL_Error: " << SDL_GetError() << endl; } SDL_Delay(2000); // نمایش پنجره برای 2 ثانیه SDL_DestroyWindow(window); } SDL_Quit(); return 0; }