Hello, I’m trying to make a simple application and I got stuck.
I have an issue when I use SDL_Init(SDL_INIT_EVERYTHING) it takes 2 minutes to load everything , altough the cpu is standing at 0% in the application when running and after 2 minutes it starts working.
And when I try only to init SDL_INIT_VIDEO , it is immediately shows the screen though it’s not responding.
CODE :
#include
#define SDL_MAIN_HANDLED
#include “SDL.h”
int main()
{
SDL_Init(0);
SDL_Init(SDL_INIT_VIDEO);
SDL_Window *window = SDL_CreateWindow("Game", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 600, 480, SDL_WINDOW_SHOWN);
if (window == NULL)
return 1;
SDL_Event event;
bool running = true;
while (running) {
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_QUIT:
running = false;
break;
}
}
}
SDL_Quit();
std::cout << "Hello :)" << std::endl;
return 0;
}