Hello!
After a quick pain to install SDL and use it with VSCode I have another "issue" ;
I'm still following a class for beginners on openclassrooms and I can finally display a window (yay! Kinda huge achievement since for me, but the tutorial is for SDL1.2 and since I am using SDL2 I have some problems with the code used.
int main(int argc, char *argv[])
{
SDL_Surface *ecran = NULL; // Le pointeur qui va stocker la surface de l'écran
SDL_Init(SDL_INIT_VIDEO);
ecran = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE); // On tente d'ouvrir une fenêtre
if (ecran == NULL) // Si l'ouverture a échoué, on le note et on arrête
{
fprintf(stderr, "Impossible de charger le mode vidéo : %s\n", SDL_GetError());
exit(EXIT_FAILURE);
}
SDL_WM_SetCaption("Ma super fenêtre SDL !", NULL);
pause();
SDL_Quit();
return EXIT_SUCCESS;
}
But as I looked on the web, it doesn't work this way anymore and all the "surface" things also changed. So all the explanations in this class is kinda out of subject for me.
The guys who made it made some paragraphs about how surfaces work so you can create different layers and superpose them to display things. Purpose was simple here : displaying a green window.
Is there anyone who can guide me a bit so I can understand it ? Or if there's any guide (I looked for it but didn't find any "clear" one since I'm starting
Here's the link of my class (in french sorry guys, but if you want to take a look at the codes written here it is) : https://openclassrooms.com/fr/courses/19980-apprenez-a-programmer-en-c/17546-creation-dune-fenetre-et-de-surfaces
Thank you guys, have aa beautiful day !