Hello guys , how are you , hope you all doing well.
i just wanted to ask you how to use sdl_resizable.
so this is my code
#include<stdio.h>
#include<stdlib.h>
#include <SDL/SDL.h>
int main ( int argc, char** argv )
{
int cont=1;
SDL_Event event;
SDL_Surface *screen=NULL;
if(SDL_Init(SDL_INIT_VIDEO)<0)
{
fprintf(stderr,"Error white initializing %s\n",SDL_GetError());
exit(EXIT_FAILURE);
}
screen=SDL_SetVideoMode(512,512,32,SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE);
while(cont)
{
SDL_WaitEvent(&event);
switch(event.type)
{
case SDL_QUIT:
cont = 0;
break;
case SDL_KEYUP:
{
if(event.key.keysym.sym==SDLK_ESCAPE )
cont = 0;
}break;
}
SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,55,155,255));
SDL_Flip(screen);
}
return EXIT_SUCCESS;
}
it runs with no errors or warnings, but when i tried to change the sizes , i found that the color didnt follow the sizes, like this: ( i cant share the photo with u , i dont know why )
it only colors the 512/512 window , when i change the sizes , the new surface became black
i really need your help . thank you a lot for your help and time.
- Edité par AymenahmedHouasnia 4 novembre 2020 à 20:19:16
Flag SDL_RESIZABLE
× Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
× Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.