Salut à tous.
Via SDL2, quand j’essaye d’afficher quelque chose à l’écran, que ce soit en 2d ou via opengl, j’ai 40 mb de ram qui s’utilise directement.
Avec xlib en 2d j’ai 1.4 mb et 40 mb si ajout contexte opengl.
Je comprends pas à la situation.
C’est pareil chez vous ?
Est-ce normal toute cette utilisation ?
SDL2, fenêtre vide, ram: 40 mb
gcc main.c -o main -L /usr/lib/ -I /usr/include/ -lSDL2
[code]#include <stdio.h>
#include <SDL2/SDL.h>
int main(int argc, char ** argv)
{
SDL_Window * window;
SDL_Event event;
int quit = 0;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("ma fenetre", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, 0);
while (!quit)
{
SDL_WaitEvent(&event);
switch (event.type)
{
case SDL_QUIT:
quit = 1;
break;
}
}
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}[/code]
Utilisation fenêtre vide: ±40 mb.
Utilisation surface affichage 2d, ±45 mb.
Utilisation contexte opengl, ±45 mb.