SDL2 setting for visual studio.

http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvsnet2010u/index.php

 

 

1. SDL_Init( SDL_INIT_VIDEO );

2. window = SDL_CreateWindow( "SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );

3. screenSurface = SDL_GetWindowSurface( window );

4. SDL_FillRect( screenSurface, NULL, SDL_MapRGB( screenSurface->format, 0xFF, 0xFF, 0xFF ) );

5. SDL_UpdateWindowSurface( window );

6. SDL_DestroyWindow( window );

 

The above five line code will create a SDL window and create a surface from this window, than we fill this surface with color(0xff, 0xff, 0xff) and update this window use the surface we create before, finally we just destroy the window and return this program

相关文章:

  • 2021-07-08
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2021-12-27
  • 2022-12-23
  • 2021-06-22
  • 2021-05-13
  • 2021-12-31
  • 2022-12-23
相关资源
相似解决方案