|
@@ -28,7 +28,7 @@ int main()
|
|
|
}
|
|
|
|
|
|
// [2.2] Other components
|
|
|
- // Nothing for now
|
|
|
+ SDL_Surface* grass = SDL_LoadBMP("textures/grass.bmp");
|
|
|
|
|
|
/// [3] Main loop
|
|
|
bool done(false);
|
|
@@ -56,7 +56,7 @@ int main()
|
|
|
// [3.3] Draw phase
|
|
|
SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 255, 255));
|
|
|
|
|
|
- // other draws
|
|
|
+ SDL_BlitSurface(grass, 0x0, screen, 0x0);
|
|
|
|
|
|
SDL_Flip(screen);
|
|
|
|
|
@@ -64,6 +64,8 @@ int main()
|
|
|
} // end of main loop
|
|
|
|
|
|
///[4] Free components
|
|
|
+ SDL_FreeSurface(grass);
|
|
|
+
|
|
|
SDL_FreeSurface(screen);
|
|
|
|
|
|
std::cout << "No error caught." << std::endl;
|