Tuesday, April 28, 2009

Memorizing SDL

I read an article about the best study method. I want to learn how to use SDL, so I'm going to apply this method now. I'm going to try to recall whatever code I can from lesson 4 and type it here.

#include "SDL/SDL.h" // always need when SDL program
#include "SDL/SDL_Img.h" // need for .png files to display
#include <strings>

//screen attributes

const int scn_h = 640; //screen height
const int scn_w = 480; //screen width
const int scn_bpp = 32; // screen bits per pixel

/* darn, I'm not sure width was 480 (I'll check when I'm completely lost.) */

SDL_Event event; //structure to hold events for us to handle

// function prototypes

SDL_Surface * load_image (std::string); // returns pointer to SDL Surface with a parameter to a string

/*OK. I'm lost. Lazy Foo, defines several other functions before he gets into the main, but I barely remember I'm going to have to re read the whole section. Yes, I know that I said SDL was easy to understand since I pretty much know the C++ invovled but I don't want to be tutorial dependent for every function. I want to know the SDL library so I can do things off the top of my head with it.*/

In our experiments, when students repeatedly read something, it falsely inflates their sense of their own learning."

No comments: