This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
user:jcavalu3:portfolio:hpcexperiment6 [2013/12/13 20:22] – jcavalu3 | user:jcavalu3:portfolio:hpcexperiment6 [2013/12/13 20:30] (current) – jcavalu3 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====SDL===== | ||
+ | This is my write-up on my working with SDL, from the SDL book __Focus on SDL__. | ||
+ | |||
+ | The first program in the book just checks to see if SDL initialized properly: | ||
+ | |||
+ | fosdl1_1.cpp | ||
+ | |||
+ | <code c> | ||
+ | 1 #include " | ||
+ | 2 #include < | ||
+ | 3 | ||
+ | 4 int main(int argc, char* argv[]) | ||
+ | 5 { | ||
+ | 6 if (SDL_Init(SDL_INIT_VIDEO) == -1) | ||
+ | 7 { | ||
+ | 8 | ||
+ | 9 } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 16 } | ||
+ | </ | ||
+ | |||
+ | The next program is a small SDL-based application, | ||
+ | |||
+ | fosdl1_2.cpp | ||
+ | |||
+ | <code c> | ||
+ | 1 #include " | ||
+ | 2 #include < | ||
+ | 3 #include < | ||
+ | 4 | ||
+ | 5 SDL_Surface* g_pMainSurface = NULL; | ||
+ | 6 SDL_Event g_Event; | ||
+ | 7 | ||
+ | 8 int main(int argc, char* argv[]) | ||
+ | 9 { | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 48 } | ||
+ | </ | ||
+ | |||
+ | But wait! There' |