100% found this document useful (1 vote)
15K views

SDL Function Cheat Sheet

SDL provides useful functions for initializing graphics, creating windows and surfaces, loading images, blitting between surfaces, updating displays, and quitting. Some key functions include SDL_Init to initialize SDL, SDL_CreateWindow to create a window, SDL_GetWindowSurface to get a window's surface, and SDL_Quit to cleanly shut down SDL.

Uploaded by

laserylee
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
15K views

SDL Function Cheat Sheet

SDL provides useful functions for initializing graphics, creating windows and surfaces, loading images, blitting between surfaces, updating displays, and quitting. Some key functions include SDL_Init to initialize SDL, SDL_CreateWindow to create a window, SDL_GetWindowSurface to get a window's surface, and SDL_Quit to cleanly shut down SDL.

Uploaded by

laserylee
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

.================================.

|SDL Important & Useful Functions|


'================================'

.===========.
|Declaration|
'==+========+---------+
|SDL_Window* window|
+------------------++
|SDL_Surface* screen|
+-------------------+
|SDL_Rect* rectangle|
+-------------------+

.========.
|Function|
'==+=====+-----------------------+
|SDL_Init(SDL_INIT_EVERYTHING)|
+-----------------------------
+----------------------------------------------------------------------------------
--------------+
|SDL_Window* SDL_CreateWindow(char* /*title*/, SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,int width,int height,int flags)|
+----------------------------------------------
+-------------------------------------------------------------------------------+
|SDL_Surface* SDL_GetWindowSurface(SDL_Window*)|
+--------------------------------------------+-+
|SDL_Surface* SDL_LoadBMP(char* /*filename*/)|
+--------------------------------------------
+----------------------------------------------------+
|void SDL_BlitSurface(SDL_Surface* /*source*/, SDL_Rect*, SDL_Surface*
/*destination*/, SDL_Rect*)|
+-----------------------------------------
+-------------------------------------------------------+
|void SDL_UpdateWindowSurface(SDL_Window*)|
+-------------------+---------------------+
|void SDL_Delay(int)|
+-------------------+-----------------------------------------------------+
|SDL_Surface* SDL_CreateRGBSurface(0,int width,int height, 32, 0, 0, 0, 0)|
+-------------------------------------------------------------------------+-----
+
|int SDL_FillRect(SDL_Surface* /*dst*/, SDL_Rect* /*dstrect*/, Uint32
/*color*/)|
+-------------------------------------------------------------------------------
+-----+ .-----------------------------------.
|Uint32 SDL_MapRGB(SDL_PixelFormat* /*format*/, Uint8 /*r*/, Uint8 /*g*/,
Uint8 /*b*/)|=-=|SDL_MapRGB(tmp->format, 108, 84, 0)|
+-----------------------------------
+-------------------------------------------------+
'-----------------------------------'
|void SDL_DestroyWindow(SDL_Window*)|
+---------------+-------------------+
|void SDL_Quit()|
+---------------+

You might also like