Name
SDL_GetVideoSurface -- returns a pointer to the current display surface.
Synopsis
SDL_Surface* SDL_GetVideoSurface(void);
Description
This function returns a pointer to the current display surface. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface.
Parameter
nothing
Return value
NULL
- On error
The pointer to the current display surface
- On success. The caller must not free the returned pointer.
See also
Example
1 SDL_Surface* myVideoSurface = NULL;
2
3 // Initialize SDL and the video subsystem
4 SDL_Init(SDL_INIT_VIDEO);
5
6 // Set the video mode
7 SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
8
9 // Retrieve the current video surface
10 myVideoSurface = SDL_GetVideoSurface();
11
12 // Do some video operations
13 // myVideoRoutine1();
14 // myVideoRoutine2();
15
16 // Shut down the SDL and all its subsystems
17 SDL_Quit();
Requirements
Header |
SDL.h |
Version |
1.2.13 |
Shared object |
libSDL.so |
DLL |
SDL.dll |
