7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK
14 HREF="reference.html"><LINK
17 HREF="sdlenvvars.html"><LINK
19 TITLE="SDL_GetVideoSurface"
20 HREF="sdlgetvideosurface.html"><META
24 CONTENT="function"></HEAD
35 SUMMARY="Header navigation table"
44 >SDL Library Documentation</TH
52 HREF="sdlenvvars.html"
66 HREF="sdlgetvideosurface.html"
91 HREF="sdlgetvideosurface.html"
92 >SDL_GetVideoSurface</A
93 > -- returns a pointer to the current display surface</DT
96 HREF="sdlgetvideoinfo.html"
98 > -- returns a pointer to information about the video hardware</DT
101 HREF="sdlvideodrivername.html"
102 >SDL_VideoDriverName</A
103 > -- Obtain the name of the video driver</DT
106 HREF="sdllistmodes.html"
108 > -- Returns a pointer to an array of available screen dimensions for
109 the given format and video flags</DT
112 HREF="sdlvideomodeok.html"
114 > -- Check to see if a particular video mode is supported.</DT
117 HREF="sdlsetvideomode.html"
119 > -- Set up a video mode with the specified width, height and bits-per-pixel.</DT
122 HREF="sdlupdaterect.html"
124 > -- Makes sure the given area is updated on the given screen.</DT
127 HREF="sdlupdaterects.html"
129 > -- Makes sure the given list of rectangles is updated on the given screen.</DT
134 > -- Swaps screen buffers</DT
137 HREF="sdlsetcolors.html"
139 > -- Sets a portion of the colormap for the given 8-bit surface.</DT
142 HREF="sdlsetpalette.html"
144 > -- Sets the colors in the palette of an 8-bit surface.</DT
147 HREF="sdlsetgamma.html"
149 > -- Sets the color gamma function for the display</DT
152 HREF="sdlgetgammaramp.html"
154 > -- Gets the color gamma lookup tables for the display</DT
157 HREF="sdlsetgammaramp.html"
159 > -- Sets the color gamma lookup tables for the display</DT
162 HREF="sdlmaprgb.html"
164 > -- Map a RGB color value to a pixel format.</DT
167 HREF="sdlmaprgba.html"
169 > -- Map a RGBA color value to a pixel format.</DT
172 HREF="sdlgetrgb.html"
174 > -- Get RGB values from a pixel in the specified pixel format.</DT
177 HREF="sdlgetrgba.html"
179 > -- Get RGBA values from a pixel in the specified pixel format.</DT
182 HREF="sdlcreatergbsurface.html"
183 >SDL_CreateRGBSurface</A
184 > -- Create an empty SDL_Surface</DT
187 HREF="sdlcreatergbsurfacefrom.html"
188 >SDL_CreateRGBSurfaceFrom</A
189 > -- Create an SDL_Surface from pixel data</DT
192 HREF="sdlfreesurface.html"
194 > -- Frees (deletes) a SDL_Surface</DT
197 HREF="sdllocksurface.html"
199 > -- Lock a surface for directly access.</DT
202 HREF="sdlunlocksurface.html"
203 >SDL_UnlockSurface</A
204 > -- Unlocks a previously locked surface.</DT
207 HREF="sdlloadbmp.html"
209 > -- Load a Windows BMP file into an SDL_Surface.</DT
212 HREF="sdlsavebmp.html"
214 > -- Save an SDL_Surface as a Windows BMP file.</DT
217 HREF="sdlsetcolorkey.html"
219 > -- Sets the color key (transparent pixel) in a blittable surface and
220 RLE acceleration.</DT
223 HREF="sdlsetalpha.html"
225 > -- Adjust the alpha properties of a surface</DT
228 HREF="sdlsetcliprect.html"
230 > -- Sets the clipping rectangle for a surface.</DT
233 HREF="sdlgetcliprect.html"
235 > -- Gets the clipping rectangle for a surface.</DT
238 HREF="sdlconvertsurface.html"
239 >SDL_ConvertSurface</A
240 > -- Converts a surface to the same format as another surface.</DT
243 HREF="sdlblitsurface.html"
245 > -- This performs a fast blit from the source surface to the destination surface.</DT
248 HREF="sdlfillrect.html"
250 > -- This function performs a fast fill of the given rectangle with some color</DT
253 HREF="sdldisplayformat.html"
254 >SDL_DisplayFormat</A
255 > -- Convert a surface to the display format</DT
258 HREF="sdldisplayformatalpha.html"
259 >SDL_DisplayFormatAlpha</A
260 > -- Convert a surface to the display format</DT
263 HREF="sdlwarpmouse.html"
265 > -- Set the position of the mouse cursor.</DT
268 HREF="sdlcreatecursor.html"
270 > -- Creates a new mouse cursor.</DT
273 HREF="sdlfreecursor.html"
275 > -- Frees a cursor created with SDL_CreateCursor.</DT
278 HREF="sdlsetcursor.html"
280 > -- Set the currently active mouse cursor.</DT
283 HREF="sdlgetcursor.html"
285 > -- Get the currently active mouse cursor.</DT
288 HREF="sdlshowcursor.html"
290 > -- Toggle whether or not the cursor is shown on the screen.</DT
293 HREF="sdlglloadlibrary.html"
294 >SDL_GL_LoadLibrary</A
295 > -- Specify an OpenGL library</DT
298 HREF="sdlglgetprocaddress.html"
299 >SDL_GL_GetProcAddress</A
300 > -- Get the address of a GL function</DT
303 HREF="sdlglgetattribute.html"
304 >SDL_GL_GetAttribute</A
305 > -- Get the value of a special SDL/OpenGL attribute</DT
308 HREF="sdlglsetattribute.html"
309 >SDL_GL_SetAttribute</A
310 > -- Set a special SDL/OpenGL attribute</DT
313 HREF="sdlglswapbuffers.html"
314 >SDL_GL_SwapBuffers</A
315 > -- Swap OpenGL framebuffers/Update Display</DT
318 HREF="sdlcreateyuvoverlay.html"
319 >SDL_CreateYUVOverlay</A
320 > -- Create a YUV video overlay</DT
323 HREF="sdllockyuvoverlay.html"
324 >SDL_LockYUVOverlay</A
325 > -- Lock an overlay</DT
328 HREF="sdlunlockyuvoverlay.html"
329 >SDL_UnlockYUVOverlay</A
330 > -- Unlock an overlay</DT
333 HREF="sdldisplayyuvoverlay.html"
334 >SDL_DisplayYUVOverlay</A
335 > -- Blit the overlay to the display</DT
338 HREF="sdlfreeyuvoverlay.html"
339 >SDL_FreeYUVOverlay</A
340 > -- Free a YUV video overlay</DT
343 HREF="sdlglattr.html"
345 > -- SDL GL Attributes</DT
350 > -- Defines a rectangular area</DT
355 > -- Format independent color description</DT
358 HREF="sdlpalette.html"
360 > -- Color palette for 8-bit pixel formats</DT
363 HREF="sdlpixelformat.html"
365 > -- Stores surface format information</DT
368 HREF="sdlsurface.html"
370 > -- Graphical Surface Structure</DT
373 HREF="sdlvideoinfo.html"
375 > -- Video Target information</DT
378 HREF="sdloverlay.html"
380 > -- YUV video overlay</DT
384 >SDL presents a very simple interface to the display framebuffer. The
385 framebuffer is represented as an offscreen surface to which you can write
386 directly. If you want the screen to show what you have written, call the <A
387 HREF="sdlupdaterects.html"
389 > function which will
390 guarantee that the desired portion of the screen is updated.</P
392 >Before you call any of the SDL video functions, you must first call
395 >SDL_Init(SDL_INIT_VIDEO)</SPAN
396 >, which initializes the video
397 and events in the SDL library. Check the return code, which should be
401 >, to see if there were any errors in starting up.</P
403 >If you use both sound and video in your application, you need to call
406 >SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO)</SPAN
408 sound device, otherwise under Win32 DirectX, you won't be able to set
409 full-screen display modes.</P
411 >After you have initialized the library, you can start up the video display in a
412 number of ways. The easiest way is to pick a common screen resolution and
413 depth and just initialize the video, checking for errors. You will probably
414 get what you want, but SDL may be emulating your requested mode and converting
415 the display on update. The best way is to
417 HREF="sdlgetvideoinfo.html"
420 video mode closest to the desired one, and then
422 HREF="sdldisplayformat.html"
425 your images to that pixel format.</P
427 >SDL currently supports any bit depth >= 8 bits per pixel. 8 bpp formats are
428 considered 8-bit palettized modes, while 12, 15, 16, 24, and 32 bits per pixel
429 are considered "packed pixel" modes, meaning each pixel contains the RGB color
430 components packed in the bits of the pixel.</P
432 >After you have initialized your video mode, you can take the surface that was
433 returned, and write to it like any other framebuffer, calling the update
434 routine as you go.</P
436 >When you have finished your video access and are ready to quit your
437 application, you should call "<SPAN
448 SUMMARY="Footer navigation table"
459 HREF="sdlenvvars.html"
477 HREF="sdlgetvideosurface.html"
493 HREF="reference.html"
501 >SDL_GetVideoSurface</TD