Home | History | Annotate | Download | only in video

Lines Matching refs:video

24 /* The high-level video driver subsystem */
34 /* Available video drivers */
143 * Initialize the video and event subsystems -- determine native pixel format
147 SDL_VideoDevice *video;
168 /* Select the proper video driver */
170 video = NULL;
180 video = bootstrap[i]->create(index);
188 video = bootstrap[i]->create(index);
189 if ( video != NULL ) {
195 if ( video == NULL ) {
196 SDL_SetError("No available video device");
199 current_video = video;
203 video->screen = NULL;
204 video->shadow = NULL;
205 video->visible = NULL;
206 video->physpal = NULL;
207 video->gammacols = NULL;
208 video->gamma = NULL;
209 video->wm_title = NULL;
210 video->wm_icon = NULL;
211 video->offset_x = 0;
212 video->offset_y = 0;
213 SDL_memset(&video->info, 0, (sizeof video->info));
215 video->displayformatalphapixel = NULL;
218 video->gl_config.driver_loaded = 0;
219 video->gl_config.dll_handle = NULL;
220 video->gl_config.red_size = 3;
221 video->gl_config.green_size = 3;
222 video->gl_config.blue_size = 2;
223 video->gl_config.alpha_size = 0;
224 video->gl_config.buffer_size = 0;
225 video->gl_config.depth_size = 16;
226 video->gl_config.stencil_size = 0;
227 video->gl_config.double_buffer = 1;
228 video->gl_config.accum_red_size = 0;
229 video->gl_config.accum_green_size = 0;
230 video->gl_config.accum_blue_size = 0;
231 video->gl_config.accum_alpha_size = 0;
232 video->gl_config.stereo = 0;
233 video->gl_config.multisamplebuffers = 0;
234 video->gl_config.multisamplesamples = 0;
235 video->gl_config.accelerated = -1; /* not known, don't set */
236 video->gl_config.swap_control = -1; /* not known, don't set */
238 /* Initialize the video subsystem */
240 if ( video->VideoInit(video, &vformat) < 0 ) {
245 /* Create a zero sized video surface of the appropriate format */
258 * a video mode has been set anyway. :)
264 video->SetColors(video,
268 video->info.vfmt = SDL_VideoSurface->format;
305 * Get the current information about the video hardware
327 SDL_VideoDevice *video = current_video;
336 modes = video->ListModes(this, format, flags);
342 * Check to see if a particular video mode is supported.
346 * one used when setting the video mode, SDL_SetVideoMode() will succeed,
424 * Get the closest non-emulated video mode to the one requested
444 /* Try the original video mode, get the closest depth */
490 SDL_SetError("No video mode large enough for %dx%d", *w, *h);
545 /* If the video surface is resizable, the shadow should say so */
549 /* If the video surface has no frame, the shadow should say so */
553 /* If the video surface is fullscreen, the shadow should say so */
557 /* If the video surface is flippable, the shadow should say so */
569 * Set the requested video mode, allocating a shadow buffer if necessary.
573 SDL_VideoDevice *video, *this;
581 /* Start up the video driver, if necessary..
589 this = video = current_video;
593 width = video->info.current_w;
596 height = video->info.current_h;
598 /* Default to the current video bpp */
604 /* Get a good video mode, the closest one possible */
630 /* These flags are for 2D video modes only */
639 /* Clean up any previous video mode */
649 if ( video->physpal ) {
650 SDL_free(video->physpal->colors);
651 SDL_free(video->physpal);
652 video->physpal = NULL;
654 if( video->gammacols) {
655 SDL_free(video->gammacols);
656 video->gammacols = NULL;
662 /* Try to set the video mode, along with offset and clipping */
666 mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
687 * already been freed by the video driver. What do we do in
695 SDL_SetError("Video mode smaller than requested");
703 video->SetColors(this, 0, vf->palette->ncolors,
708 video->offset_x = 0;
709 video->offset_y = 0;
715 video->offset_x = (mode->w-width)/2;
716 video->offset_y = (mode->h-height)/2;
717 mode->offset = video->offset_y*mode->pitch +
718 video->offset_x*mode->format->BytesPerPixel;
732 /* If we failed setting a video mode, return NULL... (Uh Oh!) */
738 if ( ! video->info.wm_available ) {
742 /* Reset the mouse cursor and grab for new video mode */
744 if ( video->UpdateMouse ) {
745 video->UpdateMouse(this);
760 #define SDL_PROC(ret,func,params) video->func=func;
764 video->func = SDL_GL_GetProcAddress(#func); \
765 if ( ! video->func ) { \
779 if ( (video->screen->flags & SDL_OPENGL) &&
780 video->GL_MakeCurrent ) {
781 if ( video->GL_MakeCurrent(this) < 0 ) {
798 (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") ||
799 (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
801 video->is_32bit = 0;
816 video->is_32bit = 1;
840 /* Free the original video mode surface (is this safe?) */
845 video->glGenTextures( 1, &video->texture );
846 video->glBindTexture( GL_TEXTURE_2D, video->texture );
847 video->glTexImage2D(
850 video->is_32bit ? GL_RGBA : GL_RGB,
854 video->is_32bit ? GL_RGBA : GL_RGB,
856 video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
862 video->UpdateRects = SDL_GL_UpdateRectsLock;
881 /* If the surface is in hardware, video writes are visible
899 video->info.vfmt = SDL_VideoSurface->format;
900 video->info.current_w = SDL_VideoSurface->w;
901 video->info.current_h = SDL_VideoSurface->h;
908 * Convert a surface into the video pixel format.
915 SDL_SetError("No video mode has been set");
949 SDL_SetError("No video mode has been set");
968 /* Keep the video format, as long as the high 8 bits are
1018 SDL_VideoDevice *video = current_video;
1032 if ( video->gammacols ) {
1034 pal->colors = video->gammacols;
1035 } else if ( video->physpal ) {
1037 pal->colors = video->physpal->colors;
1059 /* Fall through to video surface update */
1063 /* Update the video surface */
1066 rects[i].x += video->offset_x;
1067 rects[i].y += video->offset_y;
1069 video->UpdateRects(this, numrects, rects);
1071 rects[i].x -= video->offset_x;
1072 rects[i].y -= video->offset_y;
1075 video->UpdateRects(this, numrects, rects);
1085 SDL_VideoDevice *video = current_video;
1086 /* Copy the shadow surface to the video surface */
1094 if ( video->gammacols ) {
1096 pal->colors = video->gammacols;
1097 } else if ( video->physpal ) {
1099 pal->colors = video->physpal->colors;
1122 /* Fall through to video surface update */
1127 return(video->FlipHWSurface(this, SDL_VideoSurface));
1164 SDL_VideoDevice *video = current_video;
1167 if ( video->physpal ) {
1171 SDL_memcpy(video->physpal->colors + firstcolor,
1185 * The video surface is not indexed - invalidate any
1186 * active shadow-to-video blit mappings.
1191 if ( video->gamma ) {
1192 if( ! video->gammacols ) {
1193 SDL_Palette *pp = video->physpal;
1196 video->gammacols = SDL_malloc(pp->ncolors
1198 SDL_ApplyGamma(video->gamma,
1200 video->gammacols,
1203 SDL_ApplyGamma(video->gamma, colors,
1204 video->gammacols
1216 if ( video->gamma ) {
1217 SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
1220 gotall = video->SetColors(video, firstcolor, ncolors, colors);
1222 /* The video flags shouldn't have SDL_HWPALETTE, and
1223 the video driver is responsible for copying back the
1224 correct colors into the video surface palette.
1282 SDL_VideoDevice *video = current_video;
1288 if ( !video->physpal && !(which & SDL_LOGPAL) ) {
1295 video->physpal = pp;
1320 * Clean up the video subsystem
1327 SDL_VideoDevice *video = current_video;
1342 /* Clean up the system video */
1343 video->VideoQuit(this);
1357 if ( video->physpal ) {
1358 SDL_free(video->physpal->colors);
1359 SDL_free(video->physpal);
1360 video->physpal = NULL;
1362 if ( video->gammacols ) {
1363 SDL_free(video->gammacols);
1364 video->gammacols = NULL;
1366 if ( video->gamma ) {
1367 SDL_free(video->gamma);
1368 video->gamma = NULL;
1370 if ( video->wm_title != NULL ) {
1371 SDL_free(video->wm_title);
1372 video->wm_title = NULL;
1374 if ( video->wm_icon != NULL ) {
1375 SDL_free(video->wm_icon);
1376 video->wm_icon = NULL;
1379 /* Finish cleaning up video subsystem */
1380 video->free(this);
1389 SDL_VideoDevice *video = current_video;
1394 if ( video == NULL ) {
1395 SDL_SetError("Video subsystem has not been initialized");
1397 if ( video->GL_LoadLibrary ) {
1398 retval = video->GL_LoadLibrary(this, path);
1400 SDL_SetError("No dynamic GL support in video driver");
1408 SDL_VideoDevice *video = current_video;
1413 if ( video->GL_GetProcAddress ) {
1414 if ( video->gl_config.driver_loaded ) {
1415 func = video->GL_GetProcAddress(this, proc);
1420 SDL_SetError("No dynamic GL support in video driver");
1425 /* Set the specified GL attribute for setting up a GL video mode */
1429 SDL_VideoDevice *video = current_video;
1434 video->gl_config.red_size = value;
1437 video->gl_config.green_size = value;
1440 video->gl_config.blue_size = value;
1443 video->gl_config.alpha_size = value;
1446 video->gl_config.double_buffer = value;
1449 video->gl_config.buffer_size = value;
1452 video->gl_config.depth_size = value;
1455 video->gl_config.stencil_size = value;
1458 video->gl_config.accum_red_size = value;
1461 video->gl_config.accum_green_size = value;
1464 video->gl_config.accum_blue_size = value;
1467 video->gl_config.accum_alpha_size = value;
1470 video->gl_config.stereo = value;
1473 video->gl_config.multisamplebuffers = value;
1476 video->gl_config.multisamplesamples = value;
1479 video->gl_config.accelerated = value;
1482 video->gl_config.swap_control = value;
1496 SDL_VideoDevice* video = current_video;
1499 if ( video->GL_GetAttribute ) {
1511 SDL_VideoDevice *video = current_video;
1514 if ( video->screen->flags & SDL_OPENGL ) {
1515 video->GL_SwapBuffers(this);
1517 SDL_SetError("OpenGL video mode has not been set");
1675 SDL_VideoDevice *video = current_video;
1678 if ( video ) {
1680 if ( video->wm_title ) {
1681 SDL_free(video->wm_title);
1683 video->wm_title = SDL_strdup(title);
1686 if ( video->wm_icon ) {
1687 SDL_free(video->wm_icon);
1689 video->wm_icon = SDL_strdup(icon);
1691 if ( (title || icon) && (video->SetCaption != NULL) ) {
1692 video->SetCaption(this, video->wm_title,video->wm_icon);
1698 SDL_VideoDevice *video = current_video;
1700 if ( video ) {
1702 *title = video->wm_title;
1705 *icon = video->wm_icon;
1772 SDL_VideoDevice *video = current_video;
1775 if ( icon && video->SetIcon ) {
1790 video->SetIcon(video, icon, mask);
1793 video->SetIcon(this, icon, mask);
1805 SDL_VideoDevice *video = current_video;
1809 if ( video->GrabInput == NULL ) {
1810 return(video->input_grab);
1818 if ( video->input_grab != SDL_GRAB_OFF ) {
1819 mode = video->GrabInput(this, mode);
1822 if ( video->input_grab == SDL_GRAB_OFF ) {
1823 mode = video->GrabInput(this, mode);
1826 if ( mode != video->input_grab ) {
1827 video->input_grab = mode;
1828 if ( video->CheckMouseMode ) {
1829 video->CheckMouseMode(this);
1833 printf("Final mode %d\n", video->input_grab);
1844 SDL_VideoDevice *video = current_video;
1846 /* If the video isn't initialized yet, we can't do anything */
1847 if ( ! video ) {
1853 mode = video->input_grab;
1863 video surface is fullscreen, we always grab */
1892 SDL_VideoDevice *video = current_video;
1897 if ( video->IconifyWindow ) {
1898 retval = video->IconifyWindow(this);
1908 SDL_VideoDevice *video = current_video;
1914 video->ToggleFullScreen ) {
1916 toggled = video->ToggleFullScreen(this, 0);
1922 toggled = video->ToggleFullScreen(this, 1);
1930 SDL_WM_GrabInput(video->input_grab);
1941 SDL_VideoDevice* video = current_video;
1943 if (video && video->SetWindowPos)
1944 video->SetWindowPos(video, x, y);
1952 SDL_VideoDevice* video = current_video;
1954 if (video && video->GetWindowPos)
1955 video->GetWindowPos(video, px, py);
1966 SDL_VideoDevice* video = current_video;
1968 if (video && video->IsWindowVisible) {
1969 result = video->IsWindowVisible(video, recenter);
1977 SDL_VideoDevice* video = current_video;
1979 if (video && video->GetMonitorDPI) {
1980 result = video->GetMonitorDPI(video, xDpi, yDpi);
1988 SDL_VideoDevice* video = current_video;
1990 if (video && video->GetMonitorRect) {
1991 result = video->GetMonitorRect(video, rect);
2001 SDL_VideoDevice *video = current_video;
2004 if ( video && video->GetWMInfo ) {
2005 return(video->GetWMInfo(this, info));