Lines Matching refs:video
24 /* The high-level video driver subsystem */
34 /* Available video drivers */
149 * Initialize the video and event subsystems -- determine native pixel format
153 SDL_VideoDevice *video;
174 /* Select the proper video driver */
176 video = NULL;
186 video = bootstrap[i]->create(index);
194 video = bootstrap[i]->create(index);
195 if ( video != NULL ) {
201 if ( video == NULL ) {
202 SDL_SetError("No available video device");
205 current_video = video;
209 video->screen = NULL;
210 video->shadow = NULL;
211 video->visible = NULL;
212 video->physpal = NULL;
213 video->gammacols = NULL;
214 video->gamma = NULL;
215 video->wm_title = NULL;
216 video->wm_icon = NULL;
217 video->offset_x = 0;
218 video->offset_y = 0;
219 SDL_memset(&video->info, 0, (sizeof video->info));
221 video->displayformatalphapixel = NULL;
224 video->gl_config.driver_loaded = 0;
225 video->gl_config.dll_handle = NULL;
226 video->gl_config.red_size = 3;
227 video->gl_config.green_size = 3;
228 video->gl_config.blue_size = 2;
229 video->gl_config.alpha_size = 0;
230 video->gl_config.buffer_size = 0;
231 video->gl_config.depth_size = 16;
232 video->gl_config.stencil_size = 0;
233 video->gl_config.double_buffer = 1;
234 video->gl_config.accum_red_size = 0;
235 video->gl_config.accum_green_size = 0;
236 video->gl_config.accum_blue_size = 0;
237 video->gl_config.accum_alpha_size = 0;
238 video->gl_config.stereo = 0;
239 video->gl_config.multisamplebuffers = 0;
240 video->gl_config.multisamplesamples = 0;
241 video->gl_config.accelerated = -1; /* not known, don't set */
242 video->gl_config.swap_control = -1; /* not known, don't set */
244 /* Initialize the video subsystem */
246 if ( video->VideoInit(video, &vformat) < 0 ) {
251 /* Create a zero sized video surface of the appropriate format */
264 * a video mode has been set anyway. :)
270 video->SetColors(video,
274 video->info.vfmt = SDL_VideoSurface->format;
311 * Get the current information about the video hardware
333 SDL_VideoDevice *video = current_video;
342 modes = video->ListModes(this, format, flags);
348 * Check to see if a particular video mode is supported.
352 * one used when setting the video mode, SDL_SetVideoMode() will succeed,
430 * Get the closest non-emulated video mode to the one requested
450 /* Try the original video mode, get the closest depth */
496 SDL_SetError("No video mode large enough for %dx%d", *w, *h);
553 /* If the video surface is resizable, the shadow should say so */
557 /* If the video surface has no frame, the shadow should say so */
561 /* If the video surface is fullscreen, the shadow should say so */
565 /* If the video surface is flippable, the shadow should say so */
581 * Set the requested video mode, allocating a shadow buffer if necessary.
585 SDL_VideoDevice *video, *this;
597 /* Start up the video driver, if necessary..
605 this = video = current_video;
609 width = video->info.current_w;
612 height = video->info.current_h;
614 /* Default to the current video bpp */
620 /* Get a good video mode, the closest one possible */
646 /* These flags are for 2D video modes only */
656 /* Clean up any previous video mode */
666 if ( video->physpal ) {
667 SDL_free(video->physpal->colors);
668 SDL_free(video->physpal);
669 video->physpal = NULL;
671 if( video->gammacols) {
672 SDL_free(video->gammacols);
673 video->gammacols = NULL;
679 /* Try to set the video mode, along with offset and clipping */
683 mode = video->SetVideoMode(this, prev_mode,video_w,video_h,video_bpp,flags);
704 * already been freed by the video driver. What do we do in
712 SDL_SetError("Video mode smaller than requested");
720 video->SetColors(this, 0, vf->palette->ncolors,
725 video->offset_x = 0;
726 video->offset_y = 0;
732 video->offset_x = (mode->w-width)/2;
733 video->offset_y = (mode->h-height)/2;
734 mode->offset = video->offset_y*mode->pitch +
735 video->offset_x*mode->format->BytesPerPixel;
749 /* If we failed setting a video mode, return NULL... (Uh Oh!) */
755 if ( ! video->info.wm_available ) {
759 /* Reset the mouse cursor and grab for new video mode */
761 if ( video->UpdateMouse ) {
762 video->UpdateMouse(this);
777 #define SDL_PROC(ret,func,params) video->func=func;
781 video->func = SDL_GL_GetProcAddress(#func); \
782 if ( ! video->func ) { \
796 if ( (video->screen->flags & SDL_OPENGL) &&
797 video->GL_MakeCurrent ) {
798 if ( video->GL_MakeCurrent(this) < 0 ) {
815 (SDL_strstr((const char *)video->glGetString(GL_EXTENSIONS), "GL_EXT_packed_pixels") ||
816 (SDL_atof((const char *)video->glGetString(GL_VERSION)) >= 1.2f))
818 video->is_32bit = 0;
833 video->is_32bit = 1;
857 /* Free the original video mode surface (is this safe?) */
862 video->glGenTextures( 1, &video->texture );
863 video->glBindTexture( GL_TEXTURE_2D, video->texture );
864 video->glTexImage2D(
867 video->is_32bit ? GL_RGBA : GL_RGB,
871 video->is_32bit ? GL_RGBA : GL_RGB,
873 video->is_32bit ? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT_5_6_5,
879 video->UpdateRects = SDL_GL_UpdateRectsLock;
898 /* If the surface is in hardware, video writes are visible
916 video->info.vfmt = SDL_VideoSurface->format;
917 video->info.current_w = SDL_VideoSurface->w;
918 video->info.current_h = SDL_VideoSurface->h;
925 * Convert a surface into the video pixel format.
932 SDL_SetError("No video mode has been set");
966 SDL_SetError("No video mode has been set");
985 /* Keep the video format, as long as the high 8 bits are
1040 SDL_VideoDevice *video = current_video;
1054 if ( video->gammacols ) {
1056 pal->colors = video->gammacols;
1057 } else if ( video->physpal ) {
1059 pal->colors = video->physpal->colors;
1081 /* Fall through to video surface update */
1085 /* Update the video surface */
1088 rects[i].x += video->offset_x;
1089 rects[i].y += video->offset_y;
1091 video->UpdateRects(this, numrects, rects);
1093 rects[i].x -= video->offset_x;
1094 rects[i].y -= video->offset_y;
1097 video->UpdateRects(this, numrects, rects);
1107 SDL_VideoDevice *video = current_video;
1108 /* Copy the shadow surface to the video surface */
1116 if ( video->gammacols ) {
1118 pal->colors = video->gammacols;
1119 } else if ( video->physpal ) {
1121 pal->colors = video->physpal->colors;
1144 /* Fall through to video surface update */
1149 return(video->FlipHWSurface(this, SDL_VideoSurface));
1186 SDL_VideoDevice *video = current_video;
1189 if ( video->physpal ) {
1193 SDL_memcpy(video->physpal->colors + firstcolor,
1207 * The video surface is not indexed - invalidate any
1208 * active shadow-to-video blit mappings.
1213 if ( video->gamma ) {
1214 if( ! video->gammacols ) {
1215 SDL_Palette *pp = video->physpal;
1218 video->gammacols = SDL_malloc(pp->ncolors
1220 SDL_ApplyGamma(video->gamma,
1222 video->gammacols,
1225 SDL_ApplyGamma(video->gamma, colors,
1226 video->gammacols
1238 if ( video->gamma ) {
1239 SDL_ApplyGamma(video->gamma, colors, gcolors, ncolors);
1242 gotall = video->SetColors(video, firstcolor, ncolors, colors);
1244 /* The video flags shouldn't have SDL_HWPALETTE, and
1245 the video driver is responsible for copying back the
1246 correct colors into the video surface palette.
1304 SDL_VideoDevice *video = current_video;
1310 if ( !video->physpal && !(which & SDL_LOGPAL) ) {
1317 video->physpal = pp;
1342 * Clean up the video subsystem
1349 SDL_VideoDevice *video = current_video;
1364 /* Clean up the system video */
1365 video->VideoQuit(this);
1379 if ( video->physpal ) {
1380 SDL_free(video->physpal->colors);
1381 SDL_free(video->physpal);
1382 video->physpal = NULL;
1384 if ( video->gammacols ) {
1385 SDL_free(video->gammacols);
1386 video->gammacols = NULL;
1388 if ( video->gamma ) {
1389 SDL_free(video->gamma);
1390 video->gamma = NULL;
1392 if ( video->wm_title != NULL ) {
1393 SDL_free(video->wm_title);
1394 video->wm_title = NULL;
1396 if ( video->wm_icon != NULL ) {
1397 SDL_free(video->wm_icon);
1398 video->wm_icon = NULL;
1401 /* Finish cleaning up video subsystem */
1402 video->free(this);
1411 SDL_VideoDevice *video = current_video;
1416 if ( video == NULL ) {
1417 SDL_SetError("Video subsystem has not been initialized");
1419 if ( video->GL_LoadLibrary ) {
1420 retval = video->GL_LoadLibrary(this, path);
1422 SDL_SetError("No dynamic GL support in video driver");
1430 SDL_VideoDevice *video = current_video;
1435 if ( video->GL_GetProcAddress ) {
1436 if ( video->gl_config.driver_loaded ) {
1437 func = video->GL_GetProcAddress(this, proc);
1442 SDL_SetError("No dynamic GL support in video driver");
1447 /* Set the specified GL attribute for setting up a GL video mode */
1451 SDL_VideoDevice *video = current_video;
1456 video->gl_config.red_size = value;
1459 video->gl_config.green_size = value;
1462 video->gl_config.blue_size = value;
1465 video->gl_config.alpha_size = value;
1468 video->gl_config.double_buffer = value;
1471 video->gl_config.buffer_size = value;
1474 video->gl_config.depth_size = value;
1477 video->gl_config.stencil_size = value;
1480 video->gl_config.accum_red_size = value;
1483 video->gl_config.accum_green_size = value;
1486 video->gl_config.accum_blue_size = value;
1489 video->gl_config.accum_alpha_size = value;
1492 video->gl_config.stereo = value;
1495 video->gl_config.multisamplebuffers = value;
1498 video->gl_config.multisamplesamples = value;
1501 video->gl_config.accelerated = value;
1504 video->gl_config.swap_control = value;
1518 SDL_VideoDevice* video = current_video;
1521 if ( video->GL_GetAttribute ) {
1533 SDL_VideoDevice *video = current_video;
1536 if ( video->screen->flags & SDL_OPENGL ) {
1537 video->GL_SwapBuffers(this);
1539 SDL_SetError("OpenGL video mode has not been set");
1701 SDL_VideoDevice *video = current_video;
1704 if ( video ) {
1706 if ( video->wm_title ) {
1707 SDL_free(video->wm_title);
1709 video->wm_title = SDL_strdup(title);
1712 if ( video->wm_icon ) {
1713 SDL_free(video->wm_icon);
1715 video->wm_icon = SDL_strdup(icon);
1717 if ( (title || icon) && (video->SetCaption != NULL) ) {
1718 video->SetCaption(this, video->wm_title,video->wm_icon);
1730 SDL_VideoDevice *video = current_video;
1732 if ( video ) {
1734 *title = video->wm_title;
1737 *icon = video->wm_icon;
1804 SDL_VideoDevice *video = current_video;
1807 if ( icon && video->SetIcon ) {
1822 video->SetIcon(video, icon, mask);
1825 video->SetIcon(this, icon, mask);
1837 SDL_VideoDevice *video = current_video;
1841 if ( video->GrabInput == NULL ) {
1842 return(video->input_grab);
1850 if ( video->input_grab != SDL_GRAB_OFF ) {
1851 mode = video->GrabInput(this, mode);
1854 if ( video->input_grab == SDL_GRAB_OFF ) {
1855 mode = video->GrabInput(this, mode);
1858 if ( mode != video->input_grab ) {
1859 video->input_grab = mode;
1860 if ( video->CheckMouseMode ) {
1861 video
1865 printf("Final mode %d\n", video->input_grab);
1876 SDL_VideoDevice *video = current_video;
1878 /* If the video isn't initialized yet, we can't do anything */
1879 if ( ! video ) {
1885 mode = video->input_grab;
1895 /* If the video surface is fullscreen, we always grab */
1924 SDL_VideoDevice *video = current_video;
1929 if ( video->IconifyWindow ) {
1930 retval = video->IconifyWindow(this);
1940 SDL_VideoDevice *video = current_video;
1946 video->ToggleFullScreen ) {
1948 toggled = video->ToggleFullScreen(this, 0);
1954 toggled = video->ToggleFullScreen(this, 1);
1962 SDL_WM_GrabInput(video->input_grab);
1973 SDL_VideoDevice* video = current_video;
1975 if (video && video->SetWindowPos)
1976 video->SetWindowPos(video, x, y);
1984 SDL_VideoDevice* video = current_video;
1986 if (video && video->GetWindowPos)
1987 video->GetWindowPos(video, px, py);
1998 SDL_VideoDevice* video = current_video;
2000 if (video && video->IsWindowVisible) {
2001 result = video->IsWindowVisible(video, recenter);
2009 SDL_VideoDevice* video = current_video;
2011 if (video && video->GetMonitorDPI) {
2012 result = video->GetMonitorDPI(video, xDpi, yDpi);
2020 SDL_VideoDevice* video = current_video;
2022 if (video && video->GetMonitorRect) {
2023 result = video->GetMonitorRect(video, rect);
2033 SDL_VideoDevice *video = current_video;
2036 if ( video && video->GetWMInfo ) {
2037 return(video->GetWMInfo(this, info));