⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdl_video.h

📁 网络MPEG4IP流媒体开发源代码
💻 H
📖 第 1 页 / 共 3 页
字号:
extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect);/* * Gets the clipping rectangle for the destination surface in a blit. * 'rect' must be a pointer to a valid rectangle which will be filled * with the correct values. */extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect);/* * Creates a new surface of the specified format, and then copies and maps  * the given surface to it so the blit of the converted surface will be as  * fast as possible.  If this function fails, it returns NULL. * * The 'flags' parameter is passed to SDL_CreateRGBSurface() and has those  * semantics.  You can also pass SDL_RLEACCEL in the flags parameter and * SDL will try to RLE accelerate colorkey and alpha blits in the resulting * surface. * * This function is used internally by SDL_DisplayFormat(). */extern DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface			(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);/* * This performs a fast blit from the source surface to the destination * surface.  It assumes that the source and destination rectangles are * the same size.  If either 'srcrect' or 'dstrect' are NULL, the entire * surface (src or dst) is copied.  The final blit rectangles are saved * in 'srcrect' and 'dstrect' after all clipping is performed. * If the blit is successful, it returns 0, otherwise it returns -1. * * The blit function should not be called on a locked surface. * * The blit semantics for surfaces with and without alpha and colorkey * are defined as follows: * * RGBA->RGB: *     SDL_SRCALPHA set: * 	alpha-blend (using alpha-channel). * 	SDL_SRCCOLORKEY ignored. *     SDL_SRCALPHA not set: * 	copy RGB. * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the * 	RGB values of the source colour key, ignoring alpha in the * 	comparison. *  * RGB->RGBA: *     SDL_SRCALPHA set: * 	alpha-blend (using the source per-surface alpha value); * 	set destination alpha to opaque. *     SDL_SRCALPHA not set: * 	copy RGB, set destination alpha to source per-surface alpha value. *     both: * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the * 	source colour key. *  * RGBA->RGBA: *     SDL_SRCALPHA set: * 	alpha-blend (using the source alpha channel) the RGB values; * 	leave destination alpha untouched. [Note: is this correct?] * 	SDL_SRCCOLORKEY ignored. *     SDL_SRCALPHA not set: * 	copy all of RGBA to the destination. * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the * 	RGB values of the source colour key, ignoring alpha in the * 	comparison. *  * RGB->RGB:  *     SDL_SRCALPHA set: * 	alpha-blend (using the source per-surface alpha value). *     SDL_SRCALPHA not set: * 	copy RGB. *     both: * 	if SDL_SRCCOLORKEY set, only copy the pixels matching the * 	source colour key. * * If either of the surfaces were in video memory, and the blit returns -2, * the video memory was lost, so it should be reloaded with artwork and  * re-blitted:	while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {		while ( SDL_LockSurface(image) < 0 )			Sleep(10);		-- Write image pixels to image->pixels --		SDL_UnlockSurface(image);	} * This happens under DirectX 5.0 when the system switches away from your * fullscreen application.  The lock will also fail until you have access * to the video memory again. *//* You should call SDL_BlitSurface() unless you know exactly how SDL   blitting works internally and how to use the other blit functions.*/#define SDL_BlitSurface SDL_UpperBlit/* This is the public blit function, SDL_BlitSurface(), and it performs   rectangle validation and clipping before passing it to SDL_LowerBlit()*/extern DECLSPEC int SDLCALL SDL_UpperBlit			(SDL_Surface *src, SDL_Rect *srcrect,			 SDL_Surface *dst, SDL_Rect *dstrect);/* This is a semi-private blit function and it performs low-level surface   blitting only.*/extern DECLSPEC int SDLCALL SDL_LowerBlit			(SDL_Surface *src, SDL_Rect *srcrect,			 SDL_Surface *dst, SDL_Rect *dstrect);/* * This function performs a fast fill of the given rectangle with 'color' * The given rectangle is clipped to the destination surface clip area * and the final fill rectangle is saved in the passed in pointer. * If 'dstrect' is NULL, the whole surface will be filled with 'color' * The color should be a pixel of the format used by the surface, and  * can be generated by the SDL_MapRGB() function. * This function returns 0 on success, or -1 on error. */extern DECLSPEC int SDLCALL SDL_FillRect		(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);/*  * This function takes a surface and copies it to a new surface of the * pixel format and colors of the video framebuffer, suitable for fast * blitting onto the display surface.  It calls SDL_ConvertSurface() * * If you want to take advantage of hardware colorkey or alpha blit * acceleration, you should set the colorkey and alpha value before * calling this function. * * If the conversion fails or runs out of memory, it returns NULL */extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormat(SDL_Surface *surface);/*  * This function takes a surface and copies it to a new surface of the * pixel format and colors of the video framebuffer (if possible), * suitable for fast alpha blitting onto the display surface. * The new surface will always have an alpha channel. * * If you want to take advantage of hardware colorkey or alpha blit * acceleration, you should set the colorkey and alpha value before * calling this function. * * If the conversion fails or runs out of memory, it returns NULL */extern DECLSPEC SDL_Surface * SDLCALL SDL_DisplayFormatAlpha(SDL_Surface *surface);/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* YUV video surface overlay functions                                       *//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* This function creates a video output overlay   Calling the returned surface an overlay is something of a misnomer because   the contents of the display surface underneath the area where the overlay   is shown is undefined - it may be overwritten with the converted YUV data.*/extern DECLSPEC SDL_Overlay * SDLCALL SDL_CreateYUVOverlay(int width, int height,				Uint32 format, SDL_Surface *display);/* Lock an overlay for direct access, and unlock it when you are done */extern DECLSPEC int SDLCALL SDL_LockYUVOverlay(SDL_Overlay *overlay);extern DECLSPEC void SDLCALL SDL_UnlockYUVOverlay(SDL_Overlay *overlay);/* Blit a video overlay to the display surface.   The contents of the video surface underneath the blit destination are   not defined.     The width and height of the destination rectangle may be different from   that of the overlay, but currently only 2x scaling is supported.*/extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay *overlay, SDL_Rect *dstrect);/* Free a video overlay */extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay *overlay);/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* OpenGL support functions.                                                 *//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* * Dynamically load a GL driver, if SDL is built with dynamic GL. * * SDL links normally with the OpenGL library on your system by default, * but you can compile it to dynamically load the GL driver at runtime. * If you do this, you need to retrieve all of the GL functions used in * your program from the dynamic library using SDL_GL_GetProcAddress(). * * This is disabled in default builds of SDL. */extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path);/* * Get the address of a GL function (for extension functions) */extern DECLSPEC void * SDLCALL SDL_GL_GetProcAddress(const char* proc);/* * Set an attribute of the OpenGL subsystem before intialization. */extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value);/* * Get an attribute of the OpenGL subsystem from the windowing * interface, such as glX. This is of course different from getting * the values from SDL's internal OpenGL subsystem, which only * stores the values you request before initialization. * * Developers should track the values they pass into SDL_GL_SetAttribute * themselves if they want to retrieve these values. */extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int* value);/* * Swap the OpenGL buffers, if double-buffering is supported. */extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);/* * Internal functions that should not be called unless you have read * and understood the source code for these functions. */extern DECLSPEC void SDLCALL SDL_GL_UpdateRects(int numrects, SDL_Rect* rects);extern DECLSPEC void SDLCALL SDL_GL_Lock(void);extern DECLSPEC void SDLCALL SDL_GL_Unlock(void);/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* These functions allow interaction with the window manager, if any.        *//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *//* * Sets/Gets the title and icon text of the display window */extern DECLSPEC void SDLCALL SDL_WM_SetCaption(const char *title, const char *icon);extern DECLSPEC void SDLCALL SDL_WM_GetCaption(char **title, char **icon);/* * Sets the icon for the display window. * This function must be called before the first call to SDL_SetVideoMode(). * It takes an icon surface, and a mask in MSB format. * If 'mask' is NULL, the entire icon surface will be used as the icon. */extern DECLSPEC void SDLCALL SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask);/* * This function iconifies the window, and returns 1 if it succeeded. * If the function succeeds, it generates an SDL_APPACTIVE loss event. * This function is a noop and returns 0 in non-windowed environments. */extern DECLSPEC int SDLCALL SDL_WM_IconifyWindow(void);/* * Toggle fullscreen mode without changing the contents of the screen. * If the display surface does not require locking before accessing * the pixel information, then the memory pointers will not change. * * If this function was able to toggle fullscreen mode (change from  * running in a window to fullscreen, or vice-versa), it will return 1. * If it is not implemented, or fails, it returns 0. * * The next call to SDL_SetVideoMode() will set the mode fullscreen * attribute based on the flags parameter - if SDL_FULLSCREEN is not * set, then the display will be windowed by default where supported. * * This is currently only implemented in the X11 video driver. */extern DECLSPEC int SDLCALL SDL_WM_ToggleFullScreen(SDL_Surface *surface);/* * This function allows you to set and query the input grab state of * the application.  It returns the new input grab state. */typedef enum {	SDL_GRAB_QUERY = -1,	SDL_GRAB_OFF = 0,	SDL_GRAB_ON = 1,	SDL_GRAB_FULLSCREEN	/* Used internally */} SDL_GrabMode;/* * Grabbing means that the mouse is confined to the application window, * and nearly all keyboard input is passed directly to the application, * and not interpreted by a window manager, if any. */extern DECLSPEC SDL_GrabMode SDLCALL SDL_WM_GrabInput(SDL_GrabMode mode);/* Not in public API at the moment - do not use! */extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, SDL_Rect *srcrect,                                    SDL_Surface *dst, SDL_Rect *dstrect);                    /* Ends C function definitions when using C++ */#ifdef __cplusplus}#endif#include "close_code.h"#endif /* _SDL_video_h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -