博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SDL_BlitSurface
阅读量:7228 次
发布时间:2019-06-29

本文共 2864 字,大约阅读时间需要 9 分钟。

SDL_BlitSurface

Use this function to perform a fast surface copy to a destination surface.

 

Contents

 

Syntax

 

int SDL_BlitSurface(SDL_Surface*    src,                    const SDL_Rect* srcrect,                    SDL_Surface*    dst,                    SDL_Rect*       dstrect)

 

Function Parameters

src

the  structure to be copied from

srcrect

the  structure representing the rectangle to be copied, or NULL to copy the entire surface

dst

the  structure that is the blit target

dstrect

the  structure representing the rectangle that is copied into

 

Return Value

Returns 0 if the blit is successful or a negative error code on failure; call () for more information.

 

Code Examples

 

You can add your code example here

 

Remarks

You should call () unless you know exactly how SDL blitting works internally and how to use the other blit functions.

This is the public blit function, and it performs rectangle validation and clipping before passing it to ().

The blit function should not be called on a locked surface.

The width and height in srcrect determine the size of the copied rectangle. Only the position is used in the dstrect (the width and height are ignored). Blits with negative dstrectcoordinates will be clipped properly.

If srcrect is NULL, the entire surface is copied. If dstrect is NULL, then the destination position (upper left corner) is (0, 0).

The final blit rectangle is saved in dstrect after all clipping is performed (srcrect is not modified).

The blit semantics for surfaces with and without blending and colorkey are defined as follows:

  • RGBA->RGB:

    • Source surface blend mode set to SDL_BLENDMODE_BLEND:
      • alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored.
      Source surface blend mode set to SDL_BLENDMODE_NONE:
      • copy RGB. if SDL_SRCCOLORKEY set, only copy the pixels matching the RGB values of the source color key, ignoring alpha in the comparison.

    RGB->RGBA:

    • Source surface blend mode set to SDL_BLENDMODE_BLEND:
      • alpha-blend (using the source per-surface alpha)
      Source surface blend mode set to SDL_BLENDMODE_NONE:
      • copy RGB, set destination alpha to source per-surface alpha value.
      both:
      • if SDL_SRCCOLORKEY set, only copy the pixels matching the source color key.

    RGBA->RGBA:

    • Source surface blend mode set to SDL_BLENDMODE_BLEND:
      • alpha-blend (using the source alpha-channel and per-surface alpha) SDL_SRCCOLORKEY ignored.
      Source surface blend mode set to SDL_BLENDMODE_NONE:
      • copy all of RGBA to the destination. if SDL_SRCCOLORKEY set, only copy the pixels matching the RGB values of the source color key, ignoring alpha in the comparison.

    RGB->RGB:

    • Source surface blend mode set to SDL_BLENDMODE_BLEND:
      • alpha-blend (using the source per-surface alpha)
      Source surface blend mode set to SDL_BLENDMODE_NONE:
      • copy RGB.
      both:
      • if SDL_SRCCOLORKEY set, only copy the pixels matching the source color key.

 

转载地址:http://fwdfm.baihongyu.com/

你可能感兴趣的文章
dmidecode查看linux硬件信息
查看>>
linux监控对象及重要性
查看>>
walle-web自动化部署配置
查看>>
opencv轮廓提取、轮廓识别相关要点
查看>>
BOOST.ASIO源码剖析(一)
查看>>
过滤squidlog中各个链接的大小
查看>>
我的友情链接
查看>>
使用AnyChat如何实现任意两用户之间的音视频交互
查看>>
【个人小结】项目公共js的配置,解决不同页面多个配置修改的问题
查看>>
XAMP安装Apacher无法启动
查看>>
mongodb user
查看>>
ip地址子网划分
查看>>
Linux下快速搭建ntp时间同步服务器
查看>>
TouchEvent的传递过程学习笔记
查看>>
Android笔记--TCP Scoket(字符串收发)
查看>>
我的友情链接
查看>>
Hunt framework 2.0.0 发布,简单且高性能的 Web 服务框架
查看>>
数据库原理及应用(SQL Server 2016数据处理)【上海精品视频课程】
查看>>
MaxCompute表设计最佳实践
查看>>
Percona-Server-5.5.15源码安装
查看>>