SDL_BlitSurface
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 SDL_Surface structure to be copied from |
|
srcrect |
the SDL_Rect structure representing the rectangle to be copied, or NULL to copy the entire surface |
|
dst |
the SDL_Surface structure that is the blit target |
|
dstrect |
the SDL_Rect 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 SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
You should call SDL_BlitSurface() 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 SDL_LowerBlit().
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.
- Source surface blend mode set to SDL_BLENDMODE_BLEND:
Related Functions
SDL_BlitSurface的更多相关文章
- SDL第一个程序:加载一张图片
直接看代码吧 using System; using System.Collections.Generic; using System.ComponentModel; using System.Dat ...
- SDL文字和图形
SDL本身没有显示文字功能,它需要用扩展库SDL_ttf来显示文字.ttf是True Type Font的缩写,ttf是Windows下的缺省字体,它有美观,放大缩小不变形的优点,因此广泛应用很多场合 ...
- SDL制作拼图游戏
看完教程第三集后,好像自己能用这个来写一个简单的拼图游戏,第一次写出个带界面的游戏,好有成就感. 图片是自己慢慢截左上部分8个脸. #include <stdio.h> #include ...
- SDL教程第一和第二个视频的笔记
观看正月点灯笼的SDL教程,地址http://www.tudou.com/listplay/9eG9tkk91oQ.html #include <stdio.h> #include < ...
- SDL1.2学习
http://wenku.baidu.com/view/c953c0878762caaedd33d4d8.html 一.安装: sudo apt-get install libsdl1.2-dev l ...
- 转:SDL2源代码分析
1:初始化(SDL_Init()) SDL简介 有关SDL的简介在<最简单的视音频播放示例7:SDL2播放RGB/YUV>以及<最简单的视音频播放示例9:SDL2播放PCM>中 ...
- SDL1.2到2.0的迁移指南(转)
里面有些单词不好翻译所以放在开头,以备查验. BLock Image Transfer, a computer graphics operation in which two bitmap patte ...
- DLL——SDL_PingGe
这篇随笔专门做SDL的DLL开发. 下面这个版本暂且称为Beta版本吧. /* typedef void (*FUNCTION)(void); HMODULE HDll; HDll = LoadLib ...
- SDL_PingGe 1.2
加入了像素填充函数,必须要在一个指定颜色的边界范围内,边界必须没有缺口. 加入了鼠标类 /* typedef void (*FUNCTION)(void); HMODULE HDll; HDll = ...
随机推荐
- 微服务监控zipkin+asp.net core
0.目录 整体架构目录:ASP.NET Core分布式项目实战-目录 监控目录:微服务监控zipkin.skywalking以及日志ELK监控系列 一.zipkin介绍 zipkin是一种分布式跟踪系 ...
- Android 安全退出应用程序的方法总结
正常关闭应用程序: 当应用不再使用时,通常需要关闭应用,可以使用以下三种方法关闭android应用: 第一种方法:首先获取当前进程的id,然后杀死该进程. android.os.Process.kil ...
- Authorize的Forms认证
页面请求步骤: 1.登录地址: http://localhost:4441/SysLogin/AdminLogin 2.登陆成功地址:http://localhost:4441/Frame/MainF ...
- LVS+Keepalived 高可用环境部署记录(主主和主从模式)
之前的文章介绍了LVS负载均衡-基础知识梳理, 下面记录下LVS+Keepalived高可用环境部署梳理(主主和主从模式)的操作流程: 一.LVS+Keepalived主从热备的高可用环境部署 1)环 ...
- ChangeSort
package com.home.test; import java.util.Arrays; public class ChangeSort { public String[] changeLoca ...
- 伪GZCC官网
<html class="no-js"><head> <meta charset="utf-8"> <meta htt ...
- java学习--第50天讲到jquery
4月4日jquery讲完了. jquery组合选择器 逗号隔开 层级选择器 父元素 子元素,直接子元素和间接子元素,空格隔开. 直接后代选择器: 父元素>子元素 选择的直接子元素 下 ...
- 无限级结构SQL查询所有的下级和所有的下级
Id,PId无限级结构,查询某个Id的所有下级或所有上级,使用WITH AS查询 查找Id为1所有的下级 /*查找Id为1所有的下级*/ WITH T AS( SELECT Id,PId,Name,0 ...
- myBatis外部的resultMap高级应用
resultMap:外部的resultMap的引用,和resultType不能同时使用. <resultMap id="BaseResultMap" type="c ...
- 同步或者重构Activiti Identify用户数据的多种方案比较
http://www.kafeitu.me/activiti/2012/04/23/synchronize-or-redesign-user-and-role-for-activiti.html 如何 ...