Home Database Mysql Tutorial SDL解析SDL视频处理(2)

SDL解析SDL视频处理(2)

Jun 07, 2016 pm 03:30 PM
sdl deal with how video parse

怎样向 SDL_SetVideoMode返回的缓冲区中填写数据,让它显示在窗口当中呢?官方文档中提供了一个putpixel函数,非常合适。 这个函数就是将某个像素点值写向缓冲区surface的(x,y)位置当中。surface是SDL_Surface类型的结构体,其中的pixels成员就代表了缓冲

 

怎样向 SDL_SetVideoMode返回的缓冲区中填写数据,让它显示在窗口当中呢?官方文档中提供了一个putpixel函数,非常合适。

SDL解析SDL视频处理(2)

    这个函数就是将某个像素点值写向缓冲区surface的(x,y)位置当中。surface是SDL_Surface类型的结构体,其中的pixels成员就代表了缓冲区的首地址了。

    但是,pixels成员其实就是一段内存而已,虽然它代表了抽象缓冲区,但是在pixels中的数据没有真正的更新到设备之前,这个新修改的像素点是不会被显示的。于是,我们还需要这样一个函数:

void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);

    这个函数能够将screen中某一个矩形区域刷新。x,y代表了要刷新的矩形区域的坐标,w,h则代表了该区域的宽和高,当这连个值是0可以表示更新所有的缓冲区。此时,如果该区域恰好包含了修改后的图形,那么这就表示图形被显示了。

    可想而知,SDL_UpdateRect函数也应该是硬件相关的。SDL最终会真正去调用各个SDL_VideoDevice的UpdateRect函数指针成员,在这里实现真正的屏幕刷新。

 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Is it infringing to post other people's videos on Douyin? How does it edit videos without infringement? Is it infringing to post other people's videos on Douyin? How does it edit videos without infringement? Mar 21, 2024 pm 05:57 PM

With the rise of short video platforms, Douyin has become an indispensable part of everyone's daily life. On TikTok, we can see interesting videos from all over the world. Some people like to post other people’s videos, which raises a question: Is Douyin infringing upon posting other people’s videos? This article will discuss this issue and tell you how to edit videos without infringement and how to avoid infringement issues. 1. Is it infringing upon Douyin’s posting of other people’s videos? According to the provisions of my country's Copyright Law, unauthorized use of the copyright owner's works without the permission of the copyright owner is an infringement. Therefore, posting other people’s videos on Douyin without the permission of the original author or copyright owner is an infringement. 2. How to edit a video without infringement? 1. Use of public domain or licensed content: Public

The operation process of WIN10 service host occupying too much CPU The operation process of WIN10 service host occupying too much CPU Mar 27, 2024 pm 02:41 PM

1. First, we right-click the blank space of the taskbar and select the [Task Manager] option, or right-click the start logo, and then select the [Task Manager] option. 2. In the opened Task Manager interface, we click the [Services] tab on the far right. 3. In the opened [Service] tab, click the [Open Service] option below. 4. In the [Services] window that opens, right-click the [InternetConnectionSharing(ICS)] service, and then select the [Properties] option. 5. In the properties window that opens, change [Open with] to [Disabled], click [Apply] and then click [OK]. 6. Click the start logo, then click the shutdown button, select [Restart], and complete the computer restart.

How to make money from posting videos on Douyin? How can a newbie make money on Douyin? How to make money from posting videos on Douyin? How can a newbie make money on Douyin? Mar 21, 2024 pm 08:17 PM

Douyin, the national short video platform, not only allows us to enjoy a variety of interesting and novel short videos in our free time, but also gives us a stage to show ourselves and realize our values. So, how to make money by posting videos on Douyin? This article will answer this question in detail and help you make more money on TikTok. 1. How to make money from posting videos on Douyin? After posting a video and gaining a certain amount of views on Douyin, you will have the opportunity to participate in the advertising sharing plan. This income method is one of the most familiar to Douyin users and is also the main source of income for many creators. Douyin decides whether to provide advertising sharing opportunities based on various factors such as account weight, video content, and audience feedback. The TikTok platform allows viewers to support their favorite creators by sending gifts,

How to post videos on Weibo without compressing the image quality_How to post videos on Weibo without compressing the image quality How to post videos on Weibo without compressing the image quality_How to post videos on Weibo without compressing the image quality Mar 30, 2024 pm 12:26 PM

1. First open Weibo on your mobile phone and click [Me] in the lower right corner (as shown in the picture). 2. Then click [Gear] in the upper right corner to open settings (as shown in the picture). 3. Then find and open [General Settings] (as shown in the picture). 4. Then enter the [Video Follow] option (as shown in the picture). 5. Then open the [Video Upload Resolution] setting (as shown in the picture). 6. Finally, select [Original Image Quality] to avoid compression (as shown in the picture).

How to publish Xiaohongshu video works? What should I pay attention to when posting videos? How to publish Xiaohongshu video works? What should I pay attention to when posting videos? Mar 23, 2024 pm 08:50 PM

With the rise of short video platforms, Xiaohongshu has become a platform for many people to share their lives, express themselves, and gain traffic. On this platform, publishing video works is a very popular way of interaction. So, how to publish Xiaohongshu video works? 1. How to publish Xiaohongshu video works? First, make sure you have a video content ready to share. You can use your mobile phone or other camera equipment to shoot, but you need to pay attention to the image quality and sound clarity. 2. Edit the video: In order to make the work more attractive, you can edit the video. You can use professional video editing software, such as Douyin, Kuaishou, etc., to add filters, music, subtitles and other elements. 3. Choose a cover: The cover is the key to attracting users to click. Choose a clear and interesting picture as the cover to attract users to click on it.

How to embed ppt video into a slide document and combine it into a file How to embed ppt video into a slide document and combine it into a file Mar 20, 2024 am 11:30 AM

Microsoft PowerPoint presentation is one of our commonly used office software. In order to present the content to be explained in a comprehensive and detailed manner, video is one of the important presentation methods. You know, when we insert videos into PPT, whether through hyperlinks or WindowsMediaPlayer controls, we need to consider path issues. So, if we want to embed PPT video and combine it into a file, how should we solve it? Next, let’s take a look at the solution! The steps are as follows: 1. First, we double-click to open the [Video Embed.pptx] Microsoft PowerPoint presentation. Because ShockwaveFlashO is used

How to download videos from Baidu Netdisk to mobile photo albums How to save videos to mobile phone photo albums How to download videos from Baidu Netdisk to mobile photo albums How to save videos to mobile phone photo albums Mar 13, 2024 am 09:34 AM

Nowadays, more and more friends are particularly dependent on Baidu Netdisk software, and they can find that the functions here are particularly rich. These functions allow everyone to choose and use them for free. It is really good at solving some problems for you. It is very powerful and easy to use. The super large storage space can really help you store various resources. You will never be able to find these files. Resources, whether you are at work or studying, if you have any document type content that you want to store, we can satisfy everyone. For these file resources here, you can view or view them at any time here. Sharing is very convenient. Anyway, it is permanently saved in your account. Then you

Two solutions for sharing edge browser web videos with no sound Two solutions for sharing edge browser web videos with no sound Mar 14, 2024 pm 02:22 PM

Many users like to watch videos on the browser. If there is no sound when watching web videos on the edge browser, how to solve the problem? This problem is not difficult. Next, let me tell you how to fix the problem of no sound in edge browser web videos. There is no sound in edge browser web videos? Method 1: 1. First, check the top tab of the edge browser. 2. There is a "Sound Button" on the left side of the tab, make sure it is not muted. Method 2: 1. If it is confirmed that the sound is not muted, it may be a sound setting problem. 2. You can right-click the sound device in the lower right corner and select "Open Volume Synthesizer" 3. Open

See all articles