91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.31MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-16
  • 語言: 其他
  • 標(biāo)簽: SDL2.0??扣色??

資源簡介

兩張png圖片疊加在一起,使用SDL讓前景色透明

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?“include/SDL.h“
#include?“SDL2_image/include/SDL_image.h“
#pragma?comment(lib?“l(fā)ib/x86/SDL2.lib“)
#pragma?comment(lib?“SDL2_image/lib/x86/SDL2_image.lib“)

int?_tmain(int?argc?_TCHAR*?argv[])
{
SDL_Init(SDL_INIT_EVERYTHING);//SDL初始化

SDL_Window?*Screen?=?SDL_CreateWindow(“title“?100?100?640?480?SDL_WINDOW_RESIZABLE);//創(chuàng)建窗口
SDL_Renderer?*render?=?SDL_CreateRenderer(Screen?-1?0);//創(chuàng)建渲染器
SDL_Surface?*bk?=?IMG_Load(“F:\\background.png“);//SDL?IMAGE擴展庫讀取tga圖片
SDL_Surface?*foo?=?IMG_Load(“F:\\foo.png“);//SDL?IMAGE擴展庫讀取tga圖片

//Use?this?function?to?map?an?RGB?triple?to?an?opaque?pixel?value?for?a?given?pixel?format
//format:an?SDL_PixelFormat?structure?describing?the?format?of?the?pixel
Uint32?colorkey?=?SDL_MapRGB(foo->format?0x00?0xff?0xff);//用畫圖工具提取foo.png的背景顏色發(fā)現(xiàn)foo.png的背景色是0x00ffff


//surface:the?SDL_Surface?structure?to?update
//flag:SDL_TRUE?to?enable?color?key?SDL_FALSE?to?disable?color?key
//key:the?transparent?pixel
//Returns?0?on?success?or?a?negative?error?code?on?failure;?call?SDL_GetError()?for?more?information.
SDL_SetColorKey(foo?1?colorkey);//Use?this?function?to?set?the?color?key?(transparent?pixel)?in?a?surface.

SDL_Texture?*texture?=?SDL_CreateTextureFromSurface(render?bk);//創(chuàng)建紋理
SDL_Texture?*texture1?=?SDL_CreateTextureFromSurface(render?foo);//創(chuàng)建紋理

SDL_RenderClear(render);
SDL_RenderCopy(render?texture?NULL?NULL);//拷貝數(shù)據(jù)顯示

SDL_Rect?rect;
rect.x?=?50;
rect.y?=?125;
rect.w?=?foo->w;
rect.h?=?foo->h;
SDL_RenderCopy(render?texture1?NULL?&rect);//拷貝數(shù)據(jù)顯示
SDL_RenderPresent(render);

SDL_Event?event;
while?(1){
SDL_PollEvent(&event);
if?(event.type?==?SDL_QUIT){
break;
}
}

SDL_FreeSurface(bk);//是否圖片資源
SDL_DestroyTexture(texture);//釋放紋理
SDL_DestroyRenderer(render);//釋放渲染器
SDL_DestroyWindow(Screen);//銷毀窗口
SDL_Quit();//退出
return?0;
}



?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3718??2005-06-17?19:30??SDL_Lesson1\Debug\bk.png

?????文件????????548??2005-06-17?19:30??SDL_Lesson1\Debug\foo.png

?????文件?????223232??2016-01-02?21:52??SDL_Lesson1\Debug\libjpeg-9.dll

?????文件?????200704??2016-01-02?21:52??SDL_Lesson1\Debug\libpng16-16.dll

?????文件?????436224??2016-01-02?21:52??SDL_Lesson1\Debug\libtiff-5.dll

?????文件?????271872??2016-01-02?21:52??SDL_Lesson1\Debug\libwebp-4.dll

?????文件????1068544??2016-10-19?20:58??SDL_Lesson1\Debug\SDL2.dll

?????文件??????93184??2016-01-02?21:52??SDL_Lesson1\Debug\SDL2_image.dll

?????文件??????32768??2017-06-22?13:38??SDL_Lesson1\Debug\SDL_Lesson1.exe

?????文件?????123904??2016-01-02?21:52??SDL_Lesson1\Debug\zlib1.dll

?????文件???????4182??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\begin_code.h

?????文件???????1417??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\close_code.h

?????文件???????4101??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL.h

?????文件??????10860??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_assert.h

?????文件???????9458??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_atomic.h

?????文件??????28133??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_audio.h

?????文件???????2527??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_bits.h

?????文件???????2252??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_blendmode.h

?????文件???????1966??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_clipboard.h

?????文件???????5722??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_config.h

?????文件???????4181??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_cpuinfo.h

?????文件??????73519??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_egl.h

?????文件???????5944??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_endian.h

?????文件???????2271??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_error.h

?????文件??????28067??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_events.h

?????文件???????5255??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_filesystem.h

?????文件??????10824??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_gamecontroller.h

?????文件???????2157??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_gesture.h

?????文件??????38621??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_haptic.h

?????文件??????32393??2016-10-19?20:59??SDL_Lesson1\SDL_Lesson1\include\SDL_hints.h

............此處省略110個文件信息

評論

共有 條評論

相關(guān)資源