1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
\r
5 <meta http-equiv="Content-Style-Type" content="text/css">
\r
6 <meta name="keywords" content="Simple Directmedia Layer SDL2.0">
\r
7 <link rel="top" href="index.html" title="
\83z
\81[
\83\80">
\r
8 <link rel="parent" href="CategoryRender.html" title="1
\82Â
\8fã">
\r
9 <title>SDL_CreateTextureFromSurface</title>
\r
12 <a href="index.html">
\96Ú
\8e\9f</a> - <a href="ApiByCategory.html">API(
\8b@
\94\
\95Ê)</a> - <a href="CategoryRender.html">2D
\83\8c\83\93\83_
\83\8a\83\93\83O</a> - SDL_CreateTextureFromSurface
\r
14 <h1>SDL_CreateTextureFromSurface</h1>
\r
15 \83T
\81[
\83t
\83F
\83C
\83X
\82©
\82ç
\83e
\83N
\83X
\83`
\83\83\82ð
\90¶
\90¬
\82·
\82é
\r
17 <code>SDL_Texture* SDL_CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface)</code>
\r
19 <table border="1" summary="SDL_CreateTextureFromSurface">
\r
20 <tr><td>renderer</td><td>
\83\8c\83\93\83_
\83\8a\83\93\83O
\83R
\83\93\83e
\83L
\83X
\83g</td></tr>
\r
21 <tr><td>surface</td><td>
\83e
\83N
\83X
\83`
\83\83\82Å
\8eg
\82¤
\83s
\83N
\83Z
\83\8b\83f
\81[
\83^
\82ð
\8e\9d\82Â<a href="SDL_Surface.html">SDL_Surface</a></td></tr>
\r
23 <h2>
\96ß
\82è
\92l</h2>
\r
24 \90¬
\8c÷
\82Ì
\82Æ
\82«
\90¶
\90¬
\82³
\82ê
\82½
\83e
\83N
\83X
\83`
\83\83,
\8e¸
\94s
\82Ì
\82Æ
\82«NULL
\82ð
\96ß
\82·.
\r
25 <a href="SDL_GetError.html">SDL_GetError()</a>
\82Å
\8fÚ
\8d×
\82ð
\92m
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
26 <h2>
\83T
\83\93\83v
\83\8b\83R
\81[
\83h</h2>
\r
30 /* OpenGL
\82Ì
\83e
\83N
\83X
\83`
\83\83\82Æ
\82µ
\82Ä
\8eg
\82¤
\82½
\82ß
\82É
\r
31 \8ae
\83s
\83N
\83Z
\83\8b\82ªR,G,B,A
\8f\87\82Ì32bit
\83T
\81[
\83t
\83F
\83C
\83X
\82ð
\90¶
\90¬
\82·
\82é */
\r
32 SDL_Surface *surface;
\r
33 Uint32 rmask, gmask, bmask, amask;
\r
35 /* SDL
\82Í
\83s
\83N
\83Z
\83\8b\82ð32bit
\82Ì
\92l
\82Æ
\82µ
\82Ä
\89ð
\8eß
\82·
\82é.
\r
36 \82æ
\82Á
\82Ä,
\83}
\83X
\83N
\82Í
\83}
\83V
\83\93\82Ì
\83G
\83\93\83f
\83B
\83A
\83\93(
\83o
\83C
\83g
\8f\87)
\82É
\88Ë
\91¶
\82·
\82é */
\r
37 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
\r
49 surface = SDL_CreateRGBSurface(0, width, height, 32,
\r
50 rmask, gmask, bmask, amask);
\r
51 if (surface == NULL) {
\r
52 fprintf(stderr, "CreateRGBSurface
\8e¸
\94s: %s\n", SDL_GetError());
\r
56 SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer, surface);
\r
58 if (texture == NULL) {
\r
59 fprintf(stderr, "CreateTextureFromSurface
\8e¸
\94s: %s\n", SDL_GetError());
\r
63 SDL_FreeSurface(surface);
\r
71 \82±
\82Ì
\8aÖ
\90\94\82Í
\83T
\81[
\83t
\83F
\83C
\83X
\82ð
\8fC
\90³/
\89ð
\95ú
\82µ
\82È
\82¢.
\r
74 \82±
\82Ì
\83e
\83N
\83X
\83`
\83\83\82Ì<a href="SDL_TextureAccess.html">SDL_TextureAccess</a>
\83q
\83\93\83g
\82ÍSDL_TEXTUREACCESS_STATIC
\82Å
\82 \82é.
\r
77 \90¶
\90¬
\82³
\82ê
\82é
\83e
\83N
\83X
\83`
\83\83\82Ì
\83s
\83N
\83Z
\83\8b\8c`
\8e®
\82Í
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\83s
\83N
\83Z
\83\8b\8c`
\8e®
\82Æ
\82Í
\88Ù
\82È
\82é
\8fê
\8d\87\82ª
\82 \82é.
\r
78 \83e
\83N
\83X
\83`
\83\83\82Ì
\83s
\83N
\83Z
\83\8b\8c`
\8e®
\82Í<a href="SDL_QueryTexture.html">SDL_QueryTexture()</a>
\82Å
\93¾
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
80 <h2>
\8aÖ
\98A
\8d\80\96Ú(
\8aÖ
\90\94)</h2>
\r
81 <a href="SDL_CreateTexture.html">SDL_CreateTexture</a><br>
\r
82 <a href="SDL_DestroyTexture.html">SDL_DestroyTexture</a><br>
\r
83 <a href="SDL_QueryTexture.html">SDL_QueryTexture</a><br>
\r
84 <h2>SDL Wiki
\82Ö
\82Ì
\83\8a\83\93\83N</h2>
\r
85 <a href="https://wiki.libsdl.org/SDL_CreateTextureFromSurface">SDL_CreateTextureFromSurface - SDL Wiki</a>
\r