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="CategorySurface.html" title="1
\82Â
\8fã">
\r
9 <title>SDL_CreateRGBSurface</title>
\r
12 <a href="index.html">
\96Ú
\8e\9f</a> - <a href="ApiByCategory.html">API(
\8b@
\94\
\95Ê)</a> - <a href="CategorySurface.html">
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\90¶
\90¬
\82Æ
\92P
\8f\83\82È
\95`
\89æ</a> - SDL_CreateRGBSurface
\r
14 <h1>SDL_CreateRGBSurface</h1>
\r
15 \90V
\82µ
\82¢RGB
\83T
\81[
\83t
\83F
\83C
\83X
\82ð
\90¶
\90¬
\82·
\82é
\r
17 <code>SDL_Surface* SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)</code>
\r
19 <table border="1" summary="SDL_CreateRGBSurface">
\r
20 <tr><td>flags</td><td>
\96¢
\8eg
\97p
\8fí
\82É0
\82É
\82·
\82é
\82±
\82Æ</td></tr>
\r
21 <tr><td>width</td><td>
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\95\9d</td></tr>
\r
22 <tr><td>height</td><td>
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\8d\82\82³</td></tr>
\r
23 <tr><td>depth</td><td>
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\83r
\83b
\83g
\90[
\93x (
\8fÚ
\8d×
\82ð
\8eQ
\8fÆ
\82·
\82é
\82±
\82Æ)</td></tr>
\r
24 <tr><td>Rmask</td><td>
\83s
\83N
\83Z
\83\8b\82Ì
\90Ô
\83}
\83X
\83N</td></tr>
\r
25 <tr><td>Gmask</td><td>
\83s
\83N
\83Z
\83\8b\82Ì
\97Î
\83}
\83X
\83N</td></tr>
\r
26 <tr><td>Bmask</td><td>
\83s
\83N
\83Z
\83\8b\82Ì
\90Â
\83}
\83X
\83N</td></tr>
\r
27 <tr><td>Amask</td><td>
\83s
\83N
\83Z
\83\8b\82Ì
\83¿
\83}
\83X
\83N</td></tr>
\r
29 <h2>
\96ß
\82è
\92l</h2>
\r
30 \90¬
\8c÷
\82Ì
\82Æ
\82«
\90¶
\90¬
\82³
\82ê
\82½<a href="SDL_Surface.html">SDL_Surface</a>,
\8e¸
\94s
\82Ì
\82Æ
\82«NULL
\82ð
\96ß
\82·.
\r
31 <a href="SDL_GetError.html">SDL_GetError()</a>
\82ð
\8cÄ
\82ñ
\82Å
\8fÚ
\8d×
\82ð
\92m
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
32 <h2>
\83T
\83\93\83v
\83\8b\83R
\81[
\83h</h2>
\r
36 /* OpenGL
\82Ì
\83e
\83N
\83X
\83`
\83\83\82Æ
\82µ
\82Ä
\8eg
\82¤
\82½
\82ß
\82É
\r
37 \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
38 SDL_Surface *surface;
\r
39 Uint32 rmask, gmask, bmask, amask;
\r
41 /* SDL
\82Í
\83s
\83N
\83Z
\83\8b\82ð32bit
\82Ì
\92l
\82Æ
\82µ
\82Ä
\89ð
\8eß
\82·
\82é.
\r
42 \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
43 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
\r
55 surface = SDL_CreateRGBSurface(0, width, height, 32,
\r
56 rmask, gmask, bmask, amask);
\r
57 if(surface == NULL) {
\r
58 fprintf(stderr, "CreateRGBSurface
\8e¸
\94s: %s\n", SDL_GetError());
\r
62 /*
\82Ü
\82½
\82Í,
\8ew
\92è
\82Ì
\83r
\83b
\83g
\90[
\93x
\82Ì
\83f
\83t
\83H
\83\8b\83g
\82Ì
\83}
\83X
\83N
\82ð
\8eg
\82¤ */
\r
63 surface = SDL_CreateRGBSurface(0,width,height,32,0,0,0,0);
\r
69 depth
\82ª4
\82Ü
\82½
\82Í8
\82Ì
\82Æ
\82«,
\8bó
\82Ì
\83p
\83\8c\83b
\83g
\82ª
\90¶
\90¬
\82³
\82ê
\82é.
\r
70 depth
\82ª8
\82ð
\92´
\82¦
\82é
\82Æ
\82«,
\88ø
\90\94\82Ì[RGBA]mask
\82ð
\8eg
\82Á
\82½
\83s
\83N
\83Z
\83\8b\8c`
\8e®
\82ª
\90Ý
\92è
\82³
\82ê
\82é.
\r
73 [RGBA]mask
\82Í
\83s
\83N
\83Z
\83\8b\82Ì
\90F
\82ð
\8ew
\92è
\82·
\82é
\82½
\82ß
\82Ì
\83r
\83b
\83g
\83}
\83X
\83N
\82Æ
\82µ
\82Ä
\8eg
\82í
\82ê
\82é.
\r
74 \97á
\82¦
\82Î, Rmask
\82ªFF0000
\82È
\82ç
\82Î,
\90Ô
\82Ì
\83f
\81[
\83^
\82Í
\8dÅ
\8fã
\88Ê
\83o
\83C
\83g
\82É
\8ai
\94[
\82³
\82ê
\82é.
\r
75 [RGB]mask
\82ð0
\82É
\82·
\82é
\82Æ,
\83r
\83b
\83g
\90[
\93x
\82É
\8aî
\82Ã
\82¢
\82½
\83f
\83t
\83H
\83\8b\83g
\82Ì
\92l
\82É
\82È
\82é.
\r
76 (
\97á: <code>SDL_CreateRGBSurface(0,w,h,32,0,0,0,0);</code>)
\r
77 \82µ
\82©
\82µ, Amask
\82ð0
\82É
\82·
\82é
\82Æ,
\83¿
\83}
\83X
\83N
\82Í0
\82É
\82È
\82é.
\r
80 \83¿
\83}
\83X
\83N
\95t
\82«
\83T
\81[
\83t
\83F
\83C
\83X
\82Ì
\83u
\83\8c\83\93\83h
\83\82\81[
\83h
\82Ì
\8f\89\8aú
\92l
\82Í <code>SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND)</code>
\82Å
\82 \82é.
\r
81 <a href="SDL_SetSurfaceBlendMode.html">SDL_SetSurfaceBlendMode()</a>
\82Å
\95Ê
\82Ì
\83u
\83\8c\83\93\83h
\83\82\81[
\83h
\82É
\95Ï
\82¦
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82é.
\r
83 <h2>
\8aÖ
\98A
\8d\80\96Ú(
\8aÖ
\90\94)</h2>
\r
84 <a href="SDL_CreateRGBSurfaceFrom.html">SDL_CreateRGBSurfaceFrom</a><br>
\r
85 <a href="SDL_FreeSurface.html">SDL_FreeSurface</a><br>
\r
86 <h2>SDL Wiki
\82Ö
\82Ì
\83\8a\83\93\83N</h2>
\r
87 <a href="https://wiki.libsdl.org/SDL_CreateRGBSurface">SDL_CreateRGBSurface - SDL Wiki</a>
\r