1 <HTML 2 ><HEAD 3 ><TITLE 4 >SDL_CreateRGBSurfaceFrom</TITLE 5 ><META 6 NAME="GENERATOR" 7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ 8 "><LINK 9 REL="HOME" 10 TITLE="SDL Library Documentation" 11 HREF="index.html"><LINK 12 REL="UP" 13 TITLE="Video" 14 HREF="video.html"><LINK 15 REL="PREVIOUS" 16 TITLE="SDL_CreateRGBSurface" 17 HREF="sdlcreatergbsurface.html"><LINK 18 REL="NEXT" 19 TITLE="SDL_FreeSurface" 20 HREF="sdlfreesurface.html"></HEAD 21 ><BODY 22 CLASS="REFENTRY" 23 BGCOLOR="#FFF8DC" 24 TEXT="#000000" 25 LINK="#0000ee" 26 VLINK="#551a8b" 27 ALINK="#ff0000" 28 ><DIV 29 CLASS="NAVHEADER" 30 ><TABLE 31 SUMMARY="Header navigation table" 32 WIDTH="100%" 33 BORDER="0" 34 CELLPADDING="0" 35 CELLSPACING="0" 36 ><TR 37 ><TH 38 COLSPAN="3" 39 ALIGN="center" 40 >SDL Library Documentation</TH 41 ></TR 42 ><TR 43 ><TD 44 WIDTH="10%" 45 ALIGN="left" 46 VALIGN="bottom" 47 ><A 48 HREF="sdlcreatergbsurface.html" 49 ACCESSKEY="P" 50 >Prev</A 51 ></TD 52 ><TD 53 WIDTH="80%" 54 ALIGN="center" 55 VALIGN="bottom" 56 ></TD 57 ><TD 58 WIDTH="10%" 59 ALIGN="right" 60 VALIGN="bottom" 61 ><A 62 HREF="sdlfreesurface.html" 63 ACCESSKEY="N" 64 >Next</A 65 ></TD 66 ></TR 67 ></TABLE 68 ><HR 69 ALIGN="LEFT" 70 WIDTH="100%"></DIV 71 ><H1 72 ><A 73 NAME="SDLCREATERGBSURFACEFROM" 74 ></A 75 >SDL_CreateRGBSurfaceFrom</H1 76 ><DIV 77 CLASS="REFNAMEDIV" 78 ><A 79 NAME="AEN1856" 80 ></A 81 ><H2 82 >Name</H2 83 >SDL_CreateRGBSurfaceFrom -- Create an SDL_Surface from pixel data</DIV 84 ><DIV 85 CLASS="REFSYNOPSISDIV" 86 ><A 87 NAME="AEN1859" 88 ></A 89 ><H2 90 >Synopsis</H2 91 ><DIV 92 CLASS="FUNCSYNOPSIS" 93 ><A 94 NAME="AEN1860" 95 ></A 96 ><P 97 ></P 98 ><PRE 99 CLASS="FUNCSYNOPSISINFO" 100 >#include "SDL.h"</PRE 101 ><P 102 ><CODE 103 ><CODE 104 CLASS="FUNCDEF" 105 >SDL_Surface *<B 106 CLASS="FSFUNC" 107 >SDL_CreateRGBSurfaceFrom</B 108 ></CODE 109 >(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);</CODE 110 ></P 111 ><P 112 ></P 113 ></DIV 114 ></DIV 115 ><DIV 116 CLASS="REFSECT1" 117 ><A 118 NAME="AEN1866" 119 ></A 120 ><H2 121 >Description</H2 122 ><P 123 >Creates an SDL_Surface from the provided pixel data.</P 124 ><P 125 >The data stored in <TT 126 CLASS="PARAMETER" 127 ><I 128 >pixels</I 129 ></TT 130 > is assumed to be of the <TT 131 CLASS="PARAMETER" 132 ><I 133 >depth</I 134 ></TT 135 > specified in the parameter list. The pixel data is not copied into the <SPAN 136 CLASS="STRUCTNAME" 137 >SDL_Surface</SPAN 138 > structure so it should not be freed until the surface has been freed with a called to <A 139 HREF="sdlfreesurface.html" 140 >SDL_FreeSurface</A 141 >. <TT 142 CLASS="PARAMETER" 143 ><I 144 >pitch</I 145 ></TT 146 > is the length of each scanline in bytes. </P 147 ><P 148 >See <A 149 HREF="sdlcreatergbsurface.html" 150 ><TT 151 CLASS="FUNCTION" 152 >SDL_CreateRGBSurface</TT 153 ></A 154 > for a more detailed description of the other parameters.</P 155 ></DIV 156 ><DIV 157 CLASS="REFSECT1" 158 ><A 159 NAME="AEN1878" 160 ></A 161 ><H2 162 >Return Value</H2 163 ><P 164 >Returns the created surface, or <SPAN 165 CLASS="RETURNVALUE" 166 >NULL</SPAN 167 > upon error.</P 168 ></DIV 169 ><DIV 170 CLASS="REFSECT1" 171 ><A 172 NAME="AEN1882" 173 ></A 174 ><H2 175 >See Also</H2 176 ><P 177 ><A 178 HREF="sdlcreatergbsurface.html" 179 ><TT 180 CLASS="FUNCTION" 181 >SDL_CreateRGBSurface</TT 182 ></A 183 >, 184 <A 185 HREF="sdlfreesurface.html" 186 ><TT 187 CLASS="FUNCTION" 188 >SDL_FreeSurface</TT 189 ></A 190 ></P 191 ></DIV 192 ><DIV 193 CLASS="NAVFOOTER" 194 ><HR 195 ALIGN="LEFT" 196 WIDTH="100%"><TABLE 197 SUMMARY="Footer navigation table" 198 WIDTH="100%" 199 BORDER="0" 200 CELLPADDING="0" 201 CELLSPACING="0" 202 ><TR 203 ><TD 204 WIDTH="33%" 205 ALIGN="left" 206 VALIGN="top" 207 ><A 208 HREF="sdlcreatergbsurface.html" 209 ACCESSKEY="P" 210 >Prev</A 211 ></TD 212 ><TD 213 WIDTH="34%" 214 ALIGN="center" 215 VALIGN="top" 216 ><A 217 HREF="index.html" 218 ACCESSKEY="H" 219 >Home</A 220 ></TD 221 ><TD 222 WIDTH="33%" 223 ALIGN="right" 224 VALIGN="top" 225 ><A 226 HREF="sdlfreesurface.html" 227 ACCESSKEY="N" 228 >Next</A 229 ></TD 230 ></TR 231 ><TR 232 ><TD 233 WIDTH="33%" 234 ALIGN="left" 235 VALIGN="top" 236 >SDL_CreateRGBSurface</TD 237 ><TD 238 WIDTH="34%" 239 ALIGN="center" 240 VALIGN="top" 241 ><A 242 HREF="video.html" 243 ACCESSKEY="U" 244 >Up</A 245 ></TD 246 ><TD 247 WIDTH="33%" 248 ALIGN="right" 249 VALIGN="top" 250 >SDL_FreeSurface</TD 251 ></TR 252 ></TABLE 253 ></DIV 254 ></BODY 255 ></HTML 256 >