目次 - API(機能別) - サーフェイスの生成と単純な描画 - SDL_CreateRGBSurfaceWithFormat
SDL_CreateRGBSurfaceWithFormat
既存のピクセルデータから新しいRGBサーフェイスを生成する
構文
SDL_Surface* SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format)
引数
flags | 現在は使われない. 常に0とすること. |
width | サーフェイスの幅 |
height | サーフェイスの高さ |
depth | サーフェイスのビット深度 |
format | サーフェイスのフォーマット |
戻り値
成功のとき生成されたSDL_Surface, 失敗のときNULLを戻す.
SDL_GetError()を呼んで詳細を知ることができる.
詳細
メモリを確保できなかったときはNULLを戻す.
バージョン
この関数はSDL 2.0.5以降で使える.
関連項目(関数)
SDL_CreateRGBSurfaceWithFormatFrom
SDL_FreeSurface
SDL Wikiへのリンク
SDL_CreateRGBSurfaceWithFormat - SDL Wiki