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