目次 - 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サーフェイスのビット深度
pitchpixelsの水平方向のバイト数
formatサーフェイスのフォーマット

戻り値

成功のとき生成されたSDL_Surface, 失敗のときNULLを戻す. SDL_GetError()を呼んで詳細を知ることができる.

詳細

メモリを確保できなかったときはNULLを戻す.

バージョン

この関数はSDL 2.0.5以降で使える.

関連項目(関数)

SDL_CreateRGBSurfaceWithFormat
SDL_FreeSurface

SDL Wikiへのリンク

SDL_CreateRGBSurfaceWithFormatFrom - SDL Wiki