(※当初、掲載していたプログラムは一部ミスが有ったの修正しました) 今回はiPhoneでテクスチャ(アルファ付き、無しの両方)を使用する方法を解説します。 iPhoneのプログラムのglDrawArrays()を使ったものとglDrawElements()を使ったサンプルを準備しました。こちらを確認しながら読み進めて下さい。 Mac版のプログラムはこちらを参照して下さい。 ブレンド関数の設定とブレンド処理の有効化 今回はアルファ値を含んだテクスチャを使用するためセットアップ処理の部分で以下の記述を追加します。 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); テクスチャファイルの読み込み テクスチャファイルは NSImage を使い、PNGファイルを読み込んでmallocで確保したメモリ上に展開して