Re: 大きな画像にシェーダを利用したい ( No.10 ) |
- 日時: 2011/01/09 21:01
- 名前: いっち
- と、なるとあやしいのは DrawPrimitive2D でしょうか?
以下のコードをテストして頂けますか?
#include "DxLib.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { ChangeWindowMode( TRUE ); if ( DxLib_Init( ) == -1 ) return -1; int width = 1024, height = 1024;
SetDrawValidGraphCreateFlag( TRUE ); int mgh = MakeGraph( width, height ); SetDrawValidGraphCreateFlag( FALSE );
FillGraph( mgh, 255, 0, 0 ); SetDrawScreen( mgh );
VERTEX2D Vert[6]; Vert[0].pos = VGet( 10.0f, 0.0f, 0.0f ); Vert[1].pos = VGet( (float)width, 0.0f, 0.0f ); Vert[2].pos = VGet( 10.0f, (float)height, 0.0f ); Vert[3].pos = VGet( (float)width, (float)height, 0.0f ); Vert[0].dif = Vert[1].dif = Vert[2].dif = Vert[3].dif = GetColorU8( 0, 0, 255, 255 ); Vert[0].u = 0.0f; Vert[0].v = 0.0f; Vert[1].u = 1.0f; Vert[1].v = 0.0f; Vert[2].u = 0.0f; Vert[2].v = 1.0f; Vert[3].u = 1.0f; Vert[3].v = 1.0f; Vert[0].rhw = Vert[1].rhw = Vert[2].rhw = Vert[3].rhw = 1.0f; Vert[4] = Vert[2]; Vert[5] = Vert[1]; DrawPrimitive2D( Vert, 6, DX_PRIMTYPE_TRIANGLELIST, DX_NONE_GRAPH, TRUE );
SaveDrawScreenToJPEG( 0, 0, width, height, "output.jpg", 90 ); DxLib_End( ); return 0; }
|
|