Original Post
me are new to DirectX9. to start my first C# DirectX9 2D application me have grab a tutorial from MSDN WebCast which a project call "StarTrooper". by following the tutorial from start to end, me have success to create my first 2D snake game with Direct3D.Sprite class. but there have few quetion are confusing me. me have did a 2D application with DirectX8 DirectDraw and VB6 long long time ago. as me memorized, in DirectDraw we have to create a device(same to Direct3D now) and 2 Surface(one for the primary Surface and another for the backbuffer), after we draw on the backbuffer and flip it to primary surface. but which in "StarTrooper", me cant found any called "backbuffer". here my code is it Direct3D.Sprite already handle the "backbuffer" automatically? thanks a lot and sorry for my poor english. [Edited by - tlc660 on August 19, 2006 11:09:10 AM]
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.DeviceWindow = myGameWin;
presentParams.PresentationInterval = PresentInterval.Immediate;
device = new Device(0, DeviceType.Hardware, myGameWin, CreateFlags.HardwareVertexProcessing, presentParams);
Sprite scene = new Sprite(device);
device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0);
device.BeginScene();
scene.Begin(SpriteFlags.AlphaBlend);
// my render code here
scene.End();
device.EndScene();
device.Present();