예제 #1
0
파일: Game.cs 프로젝트: Naronco/Rekd-Sharp
 public override void InitVars()
 {
     Init();
     Content = new ContentManager(Device);
     SpriteBatch = new SpriteBatch(Device, Content);
     Resources = new ResourceContainer();
     Resources.Load(Content);
 }
예제 #2
0
        public void Initialize()
        {
            Direct3D = new Direct3D();
            Device = new Device(Direct3D, 0, DeviceType.Hardware, dxViewport.Handle, CreateFlags.HardwareVertexProcessing, new PresentParameters(dxViewport.Width, dxViewport.Height));
            Device.SetTransform(TransformState.Projection, Matrix.OrthoLH(dxViewport.Width, dxViewport.Height, -1, 1));
            Device.SetRenderState(RenderState.AlphaBlendEnable, true);
            Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha);
            Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha);

            Content = new ContentManager(Device);
            spriteBatch = new SpriteBatch(Device, Content);

            Initialized = true;
        }