Exemplo n.º 1
0
 public override void InitVars()
 {
     Init();
     Content = new ContentManager(Device);
     SpriteBatch = new SpriteBatch(Device, Content);
     Resources = new ResourceContainer();
     Resources.Load(Content);
 }
Exemplo n.º 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;
        }