public Rect(Int2 _From, Int2 _To) { From = _From; To = _To; }
public RenderTarget(Int2 _Size) { rendertarget = new RenderTarget2D(Graphics.device, _Size.X, _Size.Y, 0, SurfaceFormat.Color); }
public TextureGPU(Int2 _Size) { size = _Size; texture = new Texture2D(Graphics.device, size.X, size.Y, Graphics.ImageMipLevelDepth, TextureUsage.None, SurfaceFormat.Rgba32); }
internal TextureGPU(Texture2D _Source) { texture = _Source; size = new Int2(texture.Width, texture.Height); }
public TextureGPU(string _FileName) { texture = Texture2D.FromFile(Graphics.device, _FileName); size = new Int2(texture.Width, texture.Height); }
public RenderTarget(Int2 _Size, SurfaceFormat _Format) { rendertarget = new RenderTarget2D(Graphics.device, _Size.X, _Size.Y, 0, (Microsoft.Xna.Framework.Graphics.SurfaceFormat)_Format); }
public static void Present(IntPtr _WindowHandle, Float2 _SourceRectFrom, Float2 _SourceRectTo, Int2 _TargetRectFrom, Int2 _TargetRectTo) { float w = device.PresentationParameters.BackBufferWidth; float h = device.PresentationParameters.BackBufferHeight; _SourceRectTo.X *= w; _SourceRectTo.Y *= h; _SourceRectFrom.X *= w; _SourceRectFrom.Y *= h; _SourceRectTo -= _SourceRectFrom; _TargetRectTo -= _TargetRectFrom; device.Present( new Rectangle((int)_SourceRectFrom.X, (int)_SourceRectFrom.Y, (int)_SourceRectTo.X, (int)_SourceRectTo.Y), new Rectangle(_TargetRectFrom.X, _TargetRectFrom.Y, _TargetRectTo.X, _TargetRectTo.Y), _WindowHandle); }
public static void Initialize(IntPtr _WindowHandle, Int2 _Resolution) { foreach (GraphicsAdapter adapter in GraphicsAdapter.Adapters) { Log.Write("Graphics", "Adapter found :", adapter.Description); } var parameter = new PresentationParameters(); parameter.BackBufferWidth = _Resolution.X; parameter.BackBufferHeight = _Resolution.Y; parameter.DeviceWindowHandle = _WindowHandle; device = new GraphicsDevice(GraphicsAdapter.DefaultAdapter, DeviceType.Hardware, _WindowHandle, parameter); //load default stuff defaultshader = ShaderCompiler.Compile(System.IO.File.ReadAllText("Default.fx")); }
public static void SetScissorRect(Int2 _From, Int2 _To) { device.ScissorRectangle = new Rectangle(_From.X, _From.Y, _To.X, _To.Y); }