public unsafe RenderTarget CreateRenderTarget(int w, int h) { Texture2d tex = null; var rt = new RenderTarget(this, ResourceIDs.Alloc(ResourceIdManager.EResourceType.RenderTarget), tex); int id = rt.Id.ToInt32(); RenderTargetWrapper rtw = new RenderTargetWrapper(this); rtw.Target = rt; ResourceIDs.Lookup[id] = rtw; return(rt); }
public IGraphicsControl Internal_CreateGraphicsControl() { var ret = new GLControlWrapper_GdiPlus(this); //create a render target for this control RenderTargetWrapper rtw = new RenderTargetWrapper(this); rtw.Control = ret; ret.RenderTargetWrapper = rtw; return(ret); }
public unsafe RenderTarget CreateRenderTarget(int w, int h) { GDIPTextureWrapper tw = new GDIPTextureWrapper(); tw.SDBitmap = new Bitmap(w, h, sdi.PixelFormat.Format32bppArgb); var tex = new Texture2d(this, tw, w, h); RenderTargetWrapper rtw = new RenderTargetWrapper(this); var rt = new RenderTarget(this, rtw, tex); rtw.Target = rt; return(rt); }
public void BindRenderTarget(RenderTarget rt) { if (CurrentRenderTargetWrapper != null) { if (CurrentRenderTargetWrapper == CurrentControl.RenderTargetWrapper) { //dont do anything til swapbuffers } else CurrentRenderTargetWrapper.MyBufferedGraphics.Render(); } if (rt == null) { //null means to use the default RT for the current control CurrentRenderTargetWrapper = CurrentControl.RenderTargetWrapper; } else { CurrentRenderTargetWrapper = RenderTargetWrapperForRt(rt); if (CurrentRenderTargetWrapper.MyBufferedGraphics == null) CurrentRenderTargetWrapper.CreateGraphics(); } }
public IGraphicsControl Internal_CreateGraphicsControl() { var ret = new GLControlWrapper_GdiPlus(this); //create a render target for this control RenderTargetWrapper rtw = new RenderTargetWrapper(this); rtw.Control = ret; ret.RenderTargetWrapper = rtw; return ret; }
public unsafe RenderTarget CreateRenderTarget(int w, int h) { TextureWrapper tw = new TextureWrapper(); tw.SDBitmap = new Bitmap(w,h, sdi.PixelFormat.Format32bppArgb); IntPtr texid = GenTexture(); ResourceIDs.Lookup[texid.ToInt32()] = tw; var tex = new Texture2d(this, texid, null, w, h); var rt = new RenderTarget(this, ResourceIDs.Alloc(ResourceIdManager.EResourceType.RenderTarget), tex); int id = rt.Id.ToInt32(); RenderTargetWrapper rtw = new RenderTargetWrapper(this); rtw.Target = rt; ResourceIDs.Lookup[id] = rtw; return rt; }
public unsafe RenderTarget CreateRenderTarget(int w, int h) { TextureWrapper tw = new TextureWrapper(); tw.SDBitmap = new Bitmap(w,h, sdi.PixelFormat.Format32bppArgb); var tex = new Texture2d(this, tw, w, h); RenderTargetWrapper rtw = new RenderTargetWrapper(this); var rt = new RenderTarget(this, rtw, tex); rtw.Target = rt; return rt; }
public void BindRenderTarget(RenderTarget rt) { if (rt == null) { //null means to use the default RT for the current control CurrentRenderTargetWrapper = CurrentControl.RenderTargetWrapper; } else { CurrentRenderTargetWrapper = RenderTargetWrapperForRt(rt); } }
public unsafe RenderTarget CreateRenderTarget(int w, int h) { Texture2d tex = null; var rt = new RenderTarget(this, ResourceIDs.Alloc(ResourceIdManager.EResourceType.RenderTarget), tex); int id = rt.Id.ToInt32(); RenderTargetWrapper rtw = new RenderTargetWrapper(this); rtw.Target = rt; ResourceIDs.Lookup[id] = rtw; return rt; }
public void Release(RenderTargetWrapper renderTarget) { TemporaryRenderTargets.Add(renderTarget); }