Enitalp

Members
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

1 Neutral

About Enitalp

  • Rank
    Newbie
  1. Hum all those brain and no one have an idea ?
  2. I'm a self-taugh programmer, but in was easier in my "time", started in 81 with an Apple 2 switched in 88 on an Atari ST, became an official Atari dev on Falcon and TT in 93 and since my first program i only worked on game mostly, Farcry 1, star wars, avatar, rainbow 6, farcry primal, farcry 5, to name a few ;p. Left school at 16, so my math is bad. But thanks to Internet if i need something, i just have to search for what i need. http://www.mobygames.com/developer/sheet/view/developerId,168167/ And i just started to learn DX11 and get more advanced in shaders.
  3. Hi all. I have a direct2d1 application with all my UI. And now i'm trying to insert 3d rendering in my UI. I tried a lot of thing as i'm new to that. and failed.... So my UI contain a control that is a 3d render. so stupidly i was thinking of making a 3d rendertarget, get the bitmap of that. and draw it at the place of my control. So i created this function public Bitmap1 CreateTarget(int i_Width, int i_Height) { Texture2DDescription l_Description = new Texture2DDescription(); l_Description.BindFlags = BindFlags.RenderTarget; l_Description.Format = m_BackBuffer.Description.Format; l_Description.Width = i_Width; l_Description.Height = i_Height; l_Description.Usage = ResourceUsage.Default; l_Description.ArraySize = 1; l_Description.MipLevels = 1; l_Description.SampleDescription = new SampleDescription(1, 0); l_Description.CpuAccessFlags = CpuAccessFlags.None; l_Description.OptionFlags = ResourceOptionFlags.None; Texture2D l_RenderTarget = new Texture2D(m_Device, l_Description); BitmapProperties1 properties = new BitmapProperties1() { PixelFormat = new PixelFormat(l_Description.Format, SharpDX.Direct2D1.AlphaMode.Premultiplied), BitmapOptions = BitmapOptions.Target, DpiX=96, DpiY = 96 }; Bitmap1 m_OffscreenBitmap; using (Surface l_Surface = l_RenderTarget.QueryInterface<Surface>()) { m_OffscreenBitmap = new Bitmap1(m_2DContext, l_Surface, properties); } return m_OffscreenBitmap; } And my control does a simple : if (m_OldSize != Size) { m_OldSize = Size; if (m_OffscreenBitmap != null) { m_OffscreenBitmap.Dispose(); } m_OffscreenBitmap = i_Param.CurrentWindow.CreateTarget(Size.Width, Size.Height); } i_Context.DrawContext2D.DrawBitmap(m_OffscreenBitmap, m_Rect, 1.0f, BitmapInterpolationMode.Linear); Here is my problem, if BitmapOptions is different from BitmapOptions = BitmapOptions.Target | BitmapOptions.CannotDraw i crash when creating my new Bitmap1 because of invalid params. and if i let it, i crash at present because : Additional information: HRESULT: [0x88990021], Module: [SharpDX.Direct2D1], ApiCode: [D2DERR_BITMAP_CANNOT_DRAW/BitmapCannotDraw], Message: Impossible de dessiner avec une bitmap qui a l’option D2D1_BITMAP_OPTIONS_CANNOT_DRAW. I must admit i'm out of idea. and i'm stuck. Please help. Does my method is totally wrong ? I tried to make my control owning is own 3d device so i can render that at a different pace than the 2d and did get the same result