• Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About LarsKJ

  • Rank
  1. To whom it might concern: It seems that I have to answer my own question. I added the missing TextFormat.SetTrimming as follows: TextFormat.h Result SetTrimming(Trimming trimming, InlineObject ^trimmingSign); TextFormat.cpp Result TextFormat::SetTrimming(SlimDX::DirectWrite::Trimming trimming, InlineObject ^trimmingSign) { return RECORD_DW(InternalPointer->SetTrimming(reinterpret_cast<DWRITE_TRIMMING *>( &trimming ), trimmingSign->InternalPointer)); } I hope this small contribution can be made part of the official SlimDX distribution, both as a benefit for other users and also to ourselves to avoid the extra custom build in the future. Best Regards Lars Krog-Jensen
  2. Hello, I am rewriting an application and replacing Win7ApiCodePack/DirectX with SlimDX but I cannot find a DirectWrite TextFormat.SetTrimming(..) method, or is this accomplished some other way with SlimDX. Best Regards Lars Krog-Jensen
  3. Josh: From within the app's diagnostics monitor I am looking at: long total = Process.GetCurrentProcess().PrivateMemorySize64; long managed = GC.GetTotalMemory(false); long unmanaged = total - unmanaged; The task managers 'Private Working Set' shows the same as total above. For video memory usage on XP I am using 'Video Memory Watcher', does not work on Windows 7 Adam_42: Sounds reasonable, but on the other hand - when running the exact same app with a D2D (DX10) renderer layer I would expect it show the same memory usage pattern - but it does not, not even close. Lars
  4. When using DirectX9 devices on Windows Vista and Windows 7 it seems to allocate alot of system ram. The exact same app on XP is consuming video memory, but hardly any system ram at all - as I would expect. Same app running with a Direct2D render layer on Windows 7 is consuming very little system ram. Should say that it is not on the managed heap, and thus the unmanaged heap. Anyone knows if this behavior is expected due to some changes i Windows 7? Regards Lars
  5. I have built a datagrid with SlimDX and Direct2D/DirectWrite that I am trying to make scrolling smoother and faster. When scrolling I would like to avoid repainting the entire scene and only push a certain area of the existing scene upwards or downwards, and then only paint the new rows. I don't want to move the entire scene as the header should remain fix. The part that I do not know how to handle is how to make a rectangle and move it. Anyone has a suggestion that is performant.
  6. Quote: Even with man different texts using a TextLayout is a good practice. But there are really a lot of different, although short, text messages that is drawn and if I would hold all those it would consume alot CPU RAM for the TextLayout cache and guess the TextLayout consumes some memory on the GPU aswell. I could of course have size bound cache that starts evict items after a while, but it feels like a work around of the real problem that is to get the GPU doing more of the work and free up the CPU for other tasks.
  7. Hi I have a question regarding DirectWrite/Direct2D text rendering performance that I cannot get to perform as good as I want/expected. We have built a market data 'realtime' datagrid using different rendering strategies depending on OS version, available HW and user preferences. I have built a DirectX9, Direct2D/DirectWrite and a GdiPlus strategy. All those works fine and the DirectX9 version is the clear performance leader, which is using the Direct3D Font that to my knowledge is using GDI behind the scenes to rasterize the text before being sent to the GPU. This performs OK. When first heard of DirectWrite is was supposed to be all in HW, but this seems not to be true, when profiling the majority of the CPU time is spent in the WindowRenderTarget.DrawText. I have experimented with the different settings to get it perform better, but with no success. In fact; DirectWrite performs worse than the GdiPlus rendering strategy. (Perhaps I should say that the GdiPlus strategy is drawing to a BufferedGraphics that is in turn is using GDI to BitBlt the back buffer, so it is kind of HW accelerated) Does anyone have some information regarding how to make DirectWrite perform optimal and if it using the CPU to rasterize the fonts. The application is displaying a lot of different text, so reusing a TextLayout is not an option. The only downside of the DirectX9 strategy is that it seems to allocation huge amount of RAM, a trading desktop might have hundreds of different windows displaying different data - so it is a problem as well. I would be really grateful if someone would share their knowledge on this. Regards Lars
  8. Hi I am using SlimDX D2D and are trying to convert a Bitmap (D2D)to PNG image that I can store to file. Does anyone know how to do this? Best Regards Lars Krog-Jensen
  9. Hello, I am prototyping a high performance datagridview with Direct2D/DirectWrite, which draws /alot/ of text. This works very nicely but there are one scenario that I would like to enhance and that is when a new row is added in the top of the data. I would like to 'push' all existing rows (content) by a small offset (RowHeight), and only draw my new row at the top. Now I have to repaint the entire render target and this involve as alot of memcopy from system memory to GPU memory. Anyone got a idéa how to this can be done whith Direct2D. I tried to draw textlayout, but as there are a lot of different text this will probably eat up the gpu memory quickly. Regards Lars