Print Page | Close Window

Direct2D

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=12642
Printed Date: 28 April 2024 at 1:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Direct2D
Posted By: ABuenger
Subject: Direct2D
Date Posted: 08 November 2008 at 6:47am
Any plans to use Direct2D in the toolkit? Sounds much better than GDI+ rendering for markup.

CXTPGraphicBackendGDI
CXTPGraphicBackendGDIplus
CXTPGraphicBackendD2D



http://blogs.technet.com/thomasolsen/default.aspx - http://blogs.technet.com/thomasolsen/default.aspx



-------------
Codejock support



Replies:
Posted By: Oleg
Date Posted: 10 November 2008 at 2:35am

Hi,

Are you ready to ask all your customers install DirectX10.1 to allow run your application ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ABuenger
Date Posted: 10 November 2008 at 5:55am
Hi Oleg,

therefore different backends. If Direct2D is not available then fallback to GDI or GDI+.

Direct2D will also run on DirectX9 hardware.


class CXTPGraphicBackend
{
   virtual DrawLine(...) = 0;
};

class CXTPGraphicBackendGDI
{
   virtual DrawLine(...)
    {
       pDC->MoveTo(...);
       pDC->LineTo(...);
    }
};

class CXTPGraphicBackendD2D
{
   virtual DrawLine(...)
    {
       ...
    }
};



-------------
Codejock support


Posted By: evoX
Date Posted: 10 November 2008 at 10:33am
Vista is already based on DirectX, maybe when the next version of windows will be released, and Microsoft will no longer offer support for XP, then you should move to DirectX


Posted By: ABuenger
Date Posted: 10 November 2008 at 10:35am

http://channel9.msdn.com/pdc2008/PC18/ - Windows 7: Introducing Direct2D and DirectWrite





-------------
Codejock support


Posted By: Oleg
Date Posted: 10 November 2008 at 11:27am

Hi,

Another problem that we can't ask all our customers install DirectX SDK to allow compile toolkit.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ABuenger
Date Posted: 10 November 2008 at 11:41am
Sorry Oleg,

but I don't take this argument.

a) It would be ok to ask developers to install the latest Windows SDK!

b) You could integrate required files into the toolkit

c) You could make a compile switch / configurations

d) You could make the graphic backends as separate dll's, or at least the Direct2D one. What would be wrong with a xtp1210d2d.dll ?

I would vote for option d)
- Build separate Direct2D graphic backend DLL (requires latest Windows / DirectX SDK)
- Load DLL at runtime
- Set backend



-------------
Codejock support


Posted By: evoX
Date Posted: 10 November 2008 at 11:47am
I don't mind installing the DirectX SDK.
 


Posted By: jimmy
Date Posted: 11 November 2008 at 9:07am
Hello,

Does this also work with Win98 ?
Because we MUST support this.

  Jimmy



Posted By: ijwelch
Date Posted: 11 November 2008 at 10:08am
What advantage to CJ products other than speed (which IMO is ok now anyway)?


Posted By: ABuenger
Date Posted: 11 November 2008 at 10:13am
Originally posted by jimmy jimmy wrote:

Hello,

Does this also work with Win98 ?
Because we MUST support this.

  Jimmy



Direct2D will be Vista/Win7 and maybe XP only. So under Win98 you'll have to fallback to GDI drawing.



-------------
Codejock support


Posted By: ABuenger
Date Posted: 11 November 2008 at 10:15am
Originally posted by ijwelch ijwelch wrote:

What advantage to CJ products other than speed (which IMO is ok now anyway)?


Watch the PDC presentation.

Better quality and speed, text rotation with DirectWrite etc.

While I agree that the performance of most of the controls is ok markup rendering with GDI+ suffers from the lack of performance of GDI+ software rendering. Direct2D is about 4 times faster than GDI+, so any charts etc. based on markup rendering will be significantly faster.



-------------
Codejock support


Posted By: jimmy
Date Posted: 11 November 2008 at 10:44am
Sure,

will be nice to have a own Draw Interface.

XTPDrawer()
  .DrawText(...)
  .DrawMultiline
  .DrawGradient ......

without known about the background drawing machine.
And all painting run over this interface.

  Jimmy



Posted By: ABuenger
Date Posted: 11 November 2008 at 11:14am
Originally posted by jimmy jimmy wrote:

Sure,

will be nice to have a own Draw Interface.

XTPDrawer()
  .DrawText(...)
  .DrawMultiline
  .DrawGradient ......

without known about the background drawing machine.
And all painting run over this interface.

  Jimmy



Exactly

Currently the control logic, rendering and theming are not well separated.

If the code would be separated well it would just be a matter of a new graphic backend to port the markup rendering to a new platform like Android or the iPhone. Instead Codejock tightly binds its business modell to aging technologies like MFC and ActiveX while not being able to deliver WinForms and WPF controls + new emerging platforms. Heck, not even a CE / Windows mobile version of the toolkit. Instead they conjure up excuses why they can't adopt new technologies like Direct2D.



-------------
Codejock support


Posted By: Oleg
Date Posted: 11 November 2008 at 3:27pm
Actually its how it works now:
 
void CXTPMarkupDrawingContext::DrawTextLine(LPCWSTR lpszText, UINT nCount, LPCRECT lpRect)
{
 m_pDeviceContext->DrawString(lpszText, nCount, lpRect);
}
and there is CXTPMarkupDeviceContext + CXTPMarkupGdiPlusDeviceContext.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ABuenger
Date Posted: 11 November 2008 at 4:52pm
Hello Oleg,

CXTPMarkupDeviceContext is tightly bound to MFC/GDI (HDC, CRect, etc.), so it is not an abstract interface.

CXTPMarkupGdiPlusDeviceContext is derived from CXTPMarkupDeviceContext.

CXTPMarkupDrawingContext uses either CXTPMarkupDeviceContext or CXTPMarkupGdiPlusDeviceContext, but is itself bound to a HDC, so not yet ready for Direct2D.

There is only a #define _XTP_EXCLUDE_GDIPLUS to decide at compile time if we want GDI or GDI+, that should be setable at runtime. What if I want GDI+ only for a single control but not for an other? There should be a default renderer as well as the option to set any renderer for any markup.

CXTPMarkup::SetDefaultRenderer(...);
pMarkup->SetRenderer(...);



-------------
Codejock support


Posted By: JerryEvans
Date Posted: 21 November 2008 at 7:14am
I'd have to agree - it would be nice to specify the graphics engine. I'd like to be able to use AGG2D for example.

One thing worth noting with GDI+ - you will disappoint clients who run your software on Linux using WINE. The WINE project has not ported GDI+ - indeed is unlikely to do so as GDI+ is sort of an evolutionary dead end.


Posted By: Tomasz
Date Posted: 21 November 2008 at 9:29pm
Precisely!
MANY our customers run our applications using WINE, or Parallels (on Mac). For them, all that new things just cause compatiblity problems. As far as I am concerned, I will stop buying upgrades to XTP once Codejock starts making library incompatible with older windows/WINE/Parallels. MFC may be old but it is working, fast and compatible with everything. If somebody loves all newest and slow stuff, just use this bloated .NET.



Posted By: evoX
Date Posted: 23 November 2008 at 11:57am
I think it's important for codejock to bring more customers even if a few will no longer make upgrades, it's better to lose 1 customer and win 10 new.

-------------
Product: Xtreme ToolkitPro 19.30
Platform: Windows 10 64bit
Language: Visual C++ (VS 2019)


Posted By: WaLtI
Date Posted: 28 December 2009 at 8:30am

I have posted a Direct2D render for Markup here http://forum.codejock.com/forum_posts.asp?TID=15926 - http://forum.codejock.com/forum_posts.asp?TID=15926 .




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net