News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Direct2D ?

Started by K_F, June 13, 2013, 11:59:50 PM

Previous topic - Next topic

K_F

Does anyone have any INC or LIB files on Direct2D ?
Thanks
:)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

TouEnMasm


http://msdn.microsoft.com/en-us/library/windows/desktop/dd370994(v=vs.85).aspx

d2d1.h and d2d1.lib  (windows sdk)
Sorry but there is interfaces who are not translated by the "ready to use sdk".
Must have a special prototype or somethong else.I will have a look.
Fa is a musical note to play with CL

qWord

Quote from: K_F on June 13, 2013, 11:59:50 PM
Does anyone have any INC or LIB files on Direct2D ?
see Japheth's WinInc.
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm

Here the d2d1.sdk with all the needed declarations.
just replace the one here:
http://masm32.com/board/index.php?topic=563.msg4563#msg4563
Quote
see Japheth's WinInc. ??????????     no d2d1 here

You need to download the dll d2d1.dll the lib is in the windows sdk
Fa is a musical note to play with CL

K_F

Thank you .. kind sirs/madams
:t
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'

qWord

#5
Quote from: ToutEnMasm on June 14, 2013, 04:35:44 AM
Quote
see Japheth's WinInc. ??????????     no d2d1 here ?
I simply forget that I've add my own translation years back.

In the attachment the DEF-file, the library and include files that can be used with WinInc (and of course a small -it-does-somehow-work-example-).
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm

Bad chance
running direct2d "_ftol2 entry point not found in msvcrt.dll"
trying to recompile
bad chance
couldn't find inknown.inc in d2di.inc follow a list of include files:
Quote
   include unknwn.inc
   include dcommon.inc
   include D2DErr.inc
   include D2DBaseTypes.inc
   include dxgiformat.inc

Quote
From what I understand, ftol2 is a new function in VC 7 used
to convert floats to integers, and replaces ftol in VC 6.
no need of windows 7 for that.

Fa is a musical note to play with CL

qWord

yep, there were two files missing  :icon_cool:
(see previous post)
MREAL macros - when you need floating point arithmetic while assembling!

qWord

Quote from: ToutEnMasm on June 14, 2013, 02:50:59 PM
Bad chance
running direct2d "_ftol2 entry point not found in msvcrt.dll"
the executable does not import msvcrt.dll...

Quote from: ToutEnMasm on June 14, 2013, 02:50:59 PMcouldn't find inknown.inc
the file unknwn.inc comes with WinInc.

BTW: D2D requires Windows Vista SP2, Win7/8,...
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm


Quote
the executable does not import msvcrt.dll...
This import is in the dll,and the executable need it

Quote
IMPORTS for d2d1.dll
    msvcrt.dll
              330010FC Import Address Table
              33063464 Import Name Table
              FFFFFFFF time date stamp
              FFFFFFFF Index of first forwarder reference

      6FF59BA1    194 _ftol2
      6FF5EEC0     47 _CIsqrt
      6FF59E3A    195 _ftol2_sse
      6FF60EB1     41 _CIfmod
      6FF6112D    2EB _onexit
      6FF5D1A8    3C8 _vsnprintf
      6FFBB2EF    101 _amsg_exit
      6FF5C151    1D5 _initterm
      6FF7DC75     6A _XcptFilter
      6FF5A449    242 _lock
      6FF5F509     8D __dllonexit
      6FF5A42D    3A6 _unlock
      6FF59790    4EE memset
      6FF59CEE    4DE malloc
      6FF5B10D    4FF realloc
      6FF59894    4A6 free
      6FF59E5A    4EC memmove
      6FF59DF1    177 _finite
      6FF59E12    220 _isnan
      6FF73E27    159 _except_handler4_common
      6FFB6EA9    2FC _purecall
      6FF78A22     48 _CItan
      6FF59910    4EA memcpy
      6FF5F95F    49B floor
      6FF75A24     3D _CIatan2
      6FF5EF16     3E _CIcos
      6FF759E4     45 _CIsin
Fa is a musical note to play with CL

qWord

Quote from: ToutEnMasm on June 14, 2013, 03:31:00 PM

Quote
the executable does not import msvcrt.dll...
This import is in the dll,and the executable need it
yes, but that is not my problem - you might repair your windows installation.
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm


The _ftol2 is not in windows XP,it's a not a defaut of my system.It is only in the msvcrt.dll of win7.
i try to compile your source:
Direct2D.obj : error LNK2001: unresolved external symbol _DEFINE_ENUM_FLAG_OPERATORS@4

It is used as this in your source:

E:\image2d\d2d1.INC
73 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_DRAW_TEXT_OPTIONS
198 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_PATH_SEGMENT
249 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_LAYER_OPTIONS
265 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_WINDOW_STATE
284 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_RENDER_TARGET_USAGE
291 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_PRESENT_OPTIONS
312 : DEFINE_ENUM_FLAG_OPERATORS proto  :D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS

Perhaps a little help ?

Fa is a musical note to play with CL

qWord

I used jWasm, which is obviously more tolerant .... I've comment out all that invalid DEFINE_ENUM_FLAG_OPERATORS prototypes.
However, for MASM (I'm using version 10) there is still the problem with the prototype bug (if a prototype occurs in an (macro-)expression that is evaluated, MASM adds an useless EXTERNAL-entry to the object file). Therefore I would suggest to use jWasm instead of MASM, even if the modified source is buildable with MLv10.

I've update the attachment in my above post.
MREAL macros - when you need floating point arithmetic while assembling!

TouEnMasm


I find this :Why direct2d is patently ridiculous
http://braid-game.com/news/2009/01/a-demonstration-that-direct2d-is-patently-ridiculous/

I don't give my opinion on the subject.I find it enough ridiculous to not work with XP only for convert a real to an integer.
Fa is a musical note to play with CL

qWord

Quote from: ToutEnMasm on June 14, 2013, 11:26:23 PMI find it enough ridiculous to not work with XP only for convert a real to an integer.
Who said that this is the only reason? Did you copy over the d2d1 DLL an expect that it simply works?
MREAL macros - when you need floating point arithmetic while assembling!