flat assembler
Message board for the users of flat assembler.

Index > Windows > DirectWrite

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
macomics



Joined: 26 Jan 2021
Posts: 819
Location: Russia
macomics 25 Aug 2022, 13:15
So fix it in your copy of PROC64.INC and no need to clog up the forum.

Here's another idea for fixing fastcall
Code:
macro fastcall name*, argc=rcx, argd=rdx, arg8=r8, arg9=r9, [args] { ...    
Post 25 Aug 2022, 13:15
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 25 Aug 2022, 13:36
I'm sure it is Tomasz's mistake. He made it for compatibility or some lazy reason. Or maybe I don't understand something that I want to understand, that why i'm here actually.
If you're not interested in reading my garbage, no one is forcing you to do that.
Post 25 Aug 2022, 13:36
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 28 Aug 2022, 10:29
Can I stretch my text to rectangle anyhow or do I need to use font size only?
Post 28 Aug 2022, 10:29
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 819
Location: Russia
macomics 28 Aug 2022, 11:29
You can also draw the desired text on the bitmap and then use the bitmap as a texture to fill the rectangle.
Post 28 Aug 2022, 11:29
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 28 Aug 2022, 11:55
Quote:

You can also draw the desired text on the bitmap and then use the bitmap as a texture to fill the rectangle.

I know that, also I can insert prerendered textures to project with text. But I want to study pure DirectWrite.
Maybe I can do something by layers?
Post 28 Aug 2022, 11:55
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 28 Aug 2022, 17:47
One more issue:
Code:
;this one seems ok,opacity works by txtBrushProperties but transform does nothing
cominvk pGuiD2D1Target,CreateSolidColorBrush,txtColor,\
                txtBrushProperties,pID2D1SolidColorBrush
cominvk pID2D1SolidColorBrush,QueryInterface,IID_ID2D1Brush,\
                pID2D1Brush
cominvk pID2D1Brush,SetOpacity,float dword 0.1f  ;Nothing, SetTransform too    
Post 28 Aug 2022, 17:47
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 29 Aug 2022, 11:24
My ID2D1Brush is not initialised correctly, any advice?
Post 29 Aug 2022, 11:24
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1617
Roman 29 Aug 2022, 17:50
Why need this ?
cominvk pID2D1SolidColorBrush,QueryInterface,IID_ID2D1Brush,\
pID2D1Brush


Code:
;only for 64 bits 
mov eax,1.0
movd xmm0,eax ;i not remember xmm0 or xmm1
movd xmm1,eax
cominvk pID2D1Brush,SetOpacity

; and set color brush
BrushClr  dd 1.0,0,0,0.5  ;last alpha
cominvk pID2D1Brush,SetColor,BrushClr 
    
Post 29 Aug 2022, 17:50
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 29 Aug 2022, 19:32
Quote:

Why need this ?

I know this is wrong but I need to initialise ID2D1Brush somehow. They provide different bunch of methods.
Code:
        interface               ID2D1SolidColorBrush,\
                                        QueryInterface,\
                                        AddRef,\
                                        Release,\
                                        SetColor,\
                                        GetColor
                                        
        interface               ID2D1Brush,\
                                        QueryInterface,\
                                        AddRef,\
                                        Release,\
                                        SetOpacity,\
                                        SetTransform,\
                                        GetOpacity,\
                                        GetTransform    

Actually I need ID2D1Brush only to try its SetTransform. Opacity works by previous one as I posted before.
I'm going to drop all of it to layer's settings as it is easiest solution. But current case still open, I want to understand why it reject to be done by own provided methods.
Post 29 Aug 2022, 19:32
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 30 Aug 2022, 02:01
Layers don't localise Transform settings
The only way Transform works for me is:
Code:
..data  DefaultTransform D2D1_MATRIX_3X2_F 1f,0,0,1f,0,0
cominvk pD2D1Target,SetTransform,txtBrushProperties.transform   ;required transformation
cominvk pD2D1Target,DrawText,txtBass,dword 3,[pIDWriteTextFormat],\
        txtBassLayout,[pID2D1SolidColorBrush],2,0
cominvk pD2D1Target,SetTransform,DefaultTransform    ;back to normal
    
Post 30 Aug 2022, 02:01
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 635
Location: Ukraine
Overclick 31 Aug 2022, 02:28
Good news, I fixed it. No need to initialise ID2D1Brush because it is included. All methods works well.
Code:
        interface               ID2D1SolidColorBrush,\
                                        QueryInterface,\
                                        AddRef,\
                                        Release,\
                                        GetFactory,\    ;from ID2D1Resource
                                        SetOpacity,\    ;from ID2D1Brush
                                        SetTransform,\  
                                        GetOpacity,\
                                        GetTransform,\
                                        SetColor,\      ;from ID2D1SolidColorBrush
                                        GetColor
    

SetTransform and GetTransform are ignored for ID2D1SolidColorBrush because they are provided for other brush types as I understand.
Post 31 Aug 2022, 02:28
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.