Graphics screens are not displayed in Windows 10 Japanese environment

Windows specific questions.
Makoto WATANABE
Posts: 196
Joined: Apr 10, 2010 11:41
Location: Japan
Contact:

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby Makoto WATANABE » Oct 22, 2020 4:59

Dear adeyblue

Thank you for your efforts in investigating the problem in the Japanese language environment.

As you have identified, the cause is "Microsoft IME" (an application that converts keystrokes to Japanese characters).
I temporarily changed the IME to "Google IME".
Then the FreeBASIC graphic screen appeared without any problems in the Japanese environment !
However, "Google IME" is not as popular and not as easy to use as "Microsoft IME", so I would like to continue using "Microsoft IME".
adeyblue
Posts: 48
Joined: Nov 07, 2019 20:08

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby adeyblue » Oct 22, 2020 21:17

Go to your fbc/lib/win32 directory, rename the libfbgfx.a and libfbgfxmt.a files and copy the ones from this zip in.

http://www.airesoft.co.uk/files/temp/libfbgfx.zip

Compile the program again, switch back to the other IME and see what happens!

If it's still not working, there won't be a window now so it'll look like nothing is happening. Wait 10 seconds and a message box will pop up and clicking OK will terminate the program

If you see the message box, can you do another dump before you click OK? Thanks.
Makoto WATANABE
Posts: 196
Joined: Apr 10, 2010 11:41
Location: Japan
Contact:

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby Makoto WATANABE » Oct 23, 2020 14:30

Dear adeyblue

I am surprised and cheerfully pleased.
In the "Microsoft IME" environment, the graphics screens are now displayed not only in GDI but also in DirectX.

The output screen of GFX_Font-Test1.bas.
Image

The following string was displayed in "error.txt".
    Caught exception of type 0x40010006 at 74E44662\n

dodicat's "terminal velocity sim (Rocket Science or a bad Hair Day)" was also displayed.
https://www.freebasic.net/forum/viewtopic.php?f=7&t=19341#p170576
Image

As a representative of FreeBASIC fans in Japan, I would like to thank you for your efforts.
MrSwiss
Posts: 3726
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby MrSwiss » Oct 23, 2020 16:21

Makoto WATANABE wrote:In the "Microsoft IME" environment, the graphics screens are now displayed not only in GDI but also in DirectX.
Which seems to confirm my earlier conclusion:
MrSwiss wrote:(The only conclusion concerning FB so far is, that the GFX-drivers are of no consequence here.)

However:
Makoto WATANABE wrote:The following string was displayed in "error.txt". Caught exception of type 0x40010006 at 74E44662\n
Seems to indicate, that there is still a sort of 'race condition'.
0x40010006 = ERROR_INVALID_HANDLE
Since in WIN, a Handle is a Any Ptr (in FB), it seems to be called, before it is properly initialized.

BTW: have you tried both compiler versions 32 & 64 so far?
(with the latest version of FBC 1.08.dev, the default GFX-driver should be "Direct2D")
MrSwiss
Posts: 3726
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby MrSwiss » Oct 23, 2020 16:37

In order to check GFX-driver "used" either default or forced use the following snippet:

Code: Select all

' GFX-driver_DEMO1.bas -- (c) 2020-10-19, MrSwiss
'
' ATTENTION: requires the latest build of FBC 1.08.dev, 2020-10-19 or later!
'
' compile: -s gui                       ' WIN only
'

'#Define ForceDriver                     ' comment out to see 'default driver'

Const As UShort scr_w = 320, scr_h = 240, _             ' screen definitions
                mxw = scr_w - 1, mxh = scr_h - 1, _     ' don't ever change
                scr_cd = 32, scr_pg = 2, scr_flg = 64   ' bpp, pages, flags
Const As ULong  black = &hFF000000, white = &hFFFFFFFF  ' colors

' ===== GFX-driver DEMO1 =====
#Ifdef ForceDriver
    ScreenControl(103, "Direct2D")      ' 103 = FB.SET_DRIVER_NAME
#EndIf  ' ForceDriver

ScreenRes(scr_w, scr_h, scr_cd, scr_pg, scr_flg)
ScreenSet(1, 0)
WindowTitle "GFX-driver DEMO1 ---> click [X] to EXIT program"
Color(black, white) : Cls               ' black on white background
Width scr_w \ 8, scr_h \ 16             ' large Font: 8 x 16

Dim As String   vdrv                    ' screen backend driver
ScreenInfo(,,,,,, vdrv)                 ' get GFX driver name

#Ifdef ForceDriver
    vdrv += " -- forced!"
#Else
    vdrv += " -- default"
#EndIf  ' ForceDriver
' string output at center/center position
Draw String (mxw Shr 1 - Len(vdrv) * 4, mxh Shr 1 - 8), vdrv
Flip

Sleep
' ===== End GFX-driver DEMO1 =====
adeyblue
Posts: 48
Joined: Nov 07, 2019 20:08

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby adeyblue » Oct 24, 2020 3:10

Makoto WATANABE wrote:Dear adeyblue

I am surprised and cheerfully pleased.
In the "Microsoft IME" environment, the graphics screens are now displayed not only in GDI but also in DirectX.


Yay, we did it! Isn't it amazing the things we can achieve with a little knowledge and a bit of work as opposed to random guesses. How are your fonts by the way, are they well? :-)

I did notice the remaining error, it's not anything serious by itself, it means something is trying to send a message to a debugger. It requires extra software to see what the message is. As things seem to be ok now though, it can probably be investigated later, if you have any more troubles.
Makoto WATANABE
Posts: 196
Joined: Apr 10, 2010 11:41
Location: Japan
Contact:

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby Makoto WATANABE » Oct 24, 2020 3:41

Dear MrSwiss

Thank you for accurately isolating the phenomenon and clarifying the cause and effect of this problem.

In FreeBASIC1.08 32 WIP, after applying adeyblue's improvement program, DirectX is displayed by default, and GDI is displayed when GDI is specified.
Image
Image

In FreeBASIC1.08 64 WIP, DirectX was displayed, but when I specified GDI, no characters were displayed and the white screen was disappeared immediately.

Code: Select all

' Sets the graphics method GDI
SetEnviron("fbgfx=GDI")

Image

Is this the expected behavior?
MrSwiss
Posts: 3726
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Graphics screens are not displayed in Windows 10 Japanese environment

Postby MrSwiss » Oct 24, 2020 15:12

Makoto WATANABE wrote:Is this the expected behavior?
Yes and No:
Yes, in FBC64 since adeyblue so far only fixed the 32 bit version of M$ IME.
DirectX is displayed by default
No, look again, its Direct2D (your own posted first pic), new in FBC 1.08.

No, by the fact that you've mixed in code from others like: fxm (don't do that for tests ever).
This is not required nor wanted since it likely falsifies expected results.
In case you don't understand the code, rather ask for 'how to use it'.

Test code usage:
In the test code there is a 'commented out' #Define ForceDriver pre-processor statement.
This, if left "as-is" shows always the default driver (without modification).

Force another, than default driver:
If you 'uncomment' above, you can change the 'user selected forced driver': GDI, DirectX or Direct2D,
by simply specifying it in the command ScreenControl():

Code: Select all

' ===== GFX-driver DEMO1 =====
#Ifdef ForceDriver
    ScreenControl(103, "Direct2D")      ' 103 = FB.SET_DRIVER_NAME
    'ScreenControl(103, "DirectX")
    'ScreenControl(103, "GDI")
#EndIf  ' ForceDriver
Only ever leave one of the three above 'uncommented' at the time.
Alternative: just change the 'string literal' within the statement.
Recompile/Run (suggestion: use "quick run" in the IDE).

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 5 guests