FreeBASIC 1.08.0 Release Discussion (June 2021)

For other topics related to the FreeBASIC project or its community.
coderJeff
Site Admin
Posts: 3539
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby coderJeff » Jun 06, 2021 14:48

UEZ wrote:The problem I discovered is only for Win7 - Win10 seems to work properly.

ok, confirmed. Here's what I think is happening:

On Win10, both the window and the display surface (RenderTarget) are scaled by the system DPI - for me,this happens for all older non-DPI aware applications by default . And with fbc in all graphics drivers Direct2D, DirectX, & GDI. All three of these drivers work for me on Win7 and Win10.

On Win7, the display surface is not scaled by the system DPI for Direct X or GDI,. Only in the Direct2D driver the display surface is scaled by the system DPI. However, in all 3 cases the window is the same size.
- One possible fix is to add a ID2D1RenderTarget_SetDpi( pRenderTarget, 96, 96 ); to force scaling to 100% on the render target.
- Result to expect is that will get no scaling on Win7 and default DPI scaling on Win10. Because even though we force scaling to 100% in the program, win10 will still scale it to 125% / 150% just like all the other non-DPI aware programs.

I suspect this is a bug or at the very least a difference in Windows(tm) 7. Not sure the results if the application is manifested with DPI awareness info and the SetDPI() call used if it would mess with scaling.
D.J.Peters
Posts: 8301
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby D.J.Peters » Jun 06, 2021 17:38

In FreeBASIC 1.08.0 windows gcc-8.1 release in folder bin/win64 "gdb.exe" and "zlib1.dll" are missing.

How ever thank you all for the hard work to make the 1.08.0 release :-)

Joshy

EDIT: gcc-9.3 both win32/64 gdb are missing !
coderJeff
Site Admin
Posts: 3539
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby coderJeff » Jun 06, 2021 20:18

D.J.Peters wrote:"gdb.exe" and "zlib1.dll" are missing.

Oh shoot. Looks I missed on consistency between the packages to include gdb. In some cases I see it's a bug in the release script. Maybe I can do a little add on package some time later.

Also, I meant to follow-up on marcov's post in FreeBASIC 1.08 Development and forgot all about it due other stuff going on at the time. I didn't yet evaluate what gdb to send with the packages.

From Lazarus Project:
- 32-bit Alternative GDB
- 64-bit Alternative GDB

The special build of gdb-9.2 with unicode support uploaded only recently on May 28 sounds interesting.
srvaldez
Posts: 2734
Joined: Sep 25, 2005 21:54

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby srvaldez » Jun 07, 2021 14:12

thank you coderJeff :-)
angros47
Posts: 1890
Joined: Jun 21, 2005 19:04

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby angros47 » Jun 07, 2021 23:32

I started experimenting with the new version, and the FLTK library (with C++ interface)

Why I can't declare a virtual destructor, in a class that maps a C++ class? If I do, at the linking it states that the destructor is defined twice
angros47
Posts: 1890
Joined: Jun 21, 2005 19:04

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby angros47 » Jun 07, 2021 23:43

I tried to compile the example of https://www.freebasic.net/forum/viewtopic.php?p=272431#p272431

With 1.08 it doesn't compile, it returns:

Code: Select all

ld: class.o: in function `base::~base()':
class.cpp:(.text+0x94): multiple definition of `base::~base()'; test.o:test.c:(.text+0x0): first defined here
ld: class.o: in function `derived::~derived()':
class.cpp:(.text+0x20c): multiple definition of `derived::~derived()'; test.o:test.c:(.text+0x52): first defined here
coderJeff
Site Admin
Posts: 3539
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby coderJeff » Jun 08, 2021 0:44

angros47 wrote:I tried to compile the example of https://www.freebasic.net/forum/viewtopic.php?p=272431#p272431
With 1.08 it doesn't compile


Did you have class.o on the command-line twice by accident?

It compiles for me with wilibs-gcc-9.3... with some help adjusting the paths and command line.

Appears to still be an off-by-one in the vtable layout. Maybe need the base object destructor too? I can see from the disassembly on class.o that it actually has all three destructors D0, D1, D2.
angros47
Posts: 1890
Joined: Jun 21, 2005 19:04

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby angros47 » Jun 08, 2021 7:56

I am almost sure I didn't put class.o in the command line twice.

I used the generic linux 64 bit version of FreeBasic (not the one tailored specifically for Ubuntu), on an Ubuntu 20 system. The rest seems to work correctly, so I don't think it depends on that.

I compiled with the -lstdc++ option, of couse
dodicat
Posts: 7007
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby dodicat » Jun 08, 2021 13:54

I was working with the latest python (my python experiment thread to update).
I switched to 1.08.0, and found this bug.

Win 10

Code: Select all

#include "fbgfx.bi"
print "Testing screencontrol 100  and  0"

'screenres 800,600,32 '' nothing 64 bts
screen 19,32 '' wrong position 64 bits or nothing on 32 bits
windowtitle "tester" 'nothing all the time using windowtitle

screencontrol fb.SET_WINDOW_POS, 300,300
sleep 200
dim as integer x,y
screencontrol fb.GET_WINDOW_POS,x,y

print "I would like window at  300 , 300"
print "I get this:"
print x;" , ";y
sleep
fxm
Moderator
Posts: 10454
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby fxm » Jun 08, 2021 14:46

Yes.
'screencontrol fb.SET_WINDOW_POS x, y' seems always set the position at (&h7FFF, &h7FFF).
angros47
Posts: 1890
Joined: Jun 21, 2005 19:04

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby angros47 » Jun 08, 2021 14:52

coderJeff wrote:Did you have class.o on the command-line twice by accident?


I have used the command

Code: Select all

../bin/fbc test.bas -l stdc++ class.o
D.J.Peters
Posts: 8301
Joined: May 28, 2005 3:28
Contact:

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby D.J.Peters » Jun 08, 2021 18:09

Looks like ImageInfo doesn't allow optional arguments any more ?

old: ImageInfo w,h,,,pPixels
now: ImageInfo w,h,unusedBytesPerPixel,unusedPitchPerLine,pPixels

It means all (and I mean ALL) my posted graphic stuff on this forum won't work anymore.

Joshy
fxm
Moderator
Posts: 10454
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby fxm » Jun 08, 2021 18:27

Have you tested it, or is it just the new usage syntaxes (for fbc version >= 1.08) in the documentation that are confusing?
(same for ScreenControl and ScreenInfo)

I will express them more completely in the same way as for the old ones (for version fbc <1.08).
(declaration syntaxes are right)
MrSwiss
Posts: 3849
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby MrSwiss » Jun 08, 2021 19:18

fxm wrote:Have you tested it, or is it just the new usage syntaxes (for fbc version >= 1.08) in the documentation that are confusing?

I think its the changed data-types: Long/LongInt instead of Integer that causes trouble.

Just tested ScreenInfo with Long (WIN 10): works ... like a charm (thanks, to coderJeff).
MrSwiss
Posts: 3849
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: FreeBASIC 1.08.0 Release Discussion (June 2021)

Postby MrSwiss » Jun 08, 2021 20:18

Propose a lil' bit of pre-processor to work around the problem:

Code: Select all

#If __FB_VERSION__ >= "1.08.0"
    Dim As Long     w, h, cd, ptch, bypp, hz
#Else
    Dim As Integer  w, h, cd, ptch, bypp, hz
#EndIf

Dim As String   drv

Screen 19, 32
Width 800 \ 8, 600 \ 16
'  obtain info about current mode
ScreenInfo(w, h, cd, ptch, bypp, hz, drv)
'ScreenInfo(w, h,, ptch, bypp,, drv)

Print Str(w) + " x " + Str(h) + " x " + Str(cd) + " x " + _
      Str(ptch) + " x " + Str(bypp) + " x " + Str(hz)
Print "using the '" + drv + "' driver"
Sleep
' quit graphics mode and obtain info about desktop
Screen 0
ScreenInfo(w, h, cd)
Print "desktop running at " + Str(w) + _
      " x " + Str(h) + " x " + Str(cd)
Sleep

Return to “Community Discussion”

Who is online

Users browsing this forum: zuibaf and 8 guests