Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Stefan V. Pantazi
I think you need to use a global define passing a -d??? parameter 
(-dAGG2D_USE_FREETYPE) to the compiler. Just adding it to a unit only 
defines for that unit and to any file included in that one unit.


On 06/14/2017 09:40 PM, James Richters wrote:

The font rendering should all be controlled by compiler defines. You don't need 
to modify the unit to make it work.
Simply add the correct define in your project's Compiler Settings and recompile 
the code.


That is what I thought should happen, but I put
{$DEFINE AGG2D_USE_FREETYPE}

In my program under
{$mode objfpc}{$H+}

I still get:
FreeType: FALSE  Win32 True Type: TRUE

But if I uncomment
{$DEFINE AGG2D_USE_FREETYPE}
In agg_2D.pas

It's the only way I can get
FreeType: TRUE  Win32 True Type: FALSE

I don't know why the define isn't making it to the unit.  Do I need to do 
something else?   It's as if it's being un-defined somewhere else but I don't 
know where.. maybe the same place that is {$DEFINE AGG2D_USE_WINFONTS} because 
that is defiantly being set somewhere before the agg_2D.Pas unit and the only 
way to not get an error is for me to have this at the top of agg_2D.pas

{$IFDEF AGG2D_USE_FREETYPE }
 {$UNDEF AGG2D_USE_WINFONTS}
{$ENDIF }


And if you look in the "develop" branch of fpGUI, there is an even later
AggPas version - last updated a month ago.


Maybe I should go get this.. maybe some of these things are fixed already

Thank you for the help with this.

James

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal



--
___
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
>The font rendering should all be controlled by compiler defines. You don't 
>need to modify the unit to make it work.
>Simply add the correct define in your project's Compiler Settings and 
>recompile the code. 

That is what I thought should happen, but I put 
{$DEFINE AGG2D_USE_FREETYPE}

In my program under 
{$mode objfpc}{$H+} 

I still get:
FreeType: FALSE  Win32 True Type: TRUE

But if I uncomment 
{$DEFINE AGG2D_USE_FREETYPE} 
In agg_2D.pas

It's the only way I can get
FreeType: TRUE  Win32 True Type: FALSE

I don't know why the define isn't making it to the unit.  Do I need to do 
something else?   It's as if it's being un-defined somewhere else but I don't 
know where.. maybe the same place that is {$DEFINE AGG2D_USE_WINFONTS} because 
that is defiantly being set somewhere before the agg_2D.Pas unit and the only 
way to not get an error is for me to have this at the top of agg_2D.pas

{$IFDEF AGG2D_USE_FREETYPE }
 {$UNDEF AGG2D_USE_WINFONTS}
{$ENDIF }

>And if you look in the "develop" branch of fpGUI, there is an even later 
>AggPas version - last updated a month ago.

Maybe I should go get this.. maybe some of these things are fixed already

Thank you for the help with this.

James

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Graeme Geldenhuys

On 2017-06-14 19:15, James Richters wrote:

testing it are using the same thing, and people can have programs
that use either unit side by side without remembering how to modify /
unmodify a unit to make it work.


The font rendering should all be controlled by compiler defines. You 
don't need to modify the unit to make it work. Simply add the correct 
define in your project's Compiler Settings and recompile the code. If 
you know you are only every going to use one font render engine, then 
you can obviously modify the unit to make the default more to your liking.



Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Graeme Geldenhuys

On 2017-06-14 19:15, James Richters wrote:

Here is what I found out... Freetype.dll included in
fpgui_src_1.4.1.zip indeed does not have a dependency for
msvcr71.dll...


Yup, that's what I thought. :)



however,  it only works if I compile with Win32.


True. I'll include a 64-bit version too.


Speaking of the AggPas in fpGUI only:
  As for the $DEFINE and $IFDEF comments. When you toggle one font 
renderer (or disable it completely), then the other defines should have 
been undefined. That's how it used to work. Maybe somewhere that go 
broken. I'll do some testing and fix anything that is needed. Thanks for 
mentioning it.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Graeme Geldenhuys

On 2017-06-14 16:37, James Richters wrote:

I was able to finally compile and run the test program for Win64.


Excellent news!



As for AggPas. I use the version of AggPas that is included with
fpGUI. I simply make sure the path to AggPas is specified in the


There are 3 forks of AggPas that I know of, and the one included with 
fpGUI is the most maintained version (features and bug fixes).




Previously I was using the only version of AggPas I could find by
doing an internet search which I downloaded from here:
http://www.crossgl.com/aggpas/aggpas-download.htm then downloaded
AggPas24-rm3.zip


Ah, that would explain it. That is the original and FINAL release of 
AggPas by Milano from many years ago. It doesn't support 64-bit, doesn't 
support FreeBSD and had some bugs.


All those issues have been resolved in the AggPas included with fpGUI.



So it looks like AggPas24-rm3.zip from
http://www.crossgl.com/aggpas/aggpas-download.htm was last updated in
2008, while FPGUI was updated in 2015 and the version there has had
some changes so it is now beyond 24-rm3.


And if you look in the "develop" branch of fpGUI, there is an even later 
AggPas version - last updated a month ago.




Very confusing.  Maybe
AggPas is not being maintained anymore at
http://www.crossgl.com/aggpas ?


Yes, it is a bit confusing. No, the original AgPass from the crossgl.com 
website is not being maintained for many years.


I think you main a valid point in your other mail about the unit header 
comments. I'll update the header comments in fpGUI repository and make 
sure that it mentions that it is beyond the origin 2.4-rm3 release.


ps:
  And if you wondered why I don't have AggPas in its own repository?
  AggPas is/has been integrated into fpGUI and is becoming the default
  renderer for fpGUI's Canvas class. So it's a critical dependency
  (and at the time I didn't know about Git Submodules). At least
  I kept all the AggPas code in its own directory, but in hindsight,
  I should probably have named that directory "render/aggpas/" and not
  "render/software/". Umm, I might just change that before the
  next fpGUI release.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC for AVR

2017-06-14 Thread Brian
mikroPascal (not free) supports AVR and many other chips.

https://shop.mikroe.com/compilers/mikropascal/avr-electronic-license

Brian



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/FPC-for-AVR-tp5729005p5729056.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
I finally got freetype to work with AggPas, but I had to make a few changes.  I 
am wondering if there is a way to submit a request for changes so they will be 
part of the next release?

Here is what I found out... 
Freetype.dll included in fpgui_src_1.4.1.zip indeed does not have a dependency 
for msvcr71.dll... however,  it only works if I compile with Win32.

I did some searching and came up with something called libfreetype-6.dll listed 
as a 64bit Freetype library, so I copied that over and renamed it to 
freetype.lib, and now my Win64 program uses it and works... but as expected, 
the Win32 program no longer works.  

So I did some digging and fount 'freetype.dll' being assigned in 
agg_font_freetype_lib.pas on line 42 as follows:
-
const
{$IFDEF WINDOWS }
  ft_lib = 'freetype.dll';
{$ENDIF }

// Linux, FreeBSD etc.
{$if defined(UNIX) and not defined(darwin)}
  ft_lib = 'freetype';
{$ENDIF }

// Mac OS X
{$ifdef darwin}
  ft_lib = 'libfreetype';
{$ENDIF }
-
So I changed the Windows section to:
{$IFDEF WINDOWS }
{$IFDEF CPU64 }
  ft_lib = 'libfreetype-6.dll';
{$Else }
  ft_lib = 'freetype.dll';
{$ENDIF }
{$ENDIF }

Now if I compile it Win64 it uses the 64bit library and if I compile it Win32 
it uses the 32bit library, this way I can just randomly create whatever type 
program I want and get the correct library.   I suppose something similar would 
be needed for other platforms but have no way to test it.

Also I had issues with using freetype at all.  I used 
Writeln('FreeType: ',Agg2DUsesFreeType,'  Win32 True Type: 
',Agg2DUsesWin32TrueType); 
To show which font method was being used and found my program was using win32 
true type fonts

So I went to Agg_2D.pas on line 25 and found this:

// With this define uncommented you can use FreeType font engine
{ $DEFINE AGG2D_USE_FREETYPE }

It took me a while to figure out that the space between ( and $ was making this 
into a comment,  it would have been more clear to comment it out like:
//{$DEFINE AGG2D_USE_FREETYPE}  

But in any case I did figure it out and uncommented it,  but then I could not 
compile it because of:
agg_2D.pas(142,15) Error: Duplicate identifier "FontEngine"

So Agg_2D.pas line 138 - 143 are:
{$IFDEF AGG2D_USE_FREETYPE }
 FontEngine = font_engine_freetype_int32;
{$ENDIF }
{$IFDEF AGG2D_USE_WINFONTS}
 FontEngine = font_engine_win32_tt_int32;
{$ENDIF }

The only way the FontEngine = font_engine_win32_tt_int32; on line 142 could 
cause this error is if both  AGG2D_USE_WINFONTS and  AGG2D_USE_FREETYPE were 
defined.  I looked around and could not find where AGG2D_USE_WINFONTS was 
defined, but it seems obvious that both cannot be defined at once so I changed 
from line 25 in Agg_2D.pas to this:
// With this define uncommented you can use FreeType font engine
//{$DEFINE AGG2D_USE_FREETYPE}

{$IFDEF AGG2D_USE_FREETYPE }
  {$UNDEF AGG2D_USE_WINFONTS}
{$ENDIF }

And now if I run it as above I get Win32 true type fonts and if I comment out 
the freetype define I get freetype fonts.

I noticed that with the freetype define comment out, adding it to my program 
could not make it work.  I would prefer a method that did not involve modifying 
the Agg_2D unit to change which font package to use.

Also,  I have copied Agg_2D.pas to Agg_2D_RBG565.pas and modified that one as 
needed for ptcgraph.  I wonder if it would be beneficial to add this modified 
version of the unit to the development system so eventually it will be included 
in the official release.  That way everyone working on it and / or testing it 
are using the same thing, and people can have programs that use either unit 
side by side without remembering how to modify / unmodify a unit to make it 
work.I'm not sure where the proper place is to submit things like this, but 
I would be happy to contribute these changes if possible.

James



-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
James Richters
Sent: Wednesday, June 14, 2017 11:54 AM
To: 'FPC-Pascal users discussions' 
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

All this has me wondering about the freetype.dll version.  I've been using 
freetype.dll that I found in AggPas24-rm3.zip modified 9/17/2007 I notice there 
is another one in fpgui_src_1.4.1.zip in the 
fpgui-1.4.1\extras\freetype_windows directory modified 12/9/2012  Is this the 
best version to use?  

I was hoping to figure out a way to not have the dependency of msvcr71.dll I 
tried going all over https://www.freetype.org and even downloaded ft28.zip from 
there and tried to make sense of it, but just got more confused I haven't tried 
the version of freetype.dll included with fpgui yet, I thought I would just ask 
first

James

___
fpc-pascal maillist  -  

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
All this has me wondering about the freetype.dll version.  I've been using 
freetype.dll that I found in AggPas24-rm3.zip modified 9/17/2007
I notice there is another one in fpgui_src_1.4.1.zip in the 
fpgui-1.4.1\extras\freetype_windows directory modified 12/9/2012  Is this the 
best version to use?  

I was hoping to figure out a way to not have the dependency of msvcr71.dll
I tried going all over https://www.freetype.org and even downloaded ft28.zip 
from there and tried to make sense of it, but just got more confused
I haven't tried the version of freetype.dll included with fpgui yet, I thought 
I would just ask first

James

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
I was able to finally compile and run the test program for Win64.   I wanted to 
change only one thing at a time so I could figure out what exactly the problem 
was.  The first thing I tried was to use the exact version of AggPas Graeme 
used.

>As for AggPas. I use the version of AggPas that is included with fpGUI. 
>I simply make sure the path to AggPas is specified in the project compiler 
>settings, which in the above command line parameter is:
>c:\devel\fpgui\src\corelib\render\software

Previously I was using the only version of AggPas I could find by doing an 
internet search which I downloaded from here:
http://www.crossgl.com/aggpas/aggpas-download.htm then downloaded 
AggPas24-rm3.zip 

So I removed that version and downloaded fpgui_src_1.4.1.zip from:
https://sourceforge.net/projects/fpgui/files/fpGUI/1.4.1/

I extracted it to my H: Drive and tested it out.
I did not change my path for this test so I just put in paths to everything and 
ran it from the H:\FPC64\3.0.2\x86_64-win64\bin directory then executed the 
following command line:
fpc -Fu..\units\$fpctarget\* -FuH:\fpgui-1.4.1\src\corelib\render\software 
J:\programming\Gcode\Graphics\aggpas_ptcgraph_output.pas

The compile was successful and the Win64 version of the program ran fine.

So just for fun, I replaced the aggpas units in my original setup with the ones 
from fpgui_src_1.4.1.zip and tried it the original way I was doing it with the 
cross compiler and the command:
fpc -FuJ:\Programming\FPC\3.0.2\units\$fpctarget\* -Px86_64 
aggpas_ptcgraph_output.pas 
This was also successful, so I tried a few other sample programs and they all 
seem to work as both Win32 and Win64

So I was wondering, why would this be?  So I looked at this:
>While in lazarus open agg_rasterizer_scanline_aa.pas, go ro line 611 press Ctr 
>and click on ptrcomp. It should open agg_basics.pas, the comment may apply to 
>your situation.

And did a compare between agg_basics from AggPas24-rm3.zip and agg_basics from 
fpgui_src_1.4.1.zip and noticed they are NOT the same.  They both indicate they 
are the same by the comments at the top 
// Anti-Grain Geometry - Version 2.4 Release Milano 3 (AggPas 2.4 RM3) 

But the version from AggPas24-rm3.zip has
// Pascal's pointer-in-an-array-access helper structures
 p32_ptr = ^p32;
 p32 = record
   case integer of
1 : (ptr : pointer );

   {$IFDEF CPU64 }
2 : (int : system.int64 );

   {$ELSE }
2 : (int : integer );

   {$ENDIF }

  end;

while the version from fpgui_src_1.4.1.zip has
// Pascal's pointer-in-an-array-access helper structures
 p32_ptr = ^p32;
 p32 = record
   case integer of
1 : (ptr : pointer );
2 : (int : ptrcomp );
  end;

There are also several other differences in the 2 files.   

So it looks like AggPas24-rm3.zip from 
http://www.crossgl.com/aggpas/aggpas-download.htm was last updated in 2008, 
while
FPGUI was updated in 2015 and the version there has had some changes so it is 
now beyond 24-rm3.  Very confusing.  Maybe AggPas is not being maintained 
anymore at http://www.crossgl.com/aggpas ?

Anyway Thank you to everyone for helping get to the bottom of this!  


-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Graeme Geldenhuys
Sent: Wednesday, June 14, 2017 8:29 AM
To: fpc-pascal@lists.freepascal.org
Cc: James Richters 
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

On 2017-06-14 11:57, James Richters wrote:
> I've downloaded the zip file and extracted it to H:\FPC64.   But now
> I have a few questions to attempt to duplicate a successful 64bit 
> compile.

Two steps are required - sorry, I forgot to mention that in my previous post 
(though I did to the person i created this zip for originally).

1) I find it always useful to have the \bin\ directory in my PATH so that 
the fpc.exe executable can be run from anywhere.

2) You need to adjust the fpc.cfg file (located in the 'bin' directory) to 
match your install path. My path was:

c:\lazarus\fpc\3.0.2\x86_64-win64

Back in FPC 2.4.x I installed Lazarus which included FPC, which in turn 
installed the FPC under the c:\lazarus\fpc\ directory. Ever since every FPC 
update, I just stuck to that install location. So you don't need to have it 
like this obviously.


> Maybe it isn't valid to use the IDE with Win64?  I sure wish it would
> work.   I like and prefer the FPC text IDE.

The FPC Text IDE (64-bit) runs just fine here under Windows 7 64-bit. 
See attached screenshot. Even mouse support works inside the Text IDE.

I mostly use MSEide for all my console, web and fpGUI related programming. I 
created some custom project templates and away I go. 
Lazarus has some nice editor features, but is often buggy and the Lazarus 
Package system just doesn't work for me. With MSEide I use global (or per 
project) path macros instead. This gives much more reliable compilations.

Here is the command line equivalent of what my MSEide 

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
>> I also wonder if this is a windows 10 frootllooopy weirdness thing (it 
>> wouldn't be the first).  Can you just email me the exe file zipped and 
>> I'll just try to run it here?  Then I will know if it's a compiler 
>> issue or an OS issue

>I assume you mean the executable of the ptcgraph+aggpas demo? I'll do so in a 
>private email.

Thanks for mailing the demo executable.  I'm happy to report that it does run 
fine on my system as well (Windows 10 x64)
So there must be something different in the way I am compiling it that is 
causing the problem.

James


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
Thanks for all the info, I will try to get it working.

>I assume you mean the executable of the ptcgraph+aggpas demo? I'll do so in a 
>private email.
Yes, please.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Graeme Geldenhuys

On 2017-06-14 11:57, James Richters wrote:

I've downloaded the zip file and extracted it to H:\FPC64.   But now
I have a few questions to attempt to duplicate a successful 64bit
compile.


Two steps are required - sorry, I forgot to mention that in my previous 
post (though I did to the person i created this zip for originally).


1) I find it always useful to have the \bin\ directory in my PATH 
so that the fpc.exe executable can be run from anywhere.


2) You need to adjust the fpc.cfg file (located in the 'bin' directory) 
to match your install path. My path was:


   c:\lazarus\fpc\3.0.2\x86_64-win64

Back in FPC 2.4.x I installed Lazarus which included FPC, which in turn 
installed the FPC under the c:\lazarus\fpc\ directory. Ever since every 
FPC update, I just stuck to that install location. So you don't need to 
have it like this obviously.




Maybe it isn't valid to use the IDE with Win64?  I sure wish it would
work.   I like and prefer the FPC text IDE.


The FPC Text IDE (64-bit) runs just fine here under Windows 7 64-bit. 
See attached screenshot. Even mouse support works inside the Text IDE.


I mostly use MSEide for all my console, web and fpGUI related 
programming. I created some custom project templates and away I go. 
Lazarus has some nice editor features, but is often buggy and the 
Lazarus Package system just doesn't work for me. With MSEide I use 
global (or per project) path macros instead. This gives much more 
reliable compilations.


Here is the command line equivalent of what my MSEide project does for 
the ptcgraph + aggpas demo.


C:\lazarus\fpc\3.0.2\x86_64-win64\bin\fpc.exe 
-oaggpas_ptcgraph_output.exe -Fuc:\devel\fpgui\src\reportengine 
-Fuc:\devel\fpgui\src\corelib\render\software 
-Fic:\devel\fpgui\src\corelib\render\software -Fic:\devel\fpgui\src 
-Fuc:\devel\fpgui\src\corelib\gdi -Fic:\devel\fpgui\src\corelib\gdi 
-Fuc:\devel\fpgui\src\gui -Fuc:\devel\fpgui\src\corelib -l -Mobjfpc -Sh 
-Sc -Si -gl -O- -FUunits -viewnh aggpas_ptcgraph_output.pas



As for AggPas. I use the version of AggPas that is included with fpGUI. 
I simply make sure the path to AggPas is specified in the project 
compiler settings, which in the above command line parameter is:


   c:\devel\fpgui\src\corelib\render\software

FPC then compiles all units as it needs them, and I always output the 
compiled units into a project specific "units" directory (the -FUunits 
command line parameter seen above). I don't like mixing *.pas and 
*.o;*.ppu files in the same directories.




I also wonder if this is a windows 10 frootllooopy weirdness thing
(it wouldn't be the first).  Can you just email me the exe file
zipped and l'll just try to run it here?  Then I will know if it's a
compiler issue or an OS issue


I assume you mean the executable of the ptcgraph+aggpas demo? I'll do so 
in a private email.




Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread James Richters
>Strange, as it works perfectly here. I compiled FPC 3.0.2 for win64 (I always 
>do that for Win64 - I never use the cross compiler). 
>Somebody else (I can't remember who) asked for a native win64 windows 
>compiler, and I zipped up the one I had. It is still available for download 
>from here...

I've downloaded the zip file and extracted it to H:\FPC64.   But now I have a 
few questions to attempt to duplicate a successful 64bit compile.  It's 
probably better to ask than to make a mess of things by doing it wrong.
Starting with the native win64 windows compiler I just downloaded,  how do I 
install the aggpas units?
How do you use this to compile the example successfully?  IDE? command line?  
Do I need to define unit directories somewhere?
Any other configurations or setups I need to do?
I notice there is a 64bit version of the IDE and in there under Options > 
Compiler > Processor the CoreI and Athlon64 are listed, so it seemed
Like it should just work (although I don't know how these should be set)

I tried to use the IDE to compile one of my simple programs but I get
Program generated a RTE 217
at address $.
Save your sources and restart the IDE.

Then after clicking OK

The IDE generated an internal error
and will now be closed.

Maybe it isn't valid to use the IDE with Win64?  I sure wish it would work.   I 
like and prefer the FPC text IDE.

I also wonder if this is a windows 10 frootllooopy weirdness thing (it wouldn't 
be the first).  Can you just email me the exe file zipped and l'll just try to 
run it here?  Then I will know if it's a compiler issue or an OS issue

James
  

-Original Message-
From: fpc-pascal [mailto:fpc-pascal-boun...@lists.freepascal.org] On Behalf Of 
Graeme Geldenhuys
Sent: Wednesday, June 14, 2017 5:17 AM
To: fpc-pascal@lists.freepascal.org
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

On 2017-06-14 01:25, James Richters wrote:
> I have just installed Lazarus but still can't get the 
> aggpas_ptcgraph_output.pas sample program to run when compiled for 
> x64. Here is what I have done.


Strange, as it works perfectly here. I compiled FPC 3.0.2 for win64 (I always 
do that for Win64 - I never use the cross compiler). Somebody else (I can't 
remember who) asked for a native win64 windows compiler, and I zipped up the 
one I had. It is still available for download from here...

http://geldenhuys.co.uk/~graemeg/fpc-3.0.2-win64.7z


I then compiled your sample program. It works and runs perfectly under Windows 
7 (64-bit). See the my second private email where I attached a screenshot. I 
don't have a later Windows version to test on.

The only mods I made:
   - modified agg_2D.pas so the constructor takes a pixfmt parameter.
   - flipped the Y-axis in the example program.

The pixel channel order is still an issue though - Red and Blue channels need 
to be swapped.


Regards,
   Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal 
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org 
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Sven Barth via fpc-pascal
Am 14.06.2017 11:13 schrieb "Gabor Boros" :
>
> 2017. 06. 14. 10:28 keltezéssel, José Mejuto írta:
>>
>> That's wrong for sure, x is not initialized to nil, not in Linux nor in
Windows.
>
>
> With the below code caption of the form not changed on Linux for me.
>
>
> procedure TForm1.FormCreate(Sender: TObject);
> var
>   x:TPanel;
>
> begin
>   if Assigned(x) then Caption:='Assigned';
> end;

In this example the content of "x" is undefined as it's a local variable.
The value of it is simply what is currently on the stack which *can* be Nil.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Implementing AggPas with PtcGraph

2017-06-14 Thread Graeme Geldenhuys

On 2017-06-14 01:25, James Richters wrote:

I have just installed Lazarus but still can't get the
aggpas_ptcgraph_output.pas sample program to run when compiled for
x64. Here is what I have done.



Strange, as it works perfectly here. I compiled FPC 3.0.2 for win64 (I
always do that for Win64 - I never use the cross compiler). Somebody
else (I can't remember who) asked for a native win64 windows compiler,
and I zipped up the one I had. It is still available for download from
here...

   http://geldenhuys.co.uk/~graemeg/fpc-3.0.2-win64.7z


I then compiled your sample program. It works and runs perfectly under
Windows 7 (64-bit). See the my second private email where I attached a
screenshot. I don't have a later Windows version to test on.

The only mods I made:
  - modified agg_2D.pas so the constructor takes a pixfmt parameter.
  - flipped the Y-axis in the example program.

The pixel channel order is still an issue though - Red and Blue channels
need to be swapped.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Gabor Boros

2017. 06. 14. 10:28 keltezéssel, José Mejuto írta:
That's wrong for sure, x is not initialized to nil, not in Linux nor in 
Windows.


With the below code caption of the form not changed on Linux for me.

procedure TForm1.FormCreate(Sender: TObject);
var
  x:TPanel;

begin
  if Assigned(x) then Caption:='Assigned';
end;

Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread José Mejuto

El 13/06/2017 a las 21:04, Gabor Boros escribió:


Cannot have a simple test case just a dumb example.

procedure TForm1.FormCreate(Sender: TObject);
var
   x:TPanel;

begin
   x.Free;
end;

With Linux no error (x is Nil before the Free call), with Windows got 
SIGSEGV (x is not Nil before the Free call). Is it a Lazarus thing or 
come from FPC?


Hello,

That's wrong for sure, x is not initialized to nil, not in Linux nor in 
Windows. Procedure variables must be always initialized by hand. With 
that code you will get a warning from the compiler about uninitialized 
variable use.


--

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Gabor Boros

Hi All,

In my Lazarus application I use a TPanel descendant component (TMyPanel) 
which have subpanels (TMySubPanel) which are TPanel descendants also. 
The subpanels accessed through a TList. If add a new subpanel into the 
main panel added to the list with TList.Add if remove a subpanel from it 
remove from the list with TList.Remove then call TMySubPanel.Free. My 
main development platform is x86_64-Linux and the application works like 
a charm. But with the Windows version of the app (cross compiled to 
i386-Win32) got an "Access violation." at TMySubPanel.Free. If start 
with gdb got "Program received signal SIGSEGV, Segmentation fault.

0x004041c4 in fpc_check_object ()" at TMySubPanel.Free.

I completely don't understand what is the source of the problem and why 
the two platforms behaves differently.


Cannot have a simple test case just a dumb example.

procedure TForm1.FormCreate(Sender: TObject);
var
  x:TPanel;

begin
  x.Free;
end;

With Linux no error (x is Nil before the Free call), with Windows got 
SIGSEGV (x is not Nil before the Free call). Is it a Lazarus thing or 
come from FPC?


Gabor
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal