Implementing AggPas with PtcGraph

classic Classic list List threaded Threaded
103 messages Options
123456
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
I've tested the example on 64 bit linux as a native application as well
cross compiled for a x86_64 windows target. Worked fine in both Wine and
on a Win64 machine.

In my experience, the one dependency that AggPas has potential to fail
may be related to the freetype library. If you plan to run your app on
windows only, then you can turn freetype off and AggPas will happily use
windows font libraries. Search for the AGG2D_USE_FREETYPE define and
comment it out.

Hope this helps,

Stefan

On 06/04/2017 06:30 PM, James Richters wrote:

> Thanks for figuring out how to make this work, I would have never figured it
> out with the documentation I was able to find.
>
> I'm out of town this week so I tried to download the sample program to my
> laptop and discovered another issue.  While I can normally just compile my
> programs on my laptop and run them,  I have noticed that I can't do this
> with programs with aggpas in them. They compile successfully but when I try
> to run them I get a "system error: The Program can't start because
> MSVCR71.dll is missing from your computer.  Try reinstalling the program to
> fix this problem"  I suspect I get this because I have never actually
> installed free Pascal or something that I happened to install on my
> development pc on my laptop, I have always run freepascal it from a backup
> made from my development machine.   I have not tried installing freepascal
> on my lap top yet because I would like to figure out what I will need to do
> on my target installations where freepascal will not be installed.
>
> Any ideas on what causes this error and advice on how to install what is
> needed on client (non-development) systems?
>
> James
>
> -----Original Message-----
> From: fpc-pascal [mailto:[hidden email]] On Behalf
> Of Stefan V. Pantazi
> Sent: Saturday, June 03, 2017 12:45 PM
> To: FPC-Pascal users discussions <[hidden email]>
> Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph
>
> I seem to have some problems with logging on the bug tracker. I've used it
> in the recent past a couple of time but I am unable to log on for some
> reason. I will try later to create a new account and submit a fpc doc bug
> report.
>
> At any rate, I attached the updated example based on Nikolay's recent post
> which had the correct information. There was a third "reserved"
> parameter that had to be added to the bitmap buffer structure. Without it,
> the output was slightly clipped to the right. Also, for the example to work,
> the agg object constructor must be modified as well, I included all the info
> in the example header. I think the example program
> (aggpas_ptcgraph_output.pas) fits well together with the other demos in
> fpGUI and PtcPas/ptcgraph packages, so adding it to the packages would help,
> regardless whether graph.PutImage documentation is updated.
>
> Stefan
>
> On 06/03/2017 06:52 AM, Graeme Geldenhuys wrote:
>> On 2017-06-03 01:56, Stefan V. Pantazi wrote:
>>> http://pascal.net.ru/PutImage+(en)
>>> [...]
>>> "BitMap is an untyped parameter that contains the height and width of
>>> the region, and the bit image that will be put onto the screen."
>>> [...]
>>
>>
>> Could you file a FPC Documentation bug report and ask that this
>> information be added. As you found out (very difficultly), this is vital
>> information.
>>
>>
>> Regards,
>>   Graeme
>>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________________
Stefan V. Pantazi, MD, PhD
Professor, Health Informatics
School of Health & Life Sciences and Community Services
Conestoga College Institute of Technology and Advanced Learning
299 Doon Valley Drive
Kitchener, ON, Canada, N2G 4M4
office: 1C23
phone:  (519) 748-5220 ext. 3950
email:  [hidden email]
web: https://sites.google.com/site/stefanvpantazi/ 
_______________________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Graeme Geldenhuys-6
In reply to this post by Zaaphod
On 2017-06-04 23:30, James Richters wrote:
> to run them I get a "system error: The Program can't start because
> MSVCR71.dll is missing from your computer.

AggPas definitely doesn't require such a library, so your program must
be using something else that pulls that dependency in.

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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Graeme Geldenhuys-6
In reply to this post by Stefan V. Pantazi
On 2017-06-05 03:12, Stefan V. Pantazi wrote:
> In my experience, the one dependency that AggPas has potential to fail
> may be related to the freetype library. If you plan to run your app on
> windows only, then you can turn freetype off and AggPas will happily use
> windows font libraries. Search for the AGG2D_USE_FREETYPE define and
> comment it out.

Correct, though even font support is optional in AggPas. So if you don't
render text via AggPas, it has zero dependency - everything is done in
pure Object Pascal code.

As for font support under Windows. Yes you can use GDI for font
rendering, but I highly recommend using freetype.dll even under Windows.
It has more features than GDI font support and the quality is better too.

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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
>It has more features than GDI font support and the quality is better too.

Is it the fonts causing the dependency then?  I have freetype.dll included in the directory with my programs, do I need to include other files / dlls if I want them to run without installing anything?

the programs I am getting the dependency  issue with are based on and including Graeme's original sample program Agg2DColsole.dpr ,  they use:
Ptcgraph,
Ptccrt,
Sysutils,
Fpimage,
Fpwritepng,
Agg_2d,
Agg_Basics


James


-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Graeme Geldenhuys
Sent: Monday, June 05, 2017 2:25 PM
To: [hidden email]
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

On 2017-06-05 03:12, Stefan V. Pantazi wrote:
> In my experience, the one dependency that AggPas has potential to fail
> may be related to the freetype library. If you plan to run your app on
> windows only, then you can turn freetype off and AggPas will happily
> use windows font libraries. Search for the AGG2D_USE_FREETYPE define
> and comment it out.

Correct, though even font support is optional in AggPas. So if you don't render text via AggPas, it has zero dependency - everything is done in pure Object Pascal code.

As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
It has more features than GDI font support and the quality is better too.

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  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
How did you build/get freetype.dll? If it was built using Visual Studio,
freetype.dll might have been linked against a newer C++ runtime such as
msvcr71.dll that is not shipped with windows by default. You clearly
need to deploy C++ runtime libs as well with your product.
You may benefit from such tool as a dependency walker
(https://en.wikipedia.org/wiki/Dependency_Walker).
On linux you can just use ldd.

Hope this helps,

Stefan

On 06/05/2017 05:00 PM, James Richters wrote:

>> As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
>> It has more features than GDI font support and the quality is better too.
>
> Is it the fonts causing the dependency then?  I have freetype.dll included in the directory with my programs, do I need to include other files / dlls if I want them to run without installing anything?
>
> the programs I am getting the dependency  issue with are based on and including Graeme's original sample program Agg2DColsole.dpr ,  they use:
> Ptcgraph,
> Ptccrt,
> Sysutils,
> Fpimage,
> Fpwritepng,
> Agg_2d,
> Agg_Basics
>
>
> James
>
>
> -----Original Message-----
> From: fpc-pascal [mailto:[hidden email]] On Behalf Of Graeme Geldenhuys
> Sent: Monday, June 05, 2017 2:25 PM
> To: [hidden email]
> Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph
>
> On 2017-06-05 03:12, Stefan V. Pantazi wrote:
>> In my experience, the one dependency that AggPas has potential to fail
>> may be related to the freetype library. If you plan to run your app on
>> windows only, then you can turn freetype off and AggPas will happily
>> use windows font libraries. Search for the AGG2D_USE_FREETYPE define
>> and comment it out.
>
> Correct, though even font support is optional in AggPas. So if you don't render text via AggPas, it has zero dependency - everything is done in pure Object Pascal code.
>
> As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
> It has more features than GDI font support and the quality is better too.
>
> 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  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________________
Stefan V. Pantazi, MD, PhD
Professor, Health Informatics
School of Health & Life Sciences and Community Services
Conestoga College Institute of Technology and Advanced Learning
299 Doon Valley Drive
Kitchener, ON, Canada, N2G 4M4
office: 1C23
phone:  (519) 748-5220 ext. 3950
email:  [hidden email]
web: https://sites.google.com/site/stefanvpantazi/ 
_______________________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>How did you build/get freetype.dll?

I don't know how it was built, I swiped it from the AggPas24-rm3.zip file and it seemed to work.
I did find msvcr71.dll by searching my entire development pc hard drive and found it in C:\Program Files (x86)\StarWind Software\StarWind V2V Image Converter\lib\ and  Transferred it to my laptop and put it in the same directory as my test program and now it's running fine.  

>You may benefit from such tool as a dependency walker (https://en.wikipedia.org/wiki/Dependency_Walker).

Thanks for the advice, I will check it out.

Jim


-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Stefan V. Pantazi
Sent: Monday, June 05, 2017 6:19 PM
To: FPC-Pascal users discussions <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

How did you build/get freetype.dll? If it was built using Visual Studio, freetype.dll might have been linked against a newer C++ runtime such as msvcr71.dll that is not shipped with windows by default. You clearly need to deploy C++ runtime libs as well with your product.
You may benefit from such tool as a dependency walker (https://en.wikipedia.org/wiki/Dependency_Walker).
On linux you can just use ldd.

Hope this helps,

Stefan

On 06/05/2017 05:00 PM, James Richters wrote:

>> As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
>> It has more features than GDI font support and the quality is better too.
>
> Is it the fonts causing the dependency then?  I have freetype.dll included in the directory with my programs, do I need to include other files / dlls if I want them to run without installing anything?
>
> the programs I am getting the dependency  issue with are based on and including Graeme's original sample program Agg2DColsole.dpr ,  they use:
> Ptcgraph,
> Ptccrt,
> Sysutils,
> Fpimage,
> Fpwritepng,
> Agg_2d,
> Agg_Basics
>
>
> James
>
>
> -----Original Message-----
> From: fpc-pascal [mailto:[hidden email]] On
> Behalf Of Graeme Geldenhuys
> Sent: Monday, June 05, 2017 2:25 PM
> To: [hidden email]
> Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph
>
> On 2017-06-05 03:12, Stefan V. Pantazi wrote:
>> In my experience, the one dependency that AggPas has potential to
>> fail may be related to the freetype library. If you plan to run your
>> app on windows only, then you can turn freetype off and AggPas will
>> happily use windows font libraries. Search for the AGG2D_USE_FREETYPE
>> define and comment it out.
>
> Correct, though even font support is optional in AggPas. So if you don't render text via AggPas, it has zero dependency - everything is done in pure Object Pascal code.
>
> As for font support under Windows. Yes you can use GDI for font rendering, but I highly recommend using freetype.dll even under Windows.
> It has more features than GDI font support and the quality is better too.
>
> 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  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________________
Stefan V. Pantazi, MD, PhD
Professor, Health Informatics
School of Health & Life Sciences and Community Services Conestoga College Institute of Technology and Advanced Learning
299 Doon Valley Drive
Kitchener, ON, Canada, N2G 4M4
office: 1C23
phone:  (519) 748-5220 ext. 3950
email:  [hidden email]
web: https://sites.google.com/site/stefanvpantazi/ 
_______________________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
In reply to this post by Stefan V. Pantazi
I've just realized that the red and blue channels are reversed.  The sample
program aggpas_ptcgraph_output.pas has the star filled in with a red fade
and a blue series of random lines while the original test.png file had a
blue fade in the star with red random lines.   Also, the image is flipped on
the Y axis compared to the original example. The small green square is in
the upper left corner of test.png, but it is in the lower left corner of
aggpas_ptcgraph_output.pas

I've been able to duplicate the results of test.png by shifting the left 5
bits 11 positions to the right and the right 5 bits 11 positions to the left
and flipping the Y axis,  but I can only do that with putpixel and a nested
loop, which is quite a bit slower than putimage.  

Any ideas how I can build the data correctly so putimage will work?

James

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
There is a minus sign in the call:

  agg^.attach(@graph_buffer.data, IMAGE_WIDTH, IMAGE_HEIGHT,
-(IMAGE_WIDTH * RGB_WIDTH))

Removing it will flip the Y axis.

With regard to color, there may be two options:

1) the ideal way would be to specify the rgb order of a pixel format in
the Agg_2D constructor. The m_pixFormat has a m_order field with the
type order_type defined in agg_color.pas; have not figured it yet

2) knowing the R and B channels are swapped, you can do all your drawing
with colors there R and B are switched.


Stefan


On 06/13/2017 12:42 PM, James Richters wrote:

> I've just realized that the red and blue channels are reversed.  The sample
> program aggpas_ptcgraph_output.pas has the star filled in with a red fade
> and a blue series of random lines while the original test.png file had a
> blue fade in the star with red random lines.   Also, the image is flipped on
> the Y axis compared to the original example. The small green square is in
> the upper left corner of test.png, but it is in the lower left corner of
> aggpas_ptcgraph_output.pas
>
> I've been able to duplicate the results of test.png by shifting the left 5
> bits 11 positions to the right and the right 5 bits 11 positions to the left
> and flipping the Y axis,  but I can only do that with putpixel and a nested
> loop, which is quite a bit slower than putimage.
>
> Any ideas how I can build the data correctly so putimage will work?
>
> James
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
In reply to this post by Zaaphod
>   Also, the image is flipped on
>the Y axis compared to the original example. The small green square is in the upper left corner of test.png, but it is in the lower left corner of aggpas_ptcgraph_output.pas

It appears there is some ambiguity on whether 0,0 should be the lower left of upper left, but
I figured out how to flip the image on the Y axis:

agg^.attach(@graph_buffer.data, IMAGE_WIDTH, IMAGE_HEIGHT, -(IMAGE_WIDTH * RGB_WIDTH));
makes the image what I would consider upside down because
agg^.rectangle(10, 10, 50, 50);
ends up in the lower left corner but
ptcgraph.Rectangle(10,10,100,100);
ends up in the upper right corner.

If I use
agg^.attach(@graph_buffer.data, IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_WIDTH * RGB_WIDTH);
now both
agg^.rectangle(10, 10, 50, 50);
and
ptcgraph.Rectangle(10,10,100,100);
end up in the upper left corner with the 10,10 coordinates matching up

I still have not figured out how to switch red and blue bits around so putimage() will work.

James


-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of James Richters
Sent: Tuesday, June 13, 2017 12:43 PM
To: 'FPC-Pascal users discussions' <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

I've just realized that the red and blue channels are reversed.  The sample program aggpas_ptcgraph_output.pas has the star filled in with a red fade and a blue series of random lines while the original test.png file had a
blue fade in the star with red random lines.   Also, the image is flipped on
the Y axis compared to the original example. The small green square is in the upper left corner of test.png, but it is in the lower left corner of aggpas_ptcgraph_output.pas

I've been able to duplicate the results of test.png by shifting the left 5 bits 11 positions to the right and the right 5 bits 11 positions to the left and flipping the Y axis,  but I can only do that with putpixel and a nested
loop, which is quite a bit slower than putimage.  

Any ideas how I can build the data correctly so putimage will work?

James

_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
In reply to this post by Stefan V. Pantazi
Thanks for the help with this
> 1) the ideal way would be to specify the rgb order of a pixel format in the Agg_2D constructor. The m_pixFormat
> has a m_order field with the type order_type defined in agg_color.pas; have not figured it yet

>2) knowing the R and B channels are swapped, you can do all your drawing with colors there R and B are switched.
It sounds like it would be easier to figure out option 1.   That may also be better for compatibility if aggpas is updated in the future to be more compatible with ptcgraph.

James

-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Stefan V. Pantazi
Sent: Tuesday, June 13, 2017 2:03 PM
To: FPC-Pascal users discussions <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

There is a minus sign in the call:

  agg^.attach(@graph_buffer.data, IMAGE_WIDTH, IMAGE_HEIGHT, -(IMAGE_WIDTH * RGB_WIDTH))

Removing it will flip the Y axis.

With regard to color, there may be two options:

1) the ideal way would be to specify the rgb order of a pixel format in the Agg_2D constructor. The m_pixFormat has a m_order field with the type order_type defined in agg_color.pas; have not figured it yet

2) knowing the R and B channels are swapped, you can do all your drawing with colors there R and B are switched.


Stefan


On 06/13/2017 12:42 PM, James Richters wrote:

> I've just realized that the red and blue channels are reversed.  The sample
> program aggpas_ptcgraph_output.pas has the star filled in with a red fade
> and a blue series of random lines while the original test.png file had a
> blue fade in the star with red random lines.   Also, the image is flipped on
> the Y axis compared to the original example. The small green square is in
> the upper left corner of test.png, but it is in the lower left corner of
> aggpas_ptcgraph_output.pas
>
> I've been able to duplicate the results of test.png by shifting the left 5
> bits 11 positions to the right and the right 5 bits 11 positions to the left
> and flipping the Y axis,  but I can only do that with putpixel and a nested
> loop, which is quite a bit slower than putimage.
>
> Any ideas how I can build the data correctly so putimage will work?
>
> James
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
In reply to this post by Stefan V. Pantazi
>I've tested the example on 64 bit linux as a native application as well cross compiled for a x86_64 windows target. Worked fine in both Wine and on a Win64 machine.

>In my experience, the one dependency that AggPas has potential to fail may be related to the freetype library. If you plan to run your app on windows only, then you can turn freetype off and
>AggPas will happily use windows font libraries. Search for the AGG2D_USE_FREETYPE define and comment it out.

I thought I would try to compile the example for x86_64, because I would eventually like to make my final program an x86_64 program.

When I compile it with the command:
fpc -Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' aggpas_ptcgraph_output.pas
it works fine.

When I try
fpc -Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' -Px86_64 aggpas_ptcgraph_output.pas
it compiles fine with no errors, and it executes with no errors, however I do not get any output in either window at all, they are both just black, and unresponsive.

I've commented out the AGG2D_USE_FREETYPE for now, because I'm not sure if the freetype.dll I have will work on 64bit programs, and thought I would eliminate that as a possible issue.

I am using FPC v3.0.2 on a windows 10 x64 machine
I normally use the freepascal IDE to compile my programs, so I'm not too familiar with compiling from the command line.  I'm wondering if I am doing something wrong.

Also, is there some way to set a default for my units so I don't have to use Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' all the time?  If I don't use that, then it can't find any units, even though it's set in the directories with the IDE

I have some other sample programs that use ptcgraph (without AggPas) that do not have this issue, they compile as 64bit programs and run fine.  This seems to be something with using AggPas that appears to be causing the problem. I  put in a writeln('test'); at the beginning of the program and it does do that, and I move ptcgraph.Rectangle(10,10,100,100); to before drawstuff(agg); I will get the rectangle on the graph screen.   So I thought I would try to narrow down what was happening by drawing different rectangles in the middle of the code like this:
  ptcgraph.Rectangle(30,30,200,200);
  agg^.clearAll(0, 0, 0);
  agg^.lineColor(0, 0, 0, 255);
  agg^.lineWidth(3);
  agg^.rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
  ptcgraph.Rectangle(30,30,200,300);
  agg^.lineWidth(1);
  agg^.lineColor(0, 155, 0, 255);
  agg^.rectangle(10, 10, 50, 50);
  ptcgraph.Rectangle(30,30,300,300);

I get the first rectangle right away, the second rectangle after 6 seconds, and the third after 6 more seconds.  
I tried commenting out everything else, but I still never get the image from putimage();

I'm very confused by this and don't have a clue what could be wrong.  If I take out the -Px86_64 in the compile command line, the program runs as expected.  Since Stefan said he compiled 64bit versions of the example program and it worked, I wonder why I am having this issue.

James

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
Looks like it may be something specific to your setup. In my tests I
used Lazarus 1.5 as IDE and fpc 3.0.1 on Linux. Crosscompiled example
ran on Win7 64 bit. So there are already differences with your
environment. Noting your problems with compilation, you may want to
consider using Lazarus IDE as well. You get a debugger too.

One other thing that comes to mind is to be mindful of calls like this

   agg^.rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);

If the default fill color is black, then the result will be a black
window, albeit not unresponsive. Again, if your program hangs for some
reason, a debugger may come in handy.

Stefan

On 06/13/2017 04:44 PM, James Richters wrote:

>> I've tested the example on 64 bit linux as a native application as well cross compiled for a x86_64 windows target. Worked fine in both Wine and on a Win64 machine.
>
>> In my experience, the one dependency that AggPas has potential to fail may be related to the freetype library. If you plan to run your app on windows only, then you can turn freetype off and
>> AggPas will happily use windows font libraries. Search for the AGG2D_USE_FREETYPE define and comment it out.
>
> I thought I would try to compile the example for x86_64, because I would eventually like to make my final program an x86_64 program.
>
> When I compile it with the command:
> fpc -Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' aggpas_ptcgraph_output.pas
> it works fine.
>
> When I try
> fpc -Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' -Px86_64 aggpas_ptcgraph_output.pas
> it compiles fine with no errors, and it executes with no errors, however I do not get any output in either window at all, they are both just black, and unresponsive.
>
> I've commented out the AGG2D_USE_FREETYPE for now, because I'm not sure if the freetype.dll I have will work on 64bit programs, and thought I would eliminate that as a possible issue.
>
> I am using FPC v3.0.2 on a windows 10 x64 machine
> I normally use the freepascal IDE to compile my programs, so I'm not too familiar with compiling from the command line.  I'm wondering if I am doing something wrong.
>
> Also, is there some way to set a default for my units so I don't have to use Fu'J:\programming\fpc\3.0.2\units\$fpctarget\*' all the time?  If I don't use that, then it can't find any units, even though it's set in the directories with the IDE
>
> I have some other sample programs that use ptcgraph (without AggPas) that do not have this issue, they compile as 64bit programs and run fine.  This seems to be something with using AggPas that appears to be causing the problem. I  put in a writeln('test'); at the beginning of the program and it does do that, and I move ptcgraph.Rectangle(10,10,100,100); to before drawstuff(agg); I will get the rectangle on the graph screen.   So I thought I would try to narrow down what was happening by drawing different rectangles in the middle of the code like this:
>   ptcgraph.Rectangle(30,30,200,200);
>   agg^.clearAll(0, 0, 0);
>   agg^.lineColor(0, 0, 0, 255);
>   agg^.lineWidth(3);
>   agg^.rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
>   ptcgraph.Rectangle(30,30,200,300);
>   agg^.lineWidth(1);
>   agg^.lineColor(0, 155, 0, 255);
>   agg^.rectangle(10, 10, 50, 50);
>   ptcgraph.Rectangle(30,30,300,300);
>
> I get the first rectangle right away, the second rectangle after 6 seconds, and the third after 6 more seconds.
> I tried commenting out everything else, but I still never get the image from putimage();
>
> I'm very confused by this and don't have a clue what could be wrong.  If I take out the -Px86_64 in the compile command line, the program runs as expected.  Since Stefan said he compiled 64bit versions of the example program and it worked, I wonder why I am having this issue.
>
> James
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>Looks like it may be something specific to your setup. In my tests I used Lazarus 1.5 as IDE and fpc 3.0.1 on Linux. Crosscompiled example ran on Win7 64 bit.
>So there are already differences with your environment. Noting your problems with compilation, you may want to consider using Lazarus IDE as well. You get a debugger too.
I have pretty much a stock freepascal installation.  I very recently installed fpc-3.0.2.i386-win32.exe.  Then I installed fpc-3.0.2.i386-win32.cross.x86_64-win64.exe.  Then to get AggPas to work I copied everything from the 'src' folder in AggPas24-rm3.zip to an AggPas folder under FPC\3.0.2\units\i386-win32 and FPC\3.0.2\units\x86_64-win64. Everything compiles successfully, and other programs run, so it's very strange.

I tried Lazarus before and was unable to even get started with It because I could not even compile my console applications.  I think maybe it's because most of them require turbo pascal compatible mode and I don't think I knew about {$mode tp} directive yet.  So maybe I'll give it another try.    I like the debugger in the textmode IDE, but that doesn't help with this issue where everything is fine in win32 but not in x64.

>One other thing that comes to mind is to be mindful of calls like this
>
>  agg^.rectangle(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
>If the default fill color is black, then the result will be a black window, albeit not unresponsive. Again, if your program hangs for some reason, a debugger may come in handy.

I had the color set to blue, I get the blue rectangles, but there is this huge delay (6 seconds) in the x64 version but no delay in the win32 version.  The black screen was before I inserted the rectangles in.

James


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>Noting your problems with compilation, you may want to consider using Lazarus IDE as well.

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.

Downloaded and installed lazarus-1.6.0-fpc-3.0.0-win64.exe and accepted all defaults
Downloaded and installed lazarus-1.6.4-fpc-3.0.2-cross-i386-win32-win64.exe and accepted the default install directory.
Copied aggpas to C:\lazarus\fpc\3.0.2\units\i386-win32
Copied aggpas to C:\lazarus\fpc\3.0.2\units\x86_64-win64

Opened a sample program the uses just ptcgraph, when it asked to create a project I said yes then selected 'Program' from the list
I was able to compile and run it with options for OS win32 CPU i386 as well as OS  win64 CPU x86_64 and it ran fine with both versions
I opened aggpas_ptcgraph_output.pas the same way and selected program.  If I select OS win32 CPU i386 it compiles and runs fine, no problems
When I select OS  win64 CPU x86_64 and try to run it, it opens both the console window and graphics window, then I get an error box reading:

Project aggpas_ptcgraph_output raised exception class 'external: SIGSEGV'
In file 'C:\lazarus\fpc\3.0.2\u..\agg_rasterizer_scanline_aa.pas' at line 611 while cell_aa_ptr_prt(ptrcomp(j) + 1 * 4^^.x<J^.x do

Any ideas why this is happening?

James



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
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.

It is unclear to me whether you are on a win32 or win64 OS? If you are
already on a win64 machine then your default target CPU should already
be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?


On 06/13/2017 08:25 PM, James Richters wrote:

>> Noting your problems with compilation, you may want to consider using Lazarus IDE as well.
>
> 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.
>
> Downloaded and installed lazarus-1.6.0-fpc-3.0.0-win64.exe and accepted all defaults
> Downloaded and installed lazarus-1.6.4-fpc-3.0.2-cross-i386-win32-win64.exe and accepted the default install directory.
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\i386-win32
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\x86_64-win64
>
> Opened a sample program the uses just ptcgraph, when it asked to create a project I said yes then selected 'Program' from the list
> I was able to compile and run it with options for OS win32 CPU i386 as well as OS  win64 CPU x86_64 and it ran fine with both versions
> I opened aggpas_ptcgraph_output.pas the same way and selected program.  If I select OS win32 CPU i386 it compiles and runs fine, no problems
> When I select OS  win64 CPU x86_64 and try to run it, it opens both the console window and graphics window, then I get an error box reading:
>
> Project aggpas_ptcgraph_output raised exception class 'external: SIGSEGV'
> In file 'C:\lazarus\fpc\3.0.2\u..\agg_rasterizer_scanline_aa.pas' at line 611 while cell_aa_ptr_prt(ptrcomp(j) + 1 * 4^^.x<J^.x do
>
> Any ideas why this is happening?
>
> James
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>It is unclear to me whether you are on a win32 or win64 OS?
I am on Windows 10 x64 OS

>If you are already on a win64 machine then your default target CPU should already be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?
fpc-3.0.2-cross-i386-win32-win64 is to be able to compile as a win32 program on a win64 machine.   I installed that so I could compile as win32 for comparison.  The test program works if compiled with Lazarus  for win32 but not win64

>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.
I was able to follow this and get to the comment in agg_basics, I read the comment that indicates some difference and possible problem with pointers on win64 but I don't know what I can do about it and why you are able to cross compile for win64 and it works.   I wonder if this is an issue with Freepascal 3.0.2, and aggpas hasn't been fixed for it yet and I need to use Freepascal 3.0.1 to get it to work?

James

-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Stefan V. Pantazi
Sent: Tuesday, June 13, 2017 9:25 PM
To: FPC-Pascal users discussions <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

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.

It is unclear to me whether you are on a win32 or win64 OS? If you are already on a win64 machine then your default target CPU should already be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?


On 06/13/2017 08:25 PM, James Richters wrote:

>> Noting your problems with compilation, you may want to consider using Lazarus IDE as well.
>
> 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.
>
> Downloaded and installed lazarus-1.6.0-fpc-3.0.0-win64.exe and
> accepted all defaults Downloaded and installed lazarus-1.6.4-fpc-3.0.2-cross-i386-win32-win64.exe and accepted the default install directory.
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\i386-win32
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\x86_64-win64
>
> Opened a sample program the uses just ptcgraph, when it asked to
> create a project I said yes then selected 'Program' from the list I
> was able to compile and run it with options for OS win32 CPU i386 as
> well as OS  win64 CPU x86_64 and it ran fine with both versions I opened aggpas_ptcgraph_output.pas the same way and selected program.  If I select OS win32 CPU i386 it compiles and runs fine, no problems When I select OS  win64 CPU x86_64 and try to run it, it opens both the console window and graphics window, then I get an error box reading:
>
> Project aggpas_ptcgraph_output raised exception class 'external: SIGSEGV'
> In file 'C:\lazarus\fpc\3.0.2\u..\agg_rasterizer_scanline_aa.pas' at
> line 611 while cell_aa_ptr_prt(ptrcomp(j) + 1 * 4^^.x<J^.x do
>
> Any ideas why this is happening?
>
> James
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>If you are already on a win64 machine then your default target CPU should already be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?
Correction:  
I start with fpc-3.0.2.i386-win32 because there is no precompiled version for win64 of freepascal I tried to compile it myself is it's just a confusing mess that I can't get to work.
So I then need to install fpc-3.0.2-cross-i386-win32-win64 to compile x64 with the above fpc-3.0.2.i386-win32 running on my x64 machine.

With Lazarus I am able to do it the other way around, I install
lazarus-1.6.4-fpc-3.0.2-win64.exe so from there I can compile x64 programs, then install
lazarus-1.6.4-fpc-3.0.2-cross-i386-win32-win64.exe so I can also compile Win32 programs with Lazarus.

James

-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of James Richters
Sent: Tuesday, June 13, 2017 10:16 PM
To: 'FPC-Pascal users discussions' <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

>It is unclear to me whether you are on a win32 or win64 OS?
I am on Windows 10 x64 OS

>If you are already on a win64 machine then your default target CPU should already be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?
fpc-3.0.2-cross-i386-win32-win64 is to be able to compile as a win32 program on a win64 machine.   I installed that so I could compile as win32 for comparison.  The test program works if compiled with Lazarus  for win32 but not win64

>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.
I was able to follow this and get to the comment in agg_basics, I read the comment that indicates some difference and possible problem with pointers on win64 but I don't know what I can do about it and why you are able to cross compile for win64 and it works.   I wonder if this is an issue with Freepascal 3.0.2, and aggpas hasn't been fixed for it yet and I need to use Freepascal 3.0.1 to get it to work?

James

-----Original Message-----
From: fpc-pascal [mailto:[hidden email]] On Behalf Of Stefan V. Pantazi
Sent: Tuesday, June 13, 2017 9:25 PM
To: FPC-Pascal users discussions <[hidden email]>
Subject: Re: [fpc-pascal] Implementing AggPas with PtcGraph

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.

It is unclear to me whether you are on a win32 or win64 OS? If you are already on a win64 machine then your default target CPU should already be x86_64. why do you need fpc-3.0.2-cross-i386-win32-win64?


On 06/13/2017 08:25 PM, James Richters wrote:

>> Noting your problems with compilation, you may want to consider using Lazarus IDE as well.
>
> 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.
>
> Downloaded and installed lazarus-1.6.0-fpc-3.0.0-win64.exe and
> accepted all defaults Downloaded and installed lazarus-1.6.4-fpc-3.0.2-cross-i386-win32-win64.exe and accepted the default install directory.
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\i386-win32
> Copied aggpas to C:\lazarus\fpc\3.0.2\units\x86_64-win64
>
> Opened a sample program the uses just ptcgraph, when it asked to
> create a project I said yes then selected 'Program' from the list I
> was able to compile and run it with options for OS win32 CPU i386 as
> well as OS  win64 CPU x86_64 and it ran fine with both versions I opened aggpas_ptcgraph_output.pas the same way and selected program.  If I select OS win32 CPU i386 it compiles and runs fine, no problems When I select OS  win64 CPU x86_64 and try to run it, it opens both the console window and graphics window, then I get an error box reading:
>
> Project aggpas_ptcgraph_output raised exception class 'external: SIGSEGV'
> In file 'C:\lazarus\fpc\3.0.2\u..\agg_rasterizer_scanline_aa.pas' at
> line 611 while cell_aa_ptr_prt(ptrcomp(j) + 1 * 4^^.x<J^.x do
>
> Any ideas why this is happening?
>
> James
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>

--
_______________________________________________________
_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Stefan V. Pantazi
In reply to this post by Zaaphod
Yes, it is puzzling. Different pointer sizes, compilers, OS, 32/64 bit
library dependencies, can be potential causes.

Again, note that I compiled the example on a CentOS 7, 64bit Linux with
Lazarus 1.5 + fpc 3.0.1

I can also confirm that the test program compiles and works fine on
Ubuntu 16.04 64bit, with Lazarus 1.7 + fpc 3.1.1


On 06/13/2017 10:16 PM, James Richters wrote:

but I don't know what I can do about it and why you are able to cross
compile for win64 and it works.

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Graeme Geldenhuys-6
In reply to this post by Zaaphod
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  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Implementing AggPas with PtcGraph

Zaaphod
>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 $0000000000000000.
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:[hidden email]] On Behalf Of Graeme Geldenhuys
Sent: Wednesday, June 14, 2017 5:17 AM
To: [hidden email]
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  -  [hidden email] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
123456