Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Reimar Grabowski
On Wed, 18 Jul 2018 21:26:05 -0400
Ben Grasset  wrote:

> This is a massive oversimplification. Many *modern* game engines do not
> even have the kind of loop you're thinking of.
Please tell me where I can read up about those engines without cyclic executive?
Are those engines interrupt driven or how are they working?
Where is the gain in not having a loop?
Keeping your timing consistent with just semaphores sounds like a nightmare to 
me and not a win.
In the end the loop is in the OS (listening for events/interrupts) no matter 
what you do (except using a real time OS, but I don't know any console running 
on one (they run BSD) and PC gaming is Windows).
I am little out of the loop (no pun intended) regarding game engines so which 
engines are *modern*?
Unreal 5 does still have a loop and current Unity, too, so they seem to be old 
fashioned (contrary to me thinking they are modern).

>> Outside the game loop you do not need such a 'high performance' anymore.
>Says who?
Mr. Common-Sense says that you can waste a few nano/milliseconds if you are 
outside a run and only updating (slow) user input and interface (menus).
But he's not always right and eager to hear about situations where this time 
cannot be spent.

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

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Reimar Grabowski
On Wed, 18 Jul 2018 16:12:41 -0600
Ryan Joseph  wrote:

> Personally for my taste I would like to just add a little keyword to the end 
> of the variable so I don’t have to worry about it later.

1) little, innocent deallocation feature A
2) other user comes along: "We already have A, can it be improved a little to 
work in situation X, too?"
3) n other users come along
4) "Pascal garbage collection - You have earned a trophy!" ;)

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

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Reimar Grabowski
On Wed, 18 Jul 2018 15:39:58 -0600
Ryan Joseph  wrote:

> 1) For high performance situations it really does matter...  I was 
> doing a game engine recently and doing the create/free thing when I knew I 
> didn’t have to was painful.

For high performance in a game engine you should not allocate/deallocate memory 
in the game loop at all (can be done, have done it*, so no arguing there). 
Increases the performance and frees you of doing "the create/free thing", 
that's killing two birds with one stone. Outside the game loop you do not need 
such a 'high performance' anymore.

R.

*The game uses procedural/random level generation and depending on skill there 
can be over 300 levels in a single run, with all allocation/deallocation 
happening before/after a run.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Syntax changes suggestions

2018-07-18 Thread Reimar Grabowski
On Wed, 18 Jul 2018 14:33:51 -0600
Ryan Joseph  wrote:

> They probably wanted something like this:
> 
> n := if x <> 0 then 10 else 20;
> 
> Not too crazy in my opinion.

Only if you think that changing a statement to an expression is not 'too crazy'.
Btw in Kotlin if is an expression:

val n = if (x != 0) 10 else 20

But in pascal it's not and it's IMHO no small change to make it one.

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

Re: [fpc-pascal] A new fpc desirable feature

2018-07-17 Thread Reimar Grabowski
On Tue, 17 Jul 2018 13:56:39 +0200
Giuliano Colla  wrote:

> The syntax is quite simple: "please:", followed by the explanation in 
> plain English (or whatever locale is selected) of what you want the 
> compiler to do, makes the compiler generate the appropriate code.

Not against you but that's the most stupid proposal I ever heard.
I DO NOT beg the compiler for something, I command.

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

Re: [fpc-pascal] Syntax changes suggestions

2018-07-17 Thread Reimar Grabowski
On Tue, 17 Jul 2018 12:04:19 +0200
Martin  wrote:

> But more troubling:
> You do no longer have a complete list of all local vars. That means, if 
> I want to add a (current style) local var "i", i may have to scan the 
> entire procedure (maybe hundreds of lines) to find if there already is a 
> nested "i"
Wouldn't you need to refactor this procedure anyway into 20 line chunks and 
nuke the guy that wrote it? ;)

Btw I don't support the proposed changes as I don't see the need to get all and 
every language on feature parity.
Languages do have different design philosophies which manifest in different 
feature sets. So there is always more to a feature than pure functionality.
I write nowadays mostly in languages which do have "block scope" and I really 
don't prefer one "scoping" over the other. Both make sense in the context of 
their respective language.
And Delphi for example introduced features in a vain attempt to stay relevant 
which where not in the spirit of pascal. Freepascal has no need to do this.

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

Re: [fpc-pascal] Next language feature for pas2js...

2018-04-25 Thread Reimar Grabowski
On Wed, 25 Apr 2018 16:43:30 +0200 (CEST)
Michael Van Canneyt  wrote:

> Ah, webgl...
> 
> I had a look at this some time ago, and got depressed. 
Can you elaborate?

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

Re: [fpc-pascal] Stack alias for ARC like memory management?

2018-04-25 Thread Reimar Grabowski
On Wed, 25 Apr 2018 22:14:17 +0700
Ryan Joseph  wrote:

> ... and Android is all Java right?

AFAICR it's now Kotlin, Java, C++ and FPC in order of support and ease of use.

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

Re: [fpc-pascal] Proposal for new Free Pascal logo

2018-04-11 Thread Reimar Grabowski
On Sun, 8 Apr 2018 21:58:55 -0400
Ben Grasset  wrote:

> I'm not at all getting why people think it's "kitten-like." Have you guys
> ever actually seen a kitten?
Sure, they look like this: https://tinyurl.com/y9hod4gg

> And a much better/more tasteful cheetah than that
> ancient, annoying "running" GIF at the top of all the Free Pascal websites
> honestly.
Better does not mean good.
The point being is that tastes differ.

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

Re: [fpc-pascal] Proposal for new Free Pascal logo

2018-04-06 Thread Reimar Grabowski
On Fri, 6 Apr 2018 09:53:19 +0700
Mr Bee via fpc-pascal  wrote:

> Lock-in strategy is just a term in business, but it never really locks
> anybody into anything. You won't be punished if you don't use Swift on
> Apple's platform or C# on Microsoft's platform. You're still free to use
> anything on any platforms. But usually you'll get many benefits...

The benefits being mostly that you don't have the disadvantages especially 
introduced for not using it?

> Because you mix the whole things up. Branding is important but it doesn't
> need to represent the company/product literally.
But it needs to represent.

> A brand is like our name.
No, it's not.

R.

P.S.: Cute logos s*ck
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] First pas2js public release

2017-12-22 Thread Reimar Grabowski
On Thu, 21 Dec 2017 15:49:01 +0100
Michael Schnell  wrote:

> Rather obviously this 

> would needed to be provided by the library (e.g. Lazarus or mse).
LOL, no.

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

Re: [fpc-pascal] First pas2js public release

2017-12-22 Thread Reimar Grabowski
On Fri, 22 Dec 2017 08:53:03 +0100 (CET)
Michael Van Canneyt  wrote:

> That is one of the points of pas2js. To allow you to program the browser [in 
> pascal].
Fixed that for you.
And yes, that's what most transpilers to javascript are meant for.

> There is no need for a server. You can make e.g. a chess application that runs
> 100% in the browser, using a single HTML file. You can embed the JS and
> images in the HTML itself, and thus your HTML file is the 'executable'.
Really, that's amazing?
 
> See the browser as a desktop. Your program runs in that desktop.
> If need be, this program can contact a server - the classical 
> client/server model, using HTTP as the protocol - but this is by no means a 
> necessity.
If you say so.
 
> In that sense, the demo demonstrates this. The server is just there for you
> to be able to download the "program"...



Mighty web app




  alert("I am such a mighty web application");



Ok, if this is nowadays a 'web application' I seriously get old.
But whatever, every HTML page with a script is a web app now. Lesson learned.

R.

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

Re: [fpc-pascal] First pas2js public release

2017-12-20 Thread Reimar Grabowski
On Wed, 20 Dec 2017 15:14:50 +0100
Ingemar Ragnemalm  wrote:

> Although I would like to make some improvements - who doesn't? To be 
> precise, I want to figure out a way to play sounds, and I want image 
> loading directly in the code and not dependent on the HTML. Any ideas 
> about that?
First of all I know nothing about pas2js, but...
As your code is running solely in the browser there is no option to load it 
from file for security reasons.
But you can embed the binary image data in the code (as Uint8Array) or you can 
use XHR (pas2js will surely support this somehow) to fetch the image data via 
HTTP.
Once you have the data put it into a blob, create an url and finally use that 
as you image url.
So you need pascal code that will produce this JS code:

var blob = new Blob([data], { type: "image/png" }); // where data is your 
Uint8Array
var url = URL.createObjectURL(blob);
var image = new Image();
image.src = url;

But I don't see anything wrong with putting them in the HTML. For more 
flexibility you could create the HTML via a template engine or something but I 
would only load them from JS if there is a good reason to do so.

While you are updating your code you can remove the two dependencies on 
bootstrap (as they are not satisfied anyway and I think the whole fpReport dir 
is superflous) and perhaps do something about the flickering of the text 
(although this may be a little bit too much asked).

> It feels really nice to have my first Pascal web application running! 
Not dissing you or your work or pas2js but I fail to see the web application 
part. There is no communication between client and server. Actually there is no 
server side code at all and there is no interactivity. In my book this is a 
static page, but perhaps I miss something.

> Well, I could do it in Java before but that isn't as universal as 
> JavaScript.
For this concrete project you could have done it with pure JS which would be 
about 950 lines less of JS code. ;)

Nonetheless, nice work.

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

Re: [fpc-pascal] Convert to int64 note

2017-07-14 Thread Reimar Grabowski
On Fri, 14 Jul 2017 17:58:16 +0200
Mattias Gaertner  wrote:

> longint is type. longint() is a typecast.
Thx, now you ruined my amazingly funny response which would have delighted the 
list members for the whole weekend perhaps even up to the middle of next week.
It was so hilarious that every random three words of it would have been an 
instant viral meme but you couldn't wait for 5 minutes longer to put your 
plain, boring facts in everyones face. Thanks, again.

And then you don't even answer the question of the TC.
Now I have to do it for you:

Dear James,

use typecasting, it's good.

R.
___
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-05-31 Thread Reimar Grabowski
On Wed, 31 May 2017 10:47:40 -0400
"James Richters"  wrote:

> It's a word with:
> 5bits red, 6bits green, and 5bits blue like this:
> 
> RGGB
> 
> I'm not sure what that's called
RGB565, maybe?

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

Re: [fpc-pascal] GLM library alternative?

2017-05-30 Thread Reimar Grabowski
On Mon, 29 May 2017 14:07:40 -0400
Anthony Walter  wrote:

> By the way, what's stopping you guys from using OpenGL ES 2.0?
It's ten years old, the current ES version is 3.2.
It has less functionality than "standard GL" as it's meant for embedded systems 
(hence ES).

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

Re: [fpc-pascal] GLM library alternative?

2017-05-29 Thread Reimar Grabowski
On Sat, 27 May 2017 16:52:21 +0700
Ryan Joseph  wrote:

> Not having glm::perspective or glm::lookAt is enough to really stop you in 
> your tracks and running off to Google for hours.

Then perhaps you have to improve your google skills. ^^

https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluPerspective.xml
https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluLookAt.xml

Has all the info you need to implement them.

Unoptimized pascal versions (but fast enough for general use):

function TCamera.LookAt(Eye, Center, Up: TVector3): TMatrix4x4;
var
  View, Right: TVector3;
  TransMatrix: TMatrix4x4;
begin
  View:=Normalized(fCoV-Position);
  Right:=Normalized(CrossProduct(View, Up));
  Up:=CrossProduct(Right, View);

  Result[0][0]:=Right.X;
  Result[1][0]:=Right.Y;
  Result[2][0]:=Right.Z;
  Result[3][0]:=0;

  Result[0][1]:=Up.X;
  Result[1][1]:=Up.Y;
  Result[2][1]:=Up.Z;
  Result[3][1]:=0;

  Result[0][2]:=-View.X;
  Result[1][2]:=-View.Y;
  Result[2][2]:=-View.Z;
  Result[3][2]:=0;

  Result[0][3]:=0;
  Result[1][3]:=0;
  Result[2][3]:=0;
  Result[3][3]:=1;

  Result:=MultglMatrix(IdentityMatrix4x4, Result);
  TransMatrix:=IdentityMatrix4x4;
  TransMatrix[3][0]:=-Eye.X;
  TransMatrix[3][1]:=-Eye.Y;
  TransMatrix[3][2]:=-Eye.Z;
  Result:=MultglMatrix(Result, TransMatrix);
end;


function TScene.BuildPerspectiveMatrix(FoV, AspectRatio, NearPlane,
  FarPlane: GLfloat): TMatrix4x4;
var
  XYMax, XMin, YMin, Width, Height, Depth: GLfloat;

begin
  XYMax:=NearPlane*tan(FoV*pi/360);
  YMin:=-XYMax;
  XMin:=-XYMax;
  Width:=XYMax-XMin;
  Height:=XYMax-YMin;
  Depth:=FarPlane-NearPlane;

  Result[0][0]:=(2*NearPlane/Width)/AspectRatio;
  Result[0][1]:=0;
  Result[0][2]:=0;
  Result[0][3]:=0;

  Result[1][0]:=0;
  Result[1][1]:=2*NearPlane/Height;
  Result[1][2]:=0;
  Result[1][3]:=0;

  Result[2][0]:=0;
  Result[2][1]:=0;
  Result[2][2]:=-(NearPlane+FarPlane)/Depth;
  Result[2][3]:=-1;

  Result[3][0]:=0;
  Result[3][1]:=0;
  Result[3][2]:=-2*(FarPlane*NearPlane)/Depth;
  Result[3][3]:=0;
end;

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-19 Thread Reimar Grabowski
On Fri, 19 May 2017 12:32:17 +0100
Graeme Geldenhuys  wrote:

> And no, I don’t agree that this is a “special case”.
Doing lots of calculations in a tight loop is more or less a special case.
On the other hand I have written quite some code that doesn't do much else than 
computing lots of stuff the fastest way possible.

> It’s a g*d d*mn game engine I tried to implement.
Here I beg to differ. You tried to implement a game engine but that doesn't 
make it one (no offense intended).
Game engines never, ever, ever use the brute force approach unless it's trivial 
for your hardware to deal with.
Raycasting was used in Wolfenstein and then dropped. Doom already used BSPs 
which is completely different and way faster.
Looking at what the 'engine' does it should run on a phone but you need a high 
end rig to reach interactive frame rates.
But I get where you are coming from and you are IMHO not so wrong with that 
opinion.

> If the FPC team wants to keep thinking 
> like that, then they should list in big bold letters (on the Free Pascal 
> homepage) what type of applications they deem fit for FPC, and what type 
> of applications you shouldn’t bother writing with FPC.
It's not explicitly stated but by hanging around on this list long enough I got 
the impression that for raw speed you should just go somewhere else. Maybe FPC 
can be fast if you know all the knobs and handles and how to push and turn them 
but I don't have to do that for other languages so it's just less hassle.
C/C++ and Java being the usual suspects. Im sure the FPC developers are not 
ignoring the performance differences to the aforementioned languages but you 
know that the team is small and other stuff is deemed more important which 
considering that not many people need that much performance is the right thing 
to do.

> As I mentioned, I'll profile the application under both FreeBSD and 
> Windows over the weekend and post my finds.
Just profiling doesn't give you much. Jon profiled on 32-bit with gprof and I 
did it on 64-bit with callgrind.
Findings: nearly all the time is spent in the render function, floor is slow 
(but it's in other languages, too).
Fast ASM-floor gives about 25% gain (8->10 fps), replacing floor by cast-to-int 
gains ~33% (8->12fps) [only compiled with -01 as all other optimizations crash 
in the map making procedure]. And it gives div-by-zero errors of course 
(dimLength).

Final: The render function takes about 90%, the cast-to-int about 5%. No other 
interesting functions shown. So the missing time must be spent doing floating 
point math and branching (ifs), as that's all the render function does.

> But as far as I'm concerned, 
> there is nothing wrong with the way the program has been implemented.
FWIW I think so, too.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 17:07:47 +0200 (CEST)
Michael Van Canneyt  wrote:

> Giving people advice that they should use perl instead of FPC for math is 
> simply insulting.
But Python is ok?

Btw. everyone knows that you do your math in C if you do Python or Perl.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 08:40:43 -0700
Jon Foster  wrote:

> I limited run time to 10secs, and used "time" to verify actual run time. 
> Here are the results, time output listed first and the first section of the 
> gprof output without comments:
A little of topic but did gprof just work like it used to?
I remember last time I tried to profile with gprof I could not get it to work 
and even asked about this on this list and was suggested alternatives.
Has there been something fixed or is it by chance that it works?

> The code that is slow appears to be all standard floating point and integer 
> math
AFAIK floating point math is done using the extended type (as the gprof output 
shows) and there are no optimizations for single or double.
Correct me if I am wrong.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 17:06:39 +0200 (CEST)
Michael Van Canneyt  wrote:

> And here I was thinking that math is what computers are for... :/
Back in the day, yes.
But nowadays computers do strings.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 22:04:19 +0700
Ryan Joseph <r...@thealchemistguild.com> wrote:

> > On May 18, 2017, at 9:58 PM, Reimar Grabowski <reimg...@web.de> wrote:
> > 
> > No, they should not.
> > It's no real world problem, just a test program. A real game would be done 
> > differently and then FPC is fast.  
> 
> Asking honestly, so you don’t think there’s anything troubling about a 8 fps 
> vs 40 fps from the same code? After I looked at the code I didn't see 
> anything strange about it so it just got me thinking, if that code can be 
> that slow how slow is all the stuff I’m writing on a daily basis? It’s just 
> worrying that’s all. 

Honestly, if I would use FPC on a daily basis I would have profiled Graemes 
code the moment it came to my attention but I don't so ...
As my FPC use is currently only hobby I don't care as much.
But to be fair when I coded my little learning 3D OpenGL engine 15+ years ago 
with FPC, I was able to reach nearly the peak performance triangle throughput 
of my card so it was fast enough and nowadays even more calculations be can 
moved to the GPU.
And without joking you can do games in Python just fine if you use your GPU. 
You can do great stuff in the browser as well with WebGL and JS is clearly not 
faster than FPC.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 21:00:48 +0700
Ryan Joseph  wrote:

> That’s right. I’d really like to know what the hell FPC is doing to make it 
> so slow (besides the call to Floor()). The compiler team should be worried 
> about this also I would think.

No, they should not.
It's no real world problem, just a test program. A real game would be done 
differently and then FPC is fast.
People don't do math on computers so raw calculation speed is not important.
Compiler optimizations would be nice but are hard to do and the project has not 
enough contributors.
Being on many platforms doesn't make the task easier.

Long story short:
Wanne do PacMan in 160x100 resolution, no problem for FPC.
Wanne do something more modern, use something fast like Python or Perl.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 15:53:46 +0200 (CEST)
Michael Van Canneyt  wrote:

> Yes, it was.
Don't tell me which mail I replied to, that's just rude.

> The complaint of Graeme was that a FPC ray tracer is much slower slower than 
> an 
> equivalent raytracer in Java. All the rest are diversions from the original 
> subject.
Are you a moderator now?
Graeme never complaint about anything raytracing related. 
Could you at least try to understand the differences between raytracing and 
raycasting, please?
The original subject is about the CRT units. All the rest are diversions from 
the original subject.

I just wanted a little explanation from Marco about one of his sentences and I 
get you with lacking reading comprehension and impolite attitude.
Awesome.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 08:45:59 -0500
nore...@z505.com wrote:

> On 2017-05-18 07:42, Reimar Grabowski wrote:
> > Camera position?
> > OpenGL has no concept of a camera.  
> 
> When I toyed around with Andorra3D it had some concept/code for a 
> Camera, but he may have added it with his own code, not sure if he used 
> built in directx/opengl code
15+ years of OpenGL here and I can tell you it has no camera and never had one.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 20:38:44 +0700
Ryan Joseph  wrote:

> I only have some game experience but it’s common to need to perform some sort 
> of viewport culling/sorting before you can send the data to OpenGL.
In general there is no sorting needed and culling is better done on mesh level 
than vertex level.
Culling can be really fast if you do it correctly and don't overdo it.
Sending everything you want to draw every frame is definitely wrong for most 
applications.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 20:32:57 +0700
Ryan Joseph  wrote:

> > On May 18, 2017, at 8:23 PM, Graeme Geldenhuys 
> >  wrote:
> The compiler must be doing something really stupid for it mess up like that 
> but how can we know?
By getting the source of Graemes test, using a profiler on it and having a look 
at the results?

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 14:26:18 +0100
Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote:

> On 2017-05-18 14:21, Reimar Grabowski wrote:
> > Yes, I get that, but the interesting point is what does the profiler say?
> > Where are the bottlenecks?  
> 
> The full source code was posted in the Lazarus Forum (I supplied links 
> to those) - so knock yourself out.
Thanks but no thanks.
I thought you had at least tried to identify them as that's what I generally do 
when performance is sub par (for whatever language or project).

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 14:23:41 +0100
Graeme Geldenhuys  wrote:

> This thread is getting a bit ridiculous - just like the Lazarus Forum 
> thread did. Bottom line is, the exact same code (identical, just the 
> language syntax that differed) produced acceptable results with GCC and 
> Java. It didn't with FPC. We all now know FPC doesn't do such a great 
> job at optimisation (I know the reasons why), and that the graphics 
> API's is also not to blame.
This we know for years.
The bottlenecks would have been interesting to show if there could be something 
done to improve the situation. Just stating that it's slower doesn't help.

> So lets leave it at that.
Seems to be better.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 09:59:03 +0100
Graeme Geldenhuys  wrote:

> The difference: As explained by somebody after I did a quick google 
> search to save time:
> 
> "
> wolfenstein3d used raycasting. Raycasting is based on sending out a 
> "ray" along each line of sight from the viewer, and incrementally moving 
> along that line of sight until the ray hits an object."

That's a raycasting renderer.
Raycasting in itself is even less.
It's just the act of casting one or multiple rays and checking for 
collisions/intersections for whatever purpose.
Can be used for example for user selection of objects in 3D scenes, collision 
detection of bodies in physics engines or advanced lighting effects.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 14:52:25 +0200 (CEST)
Michael Van Canneyt  wrote:

> > Why do you have to *calculate* *all*?  
> 
> Because you want to create an image ? That's what a ray-tracer does AFAIK.
But raytracing isn't the subject here and never was.
Graemes raycasting isn't the subject here either.
 
> I'm not an expert, but I remember writing POVRay scenes that took forever to
> calculate e.g. a chess board with pieces on it. Admittedly, a long time ago.
POVRay is a benchmarking tool ^^

> You assume that you have a GPU to do a lot of work for you...
Yes, because that's what we are talking about.
I replied to this:

"On Wed, 17 May 2017 09:57:11 +0200 (CEST)
mar...@stack.nl (Marco van de Voort) wrote:

> In our previous episode, nore...@z505.com said:
> > 
> > i.e. if you end up using opengl, or its successor, why does it even 
> > matter if FPC pure games without any libs are slow?  
> 
> You still need to calculate all the vertices that you send to the graphics
> card, even if the GPU renders then."

You see OpenGL is a given, as is the rendering on the GPU.

The question is why do I have to *calculate* *all* vertices that I sent to the 
graphics card.
I am really interested in where this train of thought comes from or if I am 
missing anything because I am quite sure that you don't have to and mostly 
don't do.
But only Marco can tell what he meant with his comment.

> because it renders on screen, but what if you don't want to render the scene 
> on 
> screen, but in a bitmap, without GPU...
Well, if it's without GPU then there surely is no need to "calculate vertices" 
before sending them to the graphics card, or is there?
And personally I would just render the scene in a bitmap with GPU. No reason to 
not use the hardware you are provided on any system down to raspberry pis. But 
rendering to bitmaps is the basis for really boring games. ;)

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 09:23:02 +0100
Graeme Geldenhuys  wrote:

> All this was done using 
> the software raycaster, and Java gives me 40 FPS very consistently in 
> 800x600 resolution (actually 320x200 upscaled to 800x600 - giving the 
> nice pixelated effect).
I don't doubt that Java is fast (actually it's currently my most used language) 
but 320x200 (original Doom resolution) and 40 FPS on your rig is amazingly slow 
as well.

> My code in the Lazarus Forum showed an attempt to simply move (fly) 
> through a much smaller 3D world, but it couldn't come close to the 40 
> FPS mark I saw with Java. As I said, it barely reached 8 FPS.
Yes, I get that, but the interesting point is what does the profiler say?
Where are the bottlenecks?

R.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Reimar Grabowski
On Thu, 18 May 2017 09:02:45 +0100
Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote:

> On 2017-05-17 14:28, Reimar Grabowski wrote:
> > But I don't get why you have to *calculate* *all*.  
> 
> The CPU (your program) calculates all the 3D vertex points, as objects 
> (made out of vertex points) move through the scene. Lots of triangles 
> really.
Nonsense.
Most of the time you just load the vertex positions from file. No calculations 
at all.
And even if you calculate your objects most are static (meaning their vertex 
positions in object space do not change). So they are calculated once and then 
sent to the GPU once.
Animations are mostly done sending scalars/matrices/quaternions as uniforms to 
the corresponding shader.
Skeletal animation may be done on the CPU (if you need the fully transformed 
mesh for anything CPU side, but you seldom do).

> The GPU calculates the individual pixel colors based on those vertex 
> points (using shaders and textures).
You mean fragment colors not pixel colors.

> eg: CPU calculates 3 points of a 
> triangle. 
> The GPU calculates all the points between those 3 points, 
> making up the triangle color.
> The GPU also does clipping calculations 
> based on the viewpoint (camera position) in the 3D scene.
Camera position?
OpenGL has no concept of a camera.
Clipping is done based on the clip-space positions of the vertices after the 
last vertex processing stage.

> So if you work out how many vertex points there are,
Some million for a typical game scene, which makes it sound scary to calculate 
them all every frame when you only have 16ms to do user input 
processing/sound/physics/enemy AI/etc. if you target 60fps. Heck even 32ms is 
not much and that's as low as you can go.

> compared to 
> everything that the GPU has to do (a LOT more points and calculations), 
> the CPU does relatively little in comparison.
And still too much.

So the question remains:

Why do you have to *calculate* *all*?

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-17 Thread Reimar Grabowski
On Wed, 17 May 2017 10:57:58 +0100
Graeme Geldenhuys  wrote:

> On 2017-05-17 06:12, nore...@z505.com wrote:
> > But any game ends up using opengl anyway, doesnt' it?  
> 
> They shouldn't have too. I love the retro style low-fidelity games. They 
> are perfectly possible to implement without OpenGL using GCC or Java. 

Na, having 30 or 45 FPS while doing absolutely no gameplay hardly qualifies.
There are collision detection/response, maybe a physics engine, player input 
reaction, sound processing and enemy "AI" which will all bring the framerate 
down.
And most successful (meaning released on consoles and not only on steam) retro 
low-fi looking games nowadays are done using Unity or Unreal Engine.
Even if their style looks old the graphics are often much more complex to 
render than what you would think.

> But I couldn't achieve the same with FPC - what this whole discussion 
> was about in the Lazarus Forum (and now here it seems).

If you identify the bottlenecks there may be a solution.

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

Re: [fpc-pascal] FPC Graphics options?

2017-05-17 Thread Reimar Grabowski
On Wed, 17 May 2017 09:57:11 +0200 (CEST)
mar...@stack.nl (Marco van de Voort) wrote:

> You still need to calculate all the vertices that you send to the graphics
> card, even if the GPU renders then.

Can you elaborate?
I know you have to *transfer* *most* vertices to the GPU (not the ones that are 
created on the GPU side obviously, think tesselation or geometry shaders).
But I don't get why you have to *calculate* *all*.

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

Re: [fpc-pascal] WebAssembly Target

2017-04-24 Thread Reimar Grabowski
On Wed, 12 Apr 2017 08:49:08 -0500
nore...@z505.com wrote:

> Why run webgl through javascript if you could just make something like a 
> flash plugin object (like youtube videos) that plays opengl scenes using 
> some native format similar to how flash uses SWF files, or whatever?
First of all you don't run anything through anything. Web/OpenGL (ES) are in 
effect just a bunch of commands sent to the driver. It is not really impacted 
by the language from where you call it. It is just a graphics library 
Second OpenGL scenes are not played, they are interactive.
Third people don't want to deal with (buggy) plugins they want sh!t that just 
works across browsers.

> It seems like almost the web browser is trying to become Emacs, 
> everything and the kitchen sink, though...
Maybe, but "direct" (yeah I know it's not really direct, that's what Vulcan is 
for) access to your graphics card inside the browser is IMHO a nice feature.
 
> If it includes opengl or webgl, and video players
That's what your graphics card/chip gives you even on low end systems like the 
pi out of the box, so why not expose this inside the browser?

> under the sun.. it makes me wonder whether we should really not be going 
> back to exe's again... I.e. if you want to download a opengl 
> application, you just download an exe/elf program instead of running it 
> in the web browser ;-)
Only that the stuff in the browser seldom is what you call an OpenGL 
application (whatever that term means) and as noted above people are not going 
to download apps for stuff like this.
Examples:

https://arachne.dainst.org/3d?id=2
http://www.chaostoperfection.com/
http://www.zamaniproject.org/index.php/ethiopia-3d-model-of-medhane-alem.html
http://cabinetdecuriosites3d.mnhn.fr/fr/content/cro-magnon-1-homo-sapiens
http://vcg.isti.cnr.it/3dhop/demos/capsella/index_capsella.html

R.

Btw, all the links above will infect your computer with all kinds of nasty 
malware. Clicking them will kill every first-born egyptian child, etc
You have been warned, so go there on your own risk
 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] WebAssembly Target

2017-03-17 Thread Reimar Grabowski
On Thu, 16 Mar 2017 11:14:17 +
Graeme Geldenhuys  wrote:

> And I am pleasantly surprised! :)  That demo worked perfectly on my
> system. Sound, animation, graphics all silky smooth. Impressive indeed.

If running a 3 year old iOS Demo in a browser when we have seen Unreal 
Tournament 3 being playable there 4 years ago is impressive is debatable.
For me the impressive thing is that FireFox with WebAssembly manages to show 
the same performance as Chrome without it. Having them run side by side both 
fullscreen I can see no performance difference at all.
Perhaps the JS side is doing so little that it hardly matters (as it should be, 
when doing WebGL you want to do as much on the GPU as possible).
First benchmarks indicate that there isn't much of a performance increase with 
the current WebAssembly implementation over pure JS anyway.
The benefit is that you can 'run C code' in the browser and that's currently it.
Having a WebAssembly target for FPC would surely be nice (more options) but 
hardly a game changer currently.
In my little experience with WebGL the JS performance was never that big of a 
problem but getting lots of data into the browser without the transfer being 
super slow or the browser consuming alot more memory than it should.

R.

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

Re: [fpc-pascal] Underscores in numerical literals - grouping

2016-11-22 Thread Reimar Grabowski
On Tue, 22 Nov 2016 12:41:37 +
Graeme Geldenhuys  wrote:

> hahaha... I love how a con is “fundamentally different concept”. How is
> that a con?
Fundamentally different to the way current IDEs/editors process their text -> 
too much work for a feature no one gives a flying f**k about.
Got it?

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

Re: [fpc-pascal] FPC 3.0.0 and gProf

2016-10-19 Thread Reimar Grabowski
On Wed, 19 Oct 2016 14:36:05 +0200
Jonas Maebe  wrote:

> On Linux, kcallgrind or oprofile, I guess (make sure to compile your  
> code with -gv for both).

Thanks, will give them a try.

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


Re: [fpc-pascal] FPC 3.0.0 and gProf

2016-10-19 Thread Reimar Grabowski
On Wed, 19 Oct 2016 07:39:30 +0200
Jonas Maebe <jonas.ma...@elis.ugent.be> wrote:

> Reimar Grabowski wrote:
> > are there any known problems with gprof?  
> 
> No, but on the other hand it's not something that many people use

What do people use to profile their programs?

> On which platform?

Sorry, Ubuntu 16.04 64-bit
 
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] FPC 3.0.0 and gProf

2016-10-14 Thread Reimar Grabowski
Hi,

are there any known problems with gprof?
Mantis says no but when enabling gprof support in my Lazarus project I get a 
segfault in gmon.c when running it.
Any compiler switches I should check for that may interfere or other hints?

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


[fpc-pascal] Socket error when shutting down fpHttpServer

2016-09-29 Thread Reimar Grabowski
Hi,

here is the code (FPC 3.0.0):

var
  Server: TMyServer;

procedure HandleSig(sig : cint); cdecl;
begin
  writeln('SIGTERM received');
  if (Assigned(Server)) then begin
Server.Active:=False;
  end;
end;

begin
  FpSignal(SIGTERM, signalhandler(@HandleSig));

  Server:=TMyServer.Create(nil);
  try
Server.Port:=12345;
WriteLn('Start server');
Server.Active:=True;
  finally
writeln('Free server');
FreeAndNil(Server);
writeln('Server freed: ',Server=nil);
  end;
  writeln('Done');
end.


Here the output:

Start server
SIGTERM received
Free server
Server freed: TRUE
An unhandled exception occurred at $004D05C9:
ESocketError: Could not accept a client connection on socket: 3, error 22


How am I supposed to stop the server?
I installed the signal handler since 'Server.Active:=True' is blocking and I 
want to use the heaptrc unit (btw setting active to false inside the servers 
HandleRequest procedure works but that's not the road I want to take).

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


Re: [fpc-pascal] Does FCL Image support transparency?

2016-09-19 Thread Reimar Grabowski
On Mon, 19 Sep 2016 20:00:54 +0200 (CEST)
Michael Van Canneyt  wrote:

> Maybe you can share your code, so we can improve the base class ?
It's just a trivial change to the Draw function and IMO there is little gain 
implementing it like this for TFPCustomCanvas, but here you go:

-add variables: NewColor, DstColor: TFPColor; alpha: double;

-replace: colors [r,t] := image.colors[xx,t-y] with

begin
  DstColor:=colors[r,t];
  NewColor:=image.colors[xx,t-y];
  alpha:=0;
  if NewColor.alpha>0 then alpha:=NewColor.alpha/65535;
  NewColor.red:=round((NewColor.red*alpha)+DstColor.red*(1-alpha));
  NewColor.green:=round((NewColor.green*alpha)+DstColor.green*(1-alpha));
  NewColor.blue:=round((NewColor.blue*alpha)+DstColor.blue*(1-alpha));
  colors[r,t]:=NewColor;
end;

As you can see this is (SrcColor*ScrAlpha)+DstColor*(1-SrcAlpha) and since I 
blend RGBA on RGB images there is no need to care about destination alpha.
FPCustomCanvas should IMHO allow many different blending equations (think 
Photoshop/Gimp blending of layers).
How about something like:

begin
  if assigned(BlendFunc) then begin
DstColor:=colors[r,t];
SrcColor:=image.colors[xx,t-y]; 
colors[r,t]:=BlendFunc(SrcColor, DstColor);
  end else
colors [r,t] := image.colors[xx,t-y];
end;

hih

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


Re: [fpc-pascal] Does FCL Image support transparency?

2016-09-19 Thread Reimar Grabowski
On Fri, 16 Sep 2016 20:31:30 +0200 (CEST)
Michael Van Canneyt  wrote:

> I would say it is a bug.
Then StretchDraw is bugged, too.
Or it's no bug at all and TCustomCanvas is just missing alpha blending 
functionality.

I ended up deriving my own canvas class and implementing the desired 
functionality there.

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


Re: [fpc-pascal] Does FCL Image support transparency?

2016-09-16 Thread Reimar Grabowski
On Fri, 16 Sep 2016 17:48:33 +0200 (CEST)
Michael Van Canneyt  wrote:

> > Can FCL Image do this and if not what are my alternatives?  
> 
> It should be able to do this, yes.

Ok, but what am I missing since it's not working here.

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


[fpc-pascal] Does FCL Image support transparency?

2016-09-16 Thread Reimar Grabowski
Hi,

I want to put watermarks on images in a command line application.
This doesn't do the trick:

ScaledImage:=TFPCompactImgRGBA8Bit.Create(Width, Height);
Canvas:=TFPImageCanvas.Create(ScaledImage); // TFPImageCanvas
Canvas.StretchDraw(0,0,Width,Height,Image); // Image is TFPCompactImgRGB8Bit 
Canvas.Draw(0,0,Watermark); // Watermark is an TFPCompactImgRGBA8Bit

Watermark is a transparent PNG loaded from disk but the transparency is not 
respected when drawing it onto ScaledImage.

Can FCL Image do this and if not what are my alternatives?

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


Re: [fpc-pascal] Smartphone apps in FPC

2016-03-19 Thread Reimar Grabowski
On Thu, 17 Mar 2016 11:08:01 +0100 (CET)
Michael Van Canneyt  wrote:

> - Use the Android SDK, using the JVM compiler.
> I have written several articles on how to use the latter approach; 
> I wrote a real-world app with it. 
But you don't own a smart phone and have never heard of 'long click'
like in android.view.View.OnLongClickListener ^^

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


Re: [fpc-pascal] Smartphone apps in FPC

2016-03-19 Thread Reimar Grabowski
On Thu, 17 Mar 2016 17:29:23 +0100 (CET)
Michael Van Canneyt  wrote:

> Obviously they are not so essential as you seem to think ?
You are right, they are not.
They are only useful to access strange chars like "0"-"9" or "!@#$%&*?/ etc." 
which are not often used in passwords or user names. But of course it depends 
on the used virtual keyboard and the chars can be accessed in other ways.
I am sure you really never encountered 'long clicks' (no irony or sarcasm here) 
and you never really looked too deep into the API Guides about Android UI 
that's what amazes me.
 
> The biggest stumbleblock (and even so) was parsing JSON and sending JSON to a 
> server.
Jackson (external) and HttpURLConnection (part of the API) do the trick very 
easily but I know nothing about how FPC accesses API classes and even less how 
it can use external Java libs (fcl-json could not be used?).

I apologize if I did offend you.

R.

Tip of the day: There is no double click listener in Android.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Smartphone apps in FPC

2016-03-18 Thread Reimar Grabowski
On Thu, 17 Mar 2016 15:49:50 +0100 (CET)
Michael Van Canneyt  wrote:

> But, I do have an emulator, and plenty of people in the building do have a
> smartpone :-)
> 
> Amazing, eh ? :)
Not really.
But it's amazing that you wrote articles and a real-world application and in 
the process never stumbled upon 'long clicks' especially as they are essential 
in Androids keyboard input.
Never tried to input an Umlaut on an Android virtual keyboard?
Perhaps the concept is not as clearly identifiable as I thought or Google has 
hidden the OnLongClickListener interface too well.
It's also amazing that 'not owning' a smart phone was just an excuse as you 
clearly have interacted with smart phones (yes, even emulated ones count).

Thought better of you. (-1)
Shame on you. (-1)
Amazed me twice (+2)
---
Final Score: 0

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


Re: [fpc-pascal] IfThen() intrinsic removed

2016-02-05 Thread Reimar Grabowski
On Fri, 5 Feb 2016 12:08:57 +0100
LacaK  wrote:

> Why not just reuse C:
>x := condition ? truevalue : falsevalue ;
> As stated before.
> May be only for {$COPERATORS ON}
> (So it will not influence Pascal language, but for those who want use 
> it, can enable this syntax using switch)

Are you new here???

1. Because it's C.
2. Because it looks like C.
3. Because it smells like C.
4. Because it behaves like C.
5. It would actually be useful for making porting C code easier.
6. No 100+ mails thread needed to discuss what the best way is to make it look 
pascalish and not break code.
7. Did I mention that it is C (and C++, Java, JS)?

For me that is the only syntax I would like to see (and therefore use) it as I 
am used to it but knowing the pascal community I refrained from participating 
in the thread and it's really a minor feature.

Hopefully there will never be atrocities like a+=1. ^^

Please never name the unholy language on this list again.

R.

P.S.: It's all good fun, I know that C/C++ are not for everyone.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] GLExt crashing

2016-01-29 Thread Reimar Grabowski
On Fri, 29 Jan 2016 11:30:25 +0700
Ryan Joseph  wrote:

> Is it available in any version before 2.0 do you know? 
No. 

> I don’t know much about OpenGL but there is a 1.5 version also which maybe 
> has it.
Of course it has it but it is OpenGL 1.5 not OpenGL ES 1.5.

> I found this page also which suggests it exists on some 1.x version.
> http://stackoverflow.com/questions/17457327/blending-issue-porting-from-opengles-1-0-to-2-0-ios
It's not in the specs so maybe Apple just added it for their implementation. 
You may want to take a look at the corresponding C header files provided by 
Apple.

Btw official specs and header files can be found here: https://www.khronos.org/

R.

P.S.: If your hardware allows move on to shader based OpenGL as the fixed 
function pipeline is inefficient on modern hardware and it teaches bad habits 
(like immediate mode usage or usage of glMatrix* calls). 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Loading PNG files as OpenGL textures

2015-10-12 Thread Reimar Grabowski
On Sun, 11 Oct 2015 16:36:56 +0700
Ryan Joseph  wrote:

> is there any more complete examples I could look at?

http://sourceforge.net/p/asmoday/code/HEAD/tree/trunk/asmtypes.pas#l203

Not an example but a straightforward texture class implementation based on 
TFPCustomImage. Should work as is for bmp, jpg, png, tga, xpm, if not drop me a 
line.

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


Re: [fpc-pascal] EpikTimer v1.0.1 released

2014-05-28 Thread Reimar Grabowski
On Wed, 28 May 2014 10:35:47 +0200
Michael Schnell mschn...@lumino.de wrote:

 But how to decently provide a fully released version of EpikTimer to not 
 Lazarus enabled users of fpc ?

https://github.com/graemeg/epiktimer/releases

Download. Extract. Copy needed file(s). Profit.

Where is the f** problem?

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


Re: [fpc-pascal] Castle Game Engine 5.0.0 release

2014-05-05 Thread Reimar Grabowski
On Sat, 03 May 2014 21:35:17 +0200
Michalis Kamburelis michalis.ka...@gmail.com wrote:

 Hi everyone,
 
 The main engine site, with 
 detailed list of features, links to downloads and documentation, is on
 
http://castle-engine.sourceforge.net/engine.php

Hi,

I am evaluating your engine for a little project.
First I have looked everywhere but not found how physics are handled. It does 
not look like there is an integrated engine but I have not found any 
documentation on how and which external engines can be used either. Can you 
tell me where to find the information?
Second I am not sure that I understood correctly what kind of animations are 
supported. If I export my animations from blender, can I export the armature 
(bones) and get access to them in your engine or is it only key frame 
animation. Key frame animations would not be enough for me since at least some 
animations need to be physics based and not predefined.

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


Re: [fpc-pascal] Castle Game Engine 5.0.0 release

2014-05-05 Thread Reimar Grabowski
On Mon, 05 May 2014 23:21:46 +0200
Michalis Kamburelis michalis.ka...@gmail.com wrote:

 Contributions are very, very welcome here of course :)
Thought so, but I am looking for a solution not for more work. :)
 
 However, current exporter from Blender-X3D does not export Blender 
 animations in any way to X3D... As a solution, for now, you can export 
 Blender animations to KAnim ( 
 http://castle-engine.sourceforge.net/blender.php ), which is really just 
 a sequence of 3D models that is intelligently merged by engine when 
 loading.
In short I am looking for an engine with real time skinning support as I need 
the animations to be created in real time based on physics (think ragdoll but a 
little different). That's something a sequence of 3D models cannot provide.

Thanks for the answers but looks like I have to look somewhere else.

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


Re: [fpc-pascal] problem with the opengl unit

2014-05-04 Thread Reimar Grabowski
On Sat, 3 May 2014 20:48:02 +0200
YuGiOhJCJ Mailing-List yugiohjcj-mailingl...@laposte.net wrote:

 I am not looking for learning OpenGL, I just want a minimal example to be 
 sure that my OpenGL unit is working correctly.
 Do you have something like that?
There should be some in fpcsrcdir/packages/opengl/examples/.

hih

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


Re: [fpc-pascal] Re: [Bulk] Re: Namespaces Support

2013-11-05 Thread Reimar Grabowski
On Tue, 5 Nov 2013 07:10:21 -0800 (PST)
leledumbo leledumbo_c...@yahoo.co.id wrote:

  The packages are defined using directories. Is Java a mess too? 
 
 Yes, exactly, that's what makes Java package system messy. It makes 
 refactoring (or restructurization) extremely difficult for deep package 
 hierarchy.
Java has no package hierarchy it's just names. It has no concept of 
sub-packages it's just folders.

R.

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


Re: [fpc-pascal] Re: [Bulk] Re: Namespaces Support

2013-10-29 Thread Reimar Grabowski
On Mon, 28 Oct 2013 21:48:33 -0400
Dmitry Boyarintsev skalogryz.li...@gmail.com wrote:

 Is it much different than just extending the prefix M to MFP?
Of course it is not, actually it's about the same, as you know. IMHO it's not 
even a feature just another horrible idea of the Delphi guys used to get their 
VCL and FM stuff working and of course it was an entry for the 'new features' 
list of the Delphi release.
Pascal already has namespaces and they can clash. The 'new' namespaces can 
clash, too.
- two units with the same name = clash
- two prefixed units with the same prefix and the same name = clash (less 
likely than above)
- two units with the same name in two namespaces with the same name = clash 
(same as above)

It's just another 'stay compatible thing'. And that's the reason why it will be 
implemented no matter what. So arguing against it is a waste of time.
I'd be a lot happier if the 'compatability features' would be only implemented 
in mode Delphi but most likely it's easier not to and it reduces the risk of 
fragmentation.

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


Re: [fpc-pascal] Re: [Bulk] Re: Namespaces Support

2013-10-29 Thread Reimar Grabowski
On Tue, 29 Oct 2013 13:22:47 -0200
Marcos Douglas m...@delfire.net wrote:

 Do you (all) use prefix in Procedures and/or Functions too?  ;-)
Nope, we use classes and methods instead of global procedures and functions. ;)

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


Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-12 Thread Reimar Grabowski
On Thu, 12 Sep 2013 07:10:19 +0200
Jürgen Hestermann juergen.hesterm...@gmx.de wrote:

 Ahh, that's the reason:
 It's (another) sloppiness in Unix systems and has creeped into Windows from 
 there.
Unfortunately M$ hasn't implemented it correctly (like always) and enriched the 
experience with their common inconsistencies. Therefor you have the problems 
this thread is about only on windows systems and Unix-like systems don't have 
any problems at all.

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


Re: [fpc-pascal] DoDirSeparators and special filenames on Windows

2013-09-11 Thread Reimar Grabowski
On Wed, 11 Sep 2013 17:37:36 +0200
Jürgen Hestermann juergen.hesterm...@gmx.de wrote:

 And double delimiters *are* ambiguous:
 Has a (one letter) file name been forgotten or was an additional
 delimiter typed (or appended by bad programmed routines)?
Ambiguity is not defined by how the symbol came into being. You just look at 
the symbol as is.
So Mattias statement *is* correct.

 I am realy astonished that nobody seems to find anything wrong with this.
user@computer:/tmp$ mkdir hans
user@computer:/tmp$ mkdir hanspete
user@computer:/tmp$ cd hans
user@computer:/tmp/hans$ ls -la
total 12
drwxrwxr-x 3 user user 4096 Sep 11 19:13 .
drwxrwxrwt 9 root root 4096 Sep 11 19:13 ..
drwxrwxr-x 2 user user 4096 Sep 11 19:13 pete

Nothing wrong. All fine and dandy.

IEEE Std 1003.1, 2004 Edition (http://pubs.opengroup.org/onlinepubs/009695399/) 
says:

3.266 Pathname

A character string that is used to identify a file. In the context of IEEE Std 
1003.1-2001, a pathname consists of, at most, {PATH_MAX} bytes, including the 
terminating null byte. It has an optional beginning slash, followed by zero or 
more filenames separated by slashes. A pathname may optionally contain one or 
more trailing slashes. Multiple successive slashes are considered to be the 
same as one slash.

R.

Disclaimer: I know that Linux is not Unix and not Posix.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] ExtractFilePath and \ as pathdelim

2013-09-03 Thread Reimar Grabowski
On Tue, 03 Sep 2013 00:24:50 +0200
Michalis Kamburelis michalis.ka...@gmail.com wrote:

 And I really, really wish this would be changed in FPC too... That is, 
 AllowDirectorySeparators should be ['/'] on Unix, not ['/','\']. 
 Backslash is a completely normal character in Unix filenames. The 
 default value of AllowDirectorySeparators variable *should* be 
 OS-dependent, just like PathDelim and others.

+1

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


Re: [fpc-pascal] has anyone successfully written an app for iOS using Free Pascal and got it approved by Apple Appstore?

2013-08-30 Thread Reimar Grabowski
On Fri, 30 Aug 2013 19:23:18 +0800
Dennis Poon den...@avidsoft.com.hk wrote:

 Frankly, I was unhappy and I replied:
 
 It is a FREE App without advertisement or anything. I don't get any 
 reward from this app. I am mere contributing my time and effort and bore 
 the Developer License fee of USD100 and yet it seems like I am put in 
 court and required to produce evidence to prove that my volunteer app is 
 good enough for your app Store. No wonder there are many categories in 
 which Android has Free (or paid) apps but IOS does not. 

Well done, this will show 'em. Now they have no choice but to approve it. ^^

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


Re: [fpc-pascal] Re: [Lazarus] Should TObject or TComponent have a Comment property?

2013-07-12 Thread Reimar Grabowski
On Fri, 12 Jul 2013 07:07:05 +0100
vfclists . vfcli...@gmail.com wrote:

 This attitude which exists in the Pascal community needs to end.
Not really.

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


Re: [fpc-pascal] FPC / Lazarus install on Fedora 18

2013-05-23 Thread Reimar Grabowski
Is it just me or is this Fedora stuff hijacking the Android Galaxy S4 thread?
If it is not a problem of my mail client, PLEASE stop this sh!t.

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


Re: [fpc-pascal] Error: Duplicate identifier FarPointer

2013-05-16 Thread Reimar Grabowski
Same problem here but much funnier FPC message:

Makefile:2704: *** The only supported starting compiler version is
2.7.1. You are trying to build with 2.6.2. If you are absolutely sure
that the current compiler is built from the exact same
version/revision, you can try to use OVERRIDEVERSIONCHECK=1 to
override .  Stop.

So I had to use OVERRIDEVERSIONCHECK=1 to build my 2.7.1 with 2.6.2. IMHO 
that's not as intended.
But it may be a problem of the create_fpc_deb script provided by Lazarus so 
from my side there is no need for any actions.
Just wanted to share that funny message.

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


[fpc-pascal] LLVM (again)

2013-04-19 Thread Reimar Grabowski
Hi,

I have read the discussions about FPC using LLVM and the reasons against it 
(which I fully understand and support). But a friend of mine
called my attention to this: https://github.com/kripken/emscripten/wiki

From what I have seen this is quite an amazing project. And being in the 
process of deciding if I port my FPC 3D-Engine to JS or write a new one from 
scratch this would be the perfect solution if only FPC could create LLVM 
bitcode.
Since I know virtually nothing about compiler development and LLVM and it looks 
like it would not be easy to use LLVM as a backend I won't be able to change 
this.
But one can always dream.

Greetings
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] LLVM (again)

2013-04-19 Thread Reimar Grabowski
On Fri, 19 Apr 2013 14:06:44 +0200
Sven Barth pascaldra...@googlemail.com wrote:

  If you would have read the discussion about LLVM you would know that 
  emscripten was the reason that it was brought up the last time... ;)
 Sorry, it should be Since you have read ... you should know ...

It should be If I had read the discussions thoroughly... :)

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


[fpc-pascal] Warnings crti.o and crtn.o not found

2013-04-14 Thread Reimar Grabowski
Hi,

I just updated my FPC 2.7.1 from revision 23807 to 24236 and for every project 
I compile I now get warnings that crti.o and crtn.o are not found.
Does anyone know why I suddenly get the warnings?
How do I get rid of the warnings?

This is on Ubuntu 12.10 AMD64.

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


Re: [fpc-pascal] Warnings crti.o and crtn.o not found

2013-04-14 Thread Reimar Grabowski
On Sun, 14 Apr 2013 11:55:14 -0400
waldo kitty wkitt...@windstream.net wrote:

 2.7.1? that's trunk, right?
Yes.
 
 maybe this commit??
 
 Commit: 23892
 Author: florian
 Date:   Sun Mar 17 14:51:19 2013 UTC (4 weeks ago)
 Changed paths:4
 Log Message:+ warn if one of the linux libc startup code files is not 
 found

Most likely.
Now the question remains why the files are not found.
They are located in /usr/lib/x86_64-linux-gnu/.

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


Re: [fpc-pascal] Re: Selective Class Helper

2013-03-14 Thread Reimar Grabowski
On Thu, 14 Mar 2013 10:48:58 +0200
Juha Manninen juha.mannine...@gmail.com wrote:

 You consider it magnificent because you have not written anything
 complex with it.
 Please try it yourself. After haunting all the bugs causing crashes
 and memory leaks it may not feel so magnificent any more.
No C++ bashing, please. I have worked on multi million line C++ projects and do 
not think that it is a bad language. FPC is not the be all end all of 
programming languages.
Every language has it's merrits and it's flaws.

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


Re: [fpc-pascal] Does FPC 2.8.0 can actually still be called Pascal ?

2013-02-28 Thread Reimar Grabowski
On Thu, 28 Feb 2013 10:56:42 +0100
Sven Barth pascaldra...@googlemail.com wrote:

 As others already said: There are components or frameworks out there 
 that use modern Delphi features or frameworks of other languages that 
 make use of such features. Example: DSpring, which is a Delphi 
 dependency injection framework.
I did not find DSpring. Do you mean Spring4D? If this is the case I'd rather 
stay with the real thing (meaning Spring Framework for Java).

 By implementing them we can attract developers which got used to such 
 features and swear that 
 they can simplyfy work.
This I highly doubt. Why should I change languages only because FPC now has a 
feature that I already have in Java/Ruby/Groovy/etc and leave all the libraries 
and frameworks behind to get win32 only frameworks that are chasing the 
features of the multiplatform ones I left?
If you are not a Pascal guy you won't become one just because FPC supports 
closures or dependency injection or whatever.
Delphi is trying hard to stay relevant and so is FPC by following because 
becoming too different to Delphi will make the community quite a bit smaller. 
That's all there is to the new features. Pascal is a niche language and will 
stay one. There won't be the year of Pascal and suddenly thousands of 
developers start using it. You may write the next Facebook in FPC and it won't 
matter.

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


Re: [fpc-pascal] Does FPC 2.8.0 can actually still be called Pascal ?

2013-02-28 Thread Reimar Grabowski
On Thu, 28 Feb 2013 19:46:07 +0100
Sven Barth pascaldra...@googlemail.com wrote:

 Yes, sorry, I did indeed mean Spring4D. And staying with the real thing 
 does only help if you use Java...
Which was implicit. Choosing the right tool for the job (in this case Spring). 
If this means using a different language so be it.

 a PHP developer (and he likes it), but when he started a 
 bigger hobby project he had taken a look at Free Pascal and liked it.
PHP and developer in the same sentence, funny stuff. :)
And he likes Pascal because of class helpers, (upcoming) closures and all the 
other fancy new stuff? If not your anecdote does not fit the topic at hand. He 
may also like it because pascal is a nice and clean language which is easy to 
learn and not because of the new features. But your point was that new 
developers come to FPC BECAUSE it now has the stuff they are used to. And this 
I doubt.

 This event would be - in my opinion - 
 where we definitely need to stop swimming in their backwash and steer free.
My opinion has always been that neither FPC nor Lazarus should try so hard to 
be compatible. Doing your own stuff instead of following Delphi downhill has 
its benefits. But this is all up to the developers and not my business. If I 
don't like the changes, I don't have to use them. Easy as that.
Looking forward to seeing FPC 'steer free' because then I can grab my skates 
and go ice skating in hell. :)

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


Re: [fpc-pascal] Regression? Problem passing a packed record to a overriden, virtual, abstract method in fpc 2.7.1.

2013-02-26 Thread Reimar Grabowski
On Tue, 26 Feb 2013 08:58:58 +0100
Mattias Gaertner nc-gaert...@netcologne.de wrote:

 Please submit a bug report.
Done.

http://mantis.freepascal.org/view.php?id=23962

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


Re: [fpc-pascal] Regression? Problem passing a packed record to a overriden, virtual, abstract method in fpc 2.7.1.

2013-02-25 Thread Reimar Grabowski
 On Mon, 25 Feb 2013 22:59:26 +0100
 Mattias Gaertner nc-gaert...@netcologne.de wrote:
 
  And it works under 2.7.1 rev 23661:

Even with 23662 it does not work for me compiling from Lazarus. But from 
command line it works. So it is not a FPC problem.

Sorry for the noise.
Investigating further.
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Regression? Problem passing a packed record to a overriden, virtual, abstract method in fpc 2.7.1.

2013-02-25 Thread Reimar Grabowski
On Tue, 26 Feb 2013 00:02:33 +0100
Reimar Grabowski reimg...@web.de wrote:

 But from command line it works. So it is not a FPC problem.
I am really sorry for communicating with myself but I have spoken too early. 
Now I can reproduce the problem using just FPC, no Lazarus involved.
It gets triggered when compiling with range checking (-Cr) or with veryfying 
object method call validity (-CR).
At least now I know where the problem is and can workaround it by disabling 
both.
2.6.2 works correctly.

R.




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


[fpc-pascal] Regression? Problem passing a packed record to a overriden, virtual, abstract method in fpc 2.7.1.

2013-02-24 Thread Reimar Grabowski
Hi,

see the following little program:

program argumentbug;

{$MODE ObjFpc}

uses classes;

type

TVector3 = packed record
  X, Y, Z: Single;
end;

TClassA = class
protected
  fVector: TVector3;
public
  procedure SetVector(AVector: TVector3); virtual; abstract;
end;

{ TClassB }

TClassB = class(TClassA)
public
  procedure SetVector(AVector: TVector3); override;
end;

{ TClassB }

procedure TClassB.SetVector(AVector: TVector3);
begin
  writeln('TClassB: ',AVector.X,',',AVector.Y,',',AVector.Z);
  fVector:=AVector;
end;

var
  MyVector: TVector3;
  MyClassB: TClassB;
begin
  MyVector.X:=0;
  MyVector.Y:=0;
  MyVector.Z:=3;
  MyClassB:=TClassB.Create;
  MyClassB.SetVector(MyVector);
end.

Obviously the expected output is 0,0,3 but in fact the output is 0,3,3.
I am sure that this used to work as my real code showing the problem is many 
years old.
(The problem stays even if I don't declare the method in TClassA abstract.)

OS: Ubuntu 12.10 64-Bit
Compiler: FPC 2.7.1 Rev. 23655

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


Re: [fpc-pascal] dglOpenGL - GL, GLu, GLExt

2013-02-23 Thread Reimar Grabowski
On Sat, 23 Feb 2013 15:20:12 +0100
Sven Barth pascaldra...@googlemail.com wrote:

Just a little addition:
 
 In unit GLext you have functions like Load_GL_version_1_3 which will 
 load all core functions provided in OpenGL 1.3
and lower. So Load_GL_version_2_0 will call Load_GL_version_1_5 which will call 
Load_GL_Version_1_4 ...
A graphics card/driver supporting one OpenGL version is required to support the 
lower versions, too.

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


[fpc-pascal] FCL-JSON: Getting the data into pascal classes

2012-12-07 Thread Reimar Grabowski
Hi,

I have a relatively simple JSON object consisting of some integer and string 
fields and a large (500-50 entries) float array.
Following the parsedemo.pp I extract the values from JSON and put them in my 
pascal class. All works as expected only that I do not seem to find a method to 
copy the complete float array from the TJSONArray object to an array of double 
in one go. I can do it manually by traversing the array but wouldn't it be more 
convenient to have this functionality in TJSONArray (same for string, integer 
and other arrays). Am I missing something?

On another note. There is no automatic way to create an instance of a custom 
class from a TJSONObject or is there?
JSON: {fooStr:foobar,fooInt:700,fooFloatArray:[1.1, 1.2, 1.3]}
Pascal:
TMyCustomClass = class
  fooStr: String;
  fooInt: Integer;
  fooFloatArray: array of double; 
end;

Thanks for any info on this matter.
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Pass array of record as parameter

2012-02-09 Thread Reimar Grabowski
On Thu, 09 Feb 2012 19:34:06 -0500
Thomas Young tygraph...@me.com wrote:

 Howard are you saying FPC has dynamic arrays? Is it documented?
http://wiki.freepascal.org/DYNAMIC_ARRAY

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


Re: [fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

2011-12-09 Thread Reimar Grabowski
On Fri, 09 Dec 2011 07:27:46 +0100
Jürgen Hestermann juergen.hesterm...@gmx.de wrote:

 
 
 Reimar Grabowski schrieb:
  The parameter should default to FALSE to not break existing code relying on 
  FPCs random function 
 And what about existing code coming from Delphi/Turbo Pascal? This was a 
 strong argument in the past for doing even crap coding.

Not by me, but the FPC developers. I am not interested in Delphi/TP 
compatability and never was, so I don't care if Delphi/TP code works or not, 
but I care if code written exclusively in and for FPC continues to work as it 
did. I think that Delphi is a burden for FPC and Lazarus, but the developers 
have other opinions, so be it.
I don't need a change at all. It may be irritating for a Delphi developer that 
his code runs slower, but profiling is no secret art and changing a random 
implementations to a less 'good' but faster one is a matter of minutes.
Like people already said, lots of talk about a 'problem' that 10 years noone 
has seen as one.

Another 2 cents
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OpenGL ES bitmap drawing

2011-11-26 Thread Reimar Grabowski
On Fri, 25 Nov 2011 17:53:13 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 So far I managed to get this:
 
 http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/lcl/interfaces/customdrawn/customdrawnobject_android.inc?view=markuproot=lazarus

After a quick look I have some questions:

It looks like you are using lit geometry, any reason for that?
Why do you enable blending after drawing and at all?
Why do you set up your matrices after drawing? (See Jeppes remark about 
glDrawArrays)
Why do you enable texturing after drawing? (You only loose the first frame as 
for the next it will be enabled, but it is strange nonetheless)
You said there is a pixel format mismatch. AFAIR your texture should be white 
if something is wrong with it, but I am not 100% sure in case of a format 
mismatch.

To debug:

Disable blending, texturing, lighting and face culling and just draw a colored 
quad to check if your matrix setup in combination with placement of the quad in 
the world is correct.
Reenable face culling and check.
Reenable texturing and check (fix your pixel format mismatch before that).
Reenable lighting if needed.
Reenable blending if needed.
Be generous with glGetError calls see
http://www.khronos.org/opengles/documentation/opengles1_0/html/glGetError.html.

hope it helps
R.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] OpenGL ES bitmap drawing

2011-11-26 Thread Reimar Grabowski
On Sat, 26 Nov 2011 16:30:31 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 What is lit geometry? Google didn't help me here.
Geometry is anything you draw in OpenGL (in CG the term mesh is preferred) and 
lit just means that you use lighting and must therefor provide normals, take 
care of setting the lights, etc.
 
 I just want to draw a 2D image which fills the entire screen. I don't
 want any 3D at all. Only 1 texture which covers the entire screen.
Here is my OpenGL (note not ES) textured fullscreen quad code, ripped 
directly from my engine: 

  glMatrixMode(GL_MODELVIEW);
  glPushMatrix;
  glLoadIdentity;
  glMatrixMode(GL_PROJECTION);
  glPushMatrix;
  glLoadIdentity;
  glDepthFunc(GL_LESS); -- you don't need this if you disable the depth test 
before drawing
  glColor3fv(@BackgroundColor); -- color can be set using the ordinary 
glColor3f/4f functions instead 
  glBindTexture(GL_TEXTURE_2D, BackgroundImage.id); -- texture is already set 
up, but your set up code looked ok, so I don't post mine 
  glBegin(GL_QUADS); -- this is not supported in ES as you have to use 
attribute arrays (like in your code)
  glTexCoord2d(0, 1); glVertex3f(-1, -1, -1); -- these values must be stuffed 
in your attribute arrays only that you have to adjust the texture coordinates 
to your needs (see below)
  glTexCoord2d(1, 1); glVertex3f(1, -1, -1);
  glTexCoord2d(1, 0); glVertex3f(1, 1, -1);
  glTexCoord2d(0, 0); glVertex3f(-1, 1, -1);
  glEnd;
  glPopMatrix;
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix;

Note: No call to glOrtho, just indentity matrices for projection and modelview. 
Lighting and blending is disabled when I call this function.

 The worse part here is that with the power of two limitation it seams
 that I will have a lot of problems, because with this limitation I
 can't match correctly the screen format. Usually the screens are 2x3
 in proporsions, but power of two allows only 1x2 from what I
 understand.
Nope, the only problem is that you need more texture memory for your image. Say 
your screen size is 640x480. Because of the pot limitation your texture must be 
1024x512. Since you only want to render the 640x480 part of the texture to your 
quad you need to adjust your texture coordinates accordingly. Texture 
coordinates are in the range 0 to 1. But as you do not for example want the 
rightmost texel of the whole texure but the rightmost one of your smaller image 
you have to use 0.625 (1024/640) instead of 1. The same for the Y-coordinate.

Unfortunately we have left the realm of FPC programming and wandered of into 
the wonderful world of OpenGL. Perhaps a place dedicated to OpenGL development 
is better suited for this problem.
You may take a look at the NeHe OpenGL examples. They are available in many 
different languages (including delphi) and cover most of the basic stuff.

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


Re: [fpc-pascal] OpenGL ES bitmap drawing

2011-11-26 Thread Reimar Grabowski
On Sat, 26 Nov 2011 21:32:45 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

snip 
LOGW('[engine_draw_frame]'); // --- I see this tons of times
I hope it is printed every 16ms, else you won't reach 60 fps. ;)

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


Re: [fpc-pascal] TDOMElement and multiple attributes

2011-03-21 Thread Reimar Grabowski
On Fri, 18 Mar 2011 20:16:08 +0100
Mattias Gaertner nc-gaert...@netcologne.de wrote:

 Maybe Reimar can give an example when it does not work.
I am to lazy to attach the code, so here it is (you should know how to get it 
into Lazarus without too much hassle :) ):

program xmlattributes;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Classes, SysUtils, CustApp,
  DOM, XMLWrite;
type

  { TXMLAttributes }

  TXMLAttributes = class(TCustomApplication)
  protected
procedure DoRun; override;
  public
  end;

{ TXMLAttributes }

procedure TXMLAttributes.DoRun;
var
  ErrorMsg: String;
  Document: TXMLDocument;
  RootNode, Node: TDOMNode;
begin
  try
Document:=TXMLDocument.Create;
RootNode:=Document.CreateElement('ROOT');
TDOMElement(RootNode).SetAttribute('someAttrib', 'someValue');
Document.AppendChild(RootNode);

RootNode:=Document.DocumentElement;
Node:=Document.CreateElement('SomeNode');
TDOMElement(Node).SetAttribute('aaaAttribute', '1');
TDOMElement(Node).SetAttribute('aAttribute', '2');
TDOMElement(Node).SetAttribute('ccAttribute', '4');
TDOMElement(Node).SetAttribute('bAttribute', '3');
RootNode.Appendchild(Node);

WriteXMLFile(Document, 'test.xml');
  finally
Document.Free;
  end;

  // stop program loop
  Terminate;
end;

var
  Application: TXMLAttributes;

{$R *.res}

begin
  Application:=TXMLAttributes.Create(nil);
  Application.Title:='XMLAttributes';
  Application.Run;
  Application.Free;
end.

someone@somewhere:~/pascal/Projects/xmldemo$ cat test.xml 
?xml version=1.0?
ROOT someAttrib=someValue
  SomeNode aAttribute=2 bAttribute=3 ccAttribute=4 aaaAttribute=1/
/ROOT

Looks like the order is governed by the length of the attribute name first and 
then alphabetically.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] TDOMElement and multiple attributes

2011-03-18 Thread Reimar Grabowski
On Fri, 18 Mar 2011 16:02:10 +0100
Mattias Gaertner nc-gaert...@netcologne.de wrote:

 Why do you need to order them?
I don't need to, I just want to and the reason is simply aesthetics. So no big 
deal that it is not possible.
Btw is there any comprehensible reason behind the order which SetAttribute 
uses? It is not alphabetical and not the order of the SetAttribute calls.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] TDOMElement and multiple attributes

2011-03-18 Thread Reimar Grabowski
On Fri, 18 Mar 2011 17:08:49 +0100 (CET)
michael.vancann...@wisa.be wrote:

 Probably determined by hashvalue or the AVL tree order.
That makes sense, thank you for the info.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Moving callbackfunctions to class

2010-12-31 Thread Reimar Grabowski
On Fri, 31 Dec 2010 14:03:27 +0100
Darius Blaszyk dhkblas...@zeelandnet.nl wrote:

 Unfortunately I need a platform independent method to handle this. So 
 assembler is not really the way I want to go, unless it proves to be the only 
 way.

Now you know why I called glut a major PITA and using platform dependent 
assembler code to wrap a cross platform lib is just not right. Why don't you 
look at the context creation code of either TOpenGLContext from Lazarus or the 
equivalent component from GLScene (yes, it is more difficult than glut but not 
that difficult)? Glut is just not meant for the things you are doing with it 
and you are working around restrictions which other context creation mechanisms 
just don't have. But feel free to ignore my advice as it is your time you are 
wasting.

Happy new year and good luck.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] fpGUI powered by OpenGL

2010-12-20 Thread Reimar Grabowski
On Mon, 20 Dec 2010 15:50:52 +0100
dhkblas...@zeelandnet.nl wrote:

  But why is it not possible to integrate this with the regular fpGUI ?
  Can you explain in a couple of sentences ?
 
  Thats not all however, there are minusses. By using glut, you limit 
  yourself to the supported platforms/targets. So if new platforms/targets 
  come along then there is no way (unless you supply patches to the 
  project) to add them. With the current approach you're free to do it 
  yourself. Also the API is plain rigid. This means you'll have to adapt 
  to that and live with it (notice it's a plus and minus depending on how 
  you look at it). (That is why I would like to see a fpGlut some day ;) 
  and believe me it will come to that eventually!)
First of all good work, but I hope to never see any abominations like fpGlut 
around. Glut is just a major PITA and should not be used by anybody for 
anything serious. It was developed to make it easy to write SIMPLE OpenGL DEMOS 
in a cross plattform way. Since then it has been used for all kinds of stuff 
although it has some big limitations namely its mainloop and the callback 
shenanigans. Both interfere with the nature of a GUI framework and therefor I 
don't really understand why you based your work on glut. OpenGL is a graphics 
lib and glut includes window creation, mouse and key handling, etc which should 
be separate.
You don't need glut to use OpenGL you just need a valid context. I don't know 
anything about the inner workings of fpGUI but if you think that a fpGlut would 
help you then I am sure a fpOpenGLContext would help even more and perhaps make 
it possible to merge the code back to regular fpGUI.
Benefits of custom context generation are that you have more control over its 
options (ColorBuffer-, DepthBuffer-, OtherKindOfBuffers-Resolution, double-, 
triple-, quadbuffering, etc.), no mainloop or callbacks (the TOpenGLContext of 
the LCL works with the standard LCL event system and application mainloop) and 
no need for glut support on the target platform (every OpenGL capable platform 
exposes a way to create a context).
The drawback is that context generation is a little more complex than using 
glut and that it is platform dependend. I haven't looked into the new OpenGL 
stuff  3.0 but I know there was talk about simplifying context generation and 
to try to make it more similar on the different platforms.
So IMHO getting rid of glut and integrating an OpenGL context into fpGUI should 
make it possible to just use OpenGL as a standard backend for fpGUI. I am not 
really interested in doing this myself but if you need help I will do what I 
can.

hih
R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problem with OpenGL drawing on Linux

2010-12-10 Thread Reimar Grabowski
On Fri, 10 Dec 2010 00:47:41 +0100
Jeppe Johansen jepj...@es.aau.dk wrote:

 A quick search seems to indicate that that one has a persisting 
 problem with glLineStipple
Works as expected with the NVIDIA driver here, so the driver may really be the 
problem.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Working Free Pascal android JNI example

2010-11-10 Thread Reimar Grabowski
On Sat, 6 Nov 2010 23:43:58 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 Here is a tutorial:
 
 http://gimite.net/en/index.php?Run%20native%20executable%20in%20Android%20App
 
 It just uses standard Android Java API calls AFAIK
Thanks for the tutorial, but as you surely have read (see comments) there are 
problems using this approach. And I won't hardly call it officially supported 
as it is a little hackish.
 
  Since you cannot distribute this kind of software via official channels 
  (market and the like) it is not of much use.
 
 Google does not impose this kind of limit on market applications. As
 long as you have the standard installer packages and has a stub Java
 program calling our Pascal app it should be fine.
That is true but I was talking about running native FPC apps directly without 
calling them from Java.

  Also I don't really know how to interact with these kinds of programs
 
 The most workable that I found is through pipes between the Java and
 the FPC app.
And this is fast enough for realtime interaction?
If this is the case then it is a really nice solution.
I am mostly interested in touch input and the sensors.

  or how to run a GUI.
 
 This is the tricky part. The obvious answer is OpenGL ES.
When it comes to graphics OpenGL is always the answer. ;)

Do you have any working example code?

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Working Free Pascal android JNI example

2010-11-06 Thread Reimar Grabowski
On Sat, 6 Nov 2010 18:39:53 +0100
Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote:

 Did you try making executables for Android? It is possible to run
 native executables from Java.
It is not my code but I know a bit about Android.
I don't know of any way running native executables from Java on this platform. 
It is definitly not officially supported.
You can run native FPC progs on Android devices via the development tools 
circumventing the official way to install software. You can start this progs 
from your pc but not from the device itself. Since you cannot distribute this 
kind of software via official channels (market and the like) it is not of much 
use. Also I don't really know how to interact with these kinds of programs or 
how to run a GUI.
 
 That would be somewhat better then running the code from a .so
True, but as it is not supported there is no better way than to run your code 
from a lib. At least it is native then and you get the performance improvements.
To my knowledge it is currently the best way to use FPC on Android. You must 
remember that Android apps are not really complete programs (as you know them) 
but some special Java classes that are run from an 'app manager'. You don't 
have the kind of control you know from conventional programs.

hih
R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Can variables be declared within a block?

2010-10-20 Thread Reimar Grabowski
On Tue, 19 Oct 2010 21:18:03 +0100
Vannus van...@gmail.com wrote:

 your example is at the start of a for loop block, which is much the same
 as having it at the start of a procedure block
So much the same that you can do it in pascal?
What about variables declared inside this for loop or inside the else block of 
an if statement.

 pascal prevents people from putting declarations strewn throughout the
 block, which i found reduces mistakes  bugs from 20-30 people coding, and
 their code is more readable. Coding standards are do similar thing.
You were talking about wrong code, not more readable code (which is very 
subjective in this case). So it looks like there is nothing wrong using this 
feature if it is available as you failed to show me that there is a problem. 
But it does not make much sense to discuss this here any further as it is not 
available in FPC.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Can variables be declared within a block?

2010-10-18 Thread Reimar Grabowski
On Mon, 18 Oct 2010 19:21:57 +0100
Vannus van...@gmail.com wrote:

 Since then, i would say If you need vars throughout your code, then
 something is wrong with your code
for (int i = 0;...)
Can't see anything wrong. I use declaration of variables inside blocks quite 
often in Java and C++ but have never missed it in pascal. Please enlighten me. 
What is so bad about creating temporary variables inside blocks instead of the 
beginning of a function in a language that supports it?

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Optimized matrix multiplication functions for pascal?

2010-10-09 Thread Reimar Grabowski
On Sat, 9 Oct 2010 14:42:47 +0200
Bo Berglund bo.bergl...@gmail.com wrote:

 Where can I find such functions?
 I am not a matematician myself so I don't know what these 
 functions really do...

Take a look here: http://www.j3d.org/matrix_faq/matrfaq_latest.html

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Optimized matrix multiplication functions for pascal?

2010-10-09 Thread Reimar Grabowski
On Sat, 09 Oct 2010 16:40:12 +0200
Adriaan van Os f...@microbizz.nl wrote:

 Matrix functions can be implemented efficiently using SSE, see e.g. 
 http://www.cortstratton.org/articles/OptimizingForSSE.php.
FPC can generate the SSE instructions for you on compilation. My tests showed 
that this is faster than writing the functions using SSE myself. If you have 
written matrix routines using SSE that are faster than mine written in pascal 
and optimized by the compiler I am really interested in seeing them.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Questions regarding arrays

2010-09-22 Thread Reimar Grabowski
On Thu, 23 Sep 2010 00:49:29 +0200
Michael Müller mueller_mich...@alice-dsl.net wrote:

 Another problem is often to free memory in Pascal that was allocated by C.
Having done some interaction with C libs IMHO the best option is not to free 
the memory in pascal at all but doing it with the provided C functions (if the 
lib does not do the freeing automatic, that is).

In cases like Graemes I always used leledumbos approach which never failed me.

type
  PAtom = ^TAtom;
  PPAtom = ^PAtom;

This gives you access to the array but the memory management is done entirely 
by the lib/C-code.

hih
R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Help translating C++ to Object Pascal

2010-09-14 Thread Reimar Grabowski
On Tue, 14 Sep 2010 11:50:31 +0200
Graeme Geldenhuys graemeg.li...@gmail.com wrote:

 Hi,
 
 In a C++ method as shown below, does the '... return True;' immediately
 exit the HandleClientMessage method
Yes.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Ideas for namespace implementation

2010-07-26 Thread Reimar Grabowski
On Mon, 26 Jul 2010 12:14:26 +0200
Graeme Geldenhuys graemeg.li...@gmail.com wrote:

 Just to show how ugly unit names look with prefixes.
 eg:
   tiUtils.pas   vs   tiutils.pas vs utils.pas

Is this really a problem that warrants time to develop and test a solution?
Two letters?
Well, it is your time after all.
So I vote for the solution that is the least intrusive, meaning that I don't 
have to change my code much or at all.

Thanks
R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Ideas for namespace implementation

2010-07-26 Thread Reimar Grabowski
On Mon, 26 Jul 2010 11:23:31 -0300
Marcos Douglas m...@delfire.net wrote:

 IMHO, is better to use the ':' like  myspace:sysutils

Even better C++ style:
 
uses
  myspace::sysutils;
 
begin
  Exception; // no error
  SysUtils.Exception; // identifier not found
  MySpace::SysUtils.Exception; // no error
end.

R.
-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


  1   2   >