Re: [fpc-pascal] fpc isn't optimised for tail recursion, is it?

2023-06-12 Thread Michalis Kamburelis via fpc-pascal
Steve, If you're looking for equivalent to "return X", use "Exit" with a parameter in Pascal: "Exit(X)". It's just a shortcut for "Result := X; Exit;" Regards, Michalis pon., 12 cze 2023 o 19:57 Steve Litt via fpc-pascal napisał(a): > > Nikolay Nikolov via fpc-pascal said on Mon, 12 Jun 2023

Re: [fpc-pascal] What is -CO ?

2023-06-09 Thread Michalis Kamburelis via fpc-pascal
I'm also curious :) I just tested, and the -Co (lowercase "o") enables overflow checking by default (like "{$Q+}" in code), https://github.com/michaliskambi/modern-pascal-introduction/wiki/What-are-range-and-overflow-checks-(and-errors)-in-Pascal . But -CO (uppercase "O") seems unrelated to it.

Re: [fpc-pascal] Programming Pascal using an AI Chatbot

2022-12-31 Thread Michalis Kamburelis via fpc-pascal
The chatbot is quite amazing :) I wrote about my nicest moments on https://castle-engine.io/wp/2022/12/17/my-mind-is-blown-i-can-use-ai-to-generate-castle-game-engine-code-to-integrate-it-with-physx-i-can-use-ai-to-generate-html-documentation-from-comments-in-pascal-code/ -- generate Pascal code

Re: [fpc-pascal] Strange "division by zero" error using variants

2022-05-24 Thread Michalis Kamburelis via fpc-pascal
That's a funny interaction between Variants and Pascal's ambiguous (logical or bitwise) "and" :) Both the operators and the types are ambiguous -> making the boolean short-circuit evaluation not possible. Indeed one workaround is to cast the variants to Booleans explicitly, which makes it use

Re: [fpc-pascal] FPC 3.2.0 released!

2020-06-21 Thread Michalis Kamburelis via fpc-pascal
Great news! Thank you to the FPC team for all magnificent work. I maintain Docker images with FPC (with various versions and cross-compilers, with Castle Game Engine and some related tools), see https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ and

Re: [fpc-pascal] Using docker to build software

2019-06-04 Thread Michalis Kamburelis
Torsten Bonde Christiansen wrote: > Hi List. > > I am curious to know if there is someone out there that have tried to > use Docker (https://www.docker.com) containers to build fpc applications? > > I have 3 applications in a suite that I am thinking of experimenting > with, see if I can create

Re: [fpc-pascal] TFPGObjectList error

2018-06-30 Thread Michalis Kamburelis
Ryan Joseph wrote: > > > Or you could use Generics.Collections unit with generic TList for > > records. It by default compares records by comparing memory contents. > > Is that part of the RTL and if so what’s the unit name? I had a hard time > finding good resources on classes the RTL provides.

Re: [fpc-pascal] TFPGObjectList error

2018-06-30 Thread Michalis Kamburelis
2018-07-01 4:01 GMT+02:00 Vojtěch Čihák : > this seems to be misleading error message. TFPGObjectList works well for > objects (classes). When I tried to push record to it, I got the same error > message. TVec3 is not class, right? Indeed, it's a misleading message. The message ...identifier

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-09 Thread Michalis Kamburelis
2018-05-10 4:08 GMT+02:00 Marco van de Voort <mar...@stack.nl>: > In our previous episode, Michalis Kamburelis said: >> >> 1. XBox One. It uses an operating system based on Windows 10. As such, >> maybe compiling FPC programs for it is already possible (or is easy to >

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-09 Thread Michalis Kamburelis
2018-05-10 4:05 GMT+02:00 Dmitry Boyarintsev <skalogryz.li...@gmail.com>: > On Wed, May 9, 2018 at 9:38 PM, Michalis Kamburelis > <michalis.ka...@gmail.com> wrote: >> >> This would mean that it is impossible to openly distribute an open-source >> code interfa

Re: [fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-09 Thread Michalis Kamburelis
The more I was reading about console development, the more I understood that the main problem are NDAs that seem to still "guard" the information about each consoles closed APIs. This would mean that it is impossible to openly distribute an open-source code interfacing with e.g. PlayStation

[fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

2018-05-09 Thread Michalis Kamburelis
Hi, I am wondering about the possibility to port Castle Game Engine to modern gaming consoles. Summary (TL;DR): - Is it possible to use FPC to compile programs/libraries for one of the gaming consoles mentioned in the subject? - If it is not possible *yet*, how easy it would be to add such

Re: [fpc-pascal] pas2js Webgl unit committed

2018-05-01 Thread Michalis Kamburelis
Ryan Joseph wrote: > > > > On May 1, 2018, at 9:56 PM, Michael Van Canneyt > wrote: > > > > You must do > > gl := TJSWebGLRenderingContext(canvas.getContext('webgl')); > > > > because getContext can return various classes depending on the

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

2018-04-30 Thread Michalis Kamburelis
2018-05-01 4:50 GMT+02:00 Ryan Joseph : > > >> On Apr 25, 2018, at 9:43 PM, Michael Van Canneyt >> wrote: >> >> Ah, webgl... >> >> I had a look at this some time ago, and got depressed. Quickly closed the >> browser and didn't look back. Same

Re: [fpc-pascal] Read comments via fcl-passrc

2018-04-23 Thread Michalis Kamburelis
Michael Van Canneyt wrote: > > > On Mon, 23 Apr 2018, Michael Fuchs wrote: > > > Am 23.04.2018 um 12:43 schrieb Mattias Gaertner: > >>> I found TPasTreeContainer.NeedComments but it does nothing. > >> > >> Set that to true. Then create the parser. > > > > Ok, so I can not

Re: [fpc-pascal] Managed properties idea

2017-10-06 Thread Michalis Kamburelis
2017-10-06 23:55 GMT+02:00 Maciej Izak : > ... and here is library with exclusive usage of "management operators" for > FPC: > > https://github.com/pda0/AutoScope > > ... and here is experimental smart pointers/objects/nullable types > implementation: > >

Re: [fpc-pascal] Managed properties idea

2017-10-06 Thread Michalis Kamburelis
2017-10-06 21:49 GMT+02:00 Michalis Kamburelis <michalis.ka...@gmail.com>: > 2017-10-06 20:52 GMT+02:00 Marcos Douglas B. Santos <m...@delfire.net>: > [...] >>> In this case, in which you indeed want two of these features simultaneously, >>> I advise

Re: [fpc-pascal] Managed properties idea

2017-10-06 Thread Michalis Kamburelis
2017-10-06 20:52 GMT+02:00 Marcos Douglas B. Santos : [...] >> In this case, in which you indeed want two of these features simultaneously, >> I advise COM interfaces myself :) That's why they are documented after all. > > I can use it only to use reference counting. You can,

Re: [fpc-pascal] Managed properties idea

2017-10-06 Thread Michalis Kamburelis
05.10.2017 2:07 PM "Marcos Douglas B. Santos" napisał(a): On Thu, Oct 5, 2017 at 5:55 AM, Ryan Joseph wrote: > >> On Oct 5, 2017, at 12:28 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: >> >> The way to go in Object Pascal

[fpc-pascal] Castle Game Engine 6.0 released

2017-02-18 Thread Michalis Kamburelis
Hi, We're proud to release Castle Game Engine 6.0, an open-source 3D and 2D game engine for Object Pascal. This release is a culmination of more than a year of intensive engine development. The main feature is that almost every part of the engine got significant improvement, and we have more

Re: [fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-05 Thread Michalis Kamburelis
2016-10-05 9:00 GMT+02:00 Maciej Izak <hnb.c...@gmail.com>: > > 2016-10-05 4:32 GMT+02:00 Michalis Kamburelis <michalis.ka...@gmail.com>: >> >> For example, the call >> >> Format('%s', [123]) > > > I have a small hint (instead of answer). We hav

[fpc-pascal] Checking the validity of Format and friends at compile-time

2016-10-04 Thread Michalis Kamburelis
Hi, I'm wondering if there is a tool that checks the correctness of calls to Format and friends (like Exception.CreateFmt) in your code. Or does someone plan to write one, as an external tool (like a "lint") or inside the FPC compiler:) For example, the call Format('%s', [123]) is guaranteed

Re: [fpc-pascal] corba interfaces - is/as not working properly

2016-09-30 Thread Michalis Kamburelis
2016-09-30 18:19 GMT+02:00 stdreamer <stdrea...@freemail.gr>: > On 30/09/2016 17:24 μμ, Michalis Kamburelis wrote: >> >> 4. And how about going even more further, and just generate an >> internal GUIDs (random, or based on a memory address) when no GUID is >&g

Re: [fpc-pascal] corba interfaces - is/as not working properly

2016-09-30 Thread Michalis Kamburelis
This thread, and my own tests, showed that you need to assign GUIDs to interfaces to have reliable "is", even for CORBA interfaces. I'm wondering, would it be possible to improve here things on the compiler side (at least only in FPC-specific modes or under some modeswitch), to make things safer?

Re: [fpc-pascal] Cross platform mobile development

2016-09-07 Thread Michalis Kamburelis
2016-09-07 18:41 GMT+02:00 Ryan Joseph : > > I did enough research in Android for FPC to know I could do a simple OpenGL > game using the JNI but it didn’t look very complete and I never could get the > compiler built on my Mac. Is there enough of the Android NDK (I

Re: [fpc-pascal] GZip - Stream decompress only in memory

2016-09-04 Thread Michalis Kamburelis
2016-09-04 18:08 GMT+02:00 Marcos Douglas : > I have streams compressed using GZip. I get these streams from WebServices. > So, how can I decompress these streams only in memory? It seems you already have a solution, but here's another one:) In Castle Game Engine, I have a

Re: [fpc-pascal] Mouse, scroll wheel support?

2016-06-29 Thread Michalis Kamburelis
2016-06-28 15:05 GMT+02:00 John Youngquist : > Is there a non Lazarus means of accessing the mouse, and scroll wheel? > I have an app that uses some old driver which doesn't address the wheel. > I'm trying to make the wheel work. I have tried SDL and the demo code works > but

Re: [fpc-pascal] reference-counted function results not initialized to nil

2016-06-24 Thread Michalis Kamburelis
> After upgrading fpc 2.6.4 -> 3.0.0, I'm seeing a bug where (as noted in > subject) reference-counted function results are not being initialized to > nil. They were never guaranteed to be initialized to nil. Reference-counted types (unlike other types) cannot contain memory garbage. But it

Re: [fpc-pascal] why (ClassType as TMyClass).Create fails

2016-06-21 Thread Michalis Kamburelis
2016-06-21 15:57 GMT+02:00 Dennis : > Following up to the cloning example code: > > Type > TMyClassRef = class of TMyClass; > > implementation > > function TMyClass.Clone(AOwner: TComponent): TMyClass; > begin > Result := TMyClassRef(ClassType).Create(AOwner); > > //but

Re: [fpc-pascal] Bls: Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-21 15:03 GMT+02:00 Sven Barth <pascaldra...@googlemail.com>: > Am 21.06.2016 12:31 schrieb "Michalis Kamburelis" > <michalis.ka...@gmail.com>: >> Current FPC defaults: >> >> - Help people who except the {$mode fpc} to be default (so they write

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-21 12:14 GMT+02:00 Marco van de Voort <mar...@stack.nl>: > In our previous episode, Michalis Kamburelis said: >> >> - A section about TPersistent.Assign. This is the "basic approach to >> cloning" that should probably be shown first. See it here: >&g

Re: [fpc-pascal] Bls: Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
>> I even expect a bit further. These {$MODE OBJFPC}, {$H+}, and {$J-} >> directives should be the *default* directives for every new FPC >> programs/units. We're now using Free Pascal compiler on 2016. Why do we need >> to explicitly declare Free Pascal mode in a Free Pascal program? In 21st >>

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
> |I remember someone once asked whether we should override the method Assign > or AssignTo.| > |I am worried, choosing the wrong method to override will produce unexpected > result.| The AssignTo is only used by TPersistent.Assign, so it's a "fallback" --- if class A cannot copy *from* B, then

Re: [fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-21 8:15 GMT+02:00 Marc Hanisch : > Thanks Michalis for your excellent work! It's very important to left the > early 90s associated with Pascal programming behind us and to encourage new > developers to have a look onto the modern aspects of Object Pascal! > >

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-20 14:30 GMT+02:00 Marcos Douglas : > Don't agree with "Ugly (COM) interfaces". Yeah, _AddRef, _Release, > QueryInterface is ugly implementation but reference-counting mechanism > is nice. > Reference-counting is a useful concept, but "entangling" it with interfaces is

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-20 11:44 GMT+02:00 Mark Morgan Lloyd : [...] > I'd suggest warning readers early about "dangling else", and using otherwise > rather than else in the case examples. As for dangling else - good idea, I added a text and example mentioning it briefly

Re: [fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-21 Thread Michalis Kamburelis
2016-06-20 6:16 GMT+02:00 Dennis Poon : > May I suggest the addition of : > 1) user defined operator? Added. I had it on my TODO list already:) See it here:

Re: [fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

2016-06-20 Thread Michalis Kamburelis
2016-06-20 5:31 GMT+02:00 Mr Bee : [...] > I have a little suggestion though. I prefer to use {$J-} directive in my > Pascal program. I think it encourages good programming practice in Pascal. > The {$J-} means constant is a constant no matter how you declare it. To bad > FPC

[fpc-pascal] Quick Modern Object Pascal Introduction, for Programmers

2016-06-19 Thread Michalis Kamburelis
Hi, So, I wrote a document describing (quickly!) many features of the modern Object Pascal:) Read on: http://michalis.ii.uni.wroc.pl/~michalis/modern_pascal_introduction/modern_pascal_introduction.html

Re: [fpc-pascal] Smartphone apps in FPC

2016-03-22 Thread Michalis Kamburelis
2016-03-17 15:17 GMT+01:00 Paul Breneman : > I would suggest checking this out: > http://castle-engine.sourceforge.net/engine.php > https://github.com/castle-engine/castle-engine/wiki/Build-Too > Small correction, the link should be:

Re: [fpc-pascal] Building Android cross compiler error

2016-02-22 Thread Michalis Kamburelis
> /Developer/Android/android-ndk-r10e/toolchains/arm-linux- androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld.bfd: cannot find -lc pp.pas(219,36) Error: Error while linking > > Have you defined the -Fl option correctly? For example, I put something like this in

Re: [fpc-pascal] Android porting ideas

2016-02-22 Thread Michalis Kamburelis
> > > This will probably make more sense when I learn about the asset manager more. I think I read there is a format like asset:// for file URL’s. Remember that the "asset:/..." URL is just implemented in Castle Game Engine (see http://castle-engine.sourceforge.net/tutorial_network.php ).

Re: [fpc-pascal] Android porting ideas

2016-02-22 Thread Michalis Kamburelis
> I see you made a builder tool I’ll have to check out. From the Android tutorials I’ve seen building Android packages seems be pretty forward. You can run/install apps from the terminal also I think based on your documents. That’d be nice to not be in Android Studio if I don’t have to be.

Re: [fpc-pascal] Android porting ideas

2016-02-21 Thread Michalis Kamburelis
2016-02-21 23:00 GMT+01:00 Sven Barth <pascaldra...@googlemail.com>: > Am 21.02.2016 19:36 schrieb "Michalis Kamburelis" > <michalis.ka...@gmail.com>: >> > >> > 1) All the file I/O in the FPC RTL is not available so what possible >>

Re: [fpc-pascal] Android porting ideas

2016-02-21 Thread Michalis Kamburelis
2016-02-21 4:36 GMT+01:00 Ryan Joseph : > I’m going to attempt to port a game to Android but I have some questions > about potential problems. Now at least I think building a library and loading > using the JNI would be best but using the JVM could be helpful also

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-20 Thread Michalis Kamburelis
>> Right now we only have "with notifications, and not type-safe" >> containers (TObjectList/TList) and "without notifications, and >> type-safe using generics" containers (TFPObjectList/TFPList). > > > These latter 2 are not generics based. There was some experimental code > which attempted to

Re: [fpc-pascal] Primitive Record Wrappers

2016-02-19 Thread Michalis Kamburelis
2016-02-18 15:43 GMT+01:00 Mazola Winstrol : > Em 18/02/2016 10:12, "Marco van de Voort" escreveu: >> >> In our previous episode, Mazola Winstrol said: >> >end; >> > >> > >> > Suppose that this class represent data of the Person table in a sql >> >

Re: [fpc-pascal] [PATCH] Addition of OnNotify event on "TFPGObjectList" and "TFPGList" triggered on the insert, delete and extract methods.

2016-02-19 Thread Michalis Kamburelis
>> Can you send little bit sample showing this degradation? I can inform him >> to not send the patch because this problem. (I think that him isn't >> registered here in the list yet) > > There's no need for a sample. This degradation is the whole reason why the > non-generic classes TFPObjectList

Re: [fpc-pascal] New feature: IfThen() intrinsic

2016-02-01 Thread Michalis Kamburelis
Maciej Izak wrote: > +1 . IfThen instricit is IMO very bad idea. I have a lot of "IfThen" > from math and strutils modules. > > IfThen from System totally breaks the compatibility :\ . C'mon Sven. In > one field you're rigorously but in something like this you're liberal > (braking/dangerous

Re: [fpc-pascal] GLExt crashing

2016-01-29 Thread Michalis Kamburelis
Ryan Joseph wrote: > Is it available in any version before 2.0 do you know? I don’t know > much about OpenGL but there is a 1.5 version also which maybe has > it. > Before OpenGLES version 2.0 (shader pipeline), you only have OpenGLES 1.1 and OpenGLES 1.0. See

Re: [fpc-pascal] GLExt crashing

2016-01-28 Thread Michalis Kamburelis
Ryan Joseph wrote: > Just tested on iOS and I get that error. I think on iOS it loads from the > OpenGLES.framework and therefor this is failing. Also that load function > wasn’t available but it failed upon including the GLExt unit. > > An unhandled exception occurred at $0001000CDEF7: >

Re: [fpc-pascal] GLExt crashing

2016-01-28 Thread Michalis Kamburelis
Ryan Joseph wrote: > I’m using OpenGLES 1.1 because it was easier to learn but I don’t see > glBlendEquation being included in the GLES11 unit. Maybe it didn’t > exist until OpenGLES 2.0? > Indeed, glBlendEquation is simply not available in OpenGLES 1.1. See the specs:

Re: [fpc-pascal] FreeGLUT on Windows

2015-12-24 Thread Michalis Kamburelis
Ryan Joseph wrote: > I’m trying to learn some basics of Windows and porting some OpenGL > code. The first step is getting an OpenGL context prepared but I’m > already stuck here. > I would recommend our Castle Game Engine http://castle-engine.sourceforge.net/ . It can be used together with

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

2014-05-05 Thread Michalis Kamburelis
Reimar Grabowski wrote: On Sat, 03 May 2014 21:35:17 +0200 Michalis Kamburelis michalis.ka...@gmail.com wrote: The main engine site, with detailed list of features, links to downloads and documentation, is on http://castle-engine.sourceforge.net/engine.php First I have looked everywhere

[fpc-pascal] Castle Game Engine 5.0.0 release

2014-05-03 Thread Michalis Kamburelis
Hi everyone, We're proud to announce the release of Castle Game Engine 5.0.0 :) Castle Game Engine is an open-source (LGPL) 3D and 2D game engine, of course for modern Object Pascal (FreePascal / Lazarus). We support many 3D formats and various graphic effects. The main engine site, with

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

2013-09-02 Thread Michalis Kamburelis
Mattias Gaertner wrote: Hi all, ExtractFilePath and ExtractFileDir stops at last '/','\', so it treats the normal character \ as path delimiter under Unix. Is there a RTL function that handles the \ as normal character? You can change global AllowDirectorySeparators

Re: [fpc-pascal] TStream.ReadBuffer doesn't try hard enough to read the requested bytes

2013-06-16 Thread Michalis Kamburelis
Michael Van Canneyt wrote: The above implementation should not be changed, it is Delphi compatible: TStream.ReadBuffer works on the assumption that Read will always return the amount of bytes requested if they are available. So, if you want to make changes, there is no reason why TStream.Read

Re: [fpc-pascal] TStream.ReadBuffer doesn't try hard enough to read the requested bytes

2013-06-16 Thread Michalis Kamburelis
Michael Van Canneyt wrote: If an implementation of Read does not return the requested data when in fact it is available, then the implementation of Read is broken. I guess it depends how do you interpret TStream.Read documentation...

[fpc-pascal] TStream.ReadBuffer doesn't try hard enough to read the requested bytes

2013-06-15 Thread Michalis Kamburelis
Hi, I'm often reading fixed-size structures using TStream.ReadBuffer, working under the assumption that it will fail only if it's not possible to read the requested amount of bytes (that is, if the stream ended prematurely). This is actually the documented usage, see

Re: [fpc-pascal] TStream.ReadBuffer doesn't try hard enough to read the requested bytes

2013-06-15 Thread Michalis Kamburelis
Ewald wrote: And what with non-blocking pipes pipes? Wait for a *some* period until you get all data? It is up to the programmer to do this INHO. If you want to get partial data (instead of waiting until all requested data is available) you should just use TStream.Read instead of

Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

2013-03-28 Thread Michalis Kamburelis
Flávio Etrusco wrote: Members refer to each available section according to the flags. Re-read this whole paragraph you posted and a few following you'll realize only one file is allowed in a gzip file/blob. I think this confusion comes from the fact that

[fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

2013-03-27 Thread Michalis Kamburelis
Hi, Like the subject says, I'm looking for a TStream implementation that takes another TStream and compresses/decompresses data in gzip format. I would like to read/write gzip data to a stream, any TStream (maybe TFileStream, maybe TMemoryStream, maybe a stream from the network like

Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

2013-03-27 Thread Michalis Kamburelis
José Mejuto wrote: El 27/03/2013 19:22, Michalis Kamburelis escribió: Google found an old thread on lazarus mailing list about this (FPC, gzip and stream) but without any solution, everything mentioned there has either the limitations of TCompressionStream/TDecompressionStream (no gzip format

Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

2013-03-27 Thread Michalis Kamburelis
Justin Smyth wrote: I have converted the one from fpc to its own library to do streams , can email it to you later if you wish Yes, that would be appreciated. As long as everything you send me is covered by the same license as FPC RTL (LGPL with static linking exception), so that I can use

Re: [fpc-pascal] what happened to the contributed units listing?

2013-02-06 Thread Michalis Kamburelis
Michal Wallace wrote: The database of contributed pascal code seems to have disappeared: http://www.freepascal.org/contrib/db.php3 Anyone know where it went, or how to get it back? :) It's on http://www.freepascal.org/contrib/contribs.html now. But some pages may still contain old links,

Re: [fpc-pascal] [Announcement] Castle Game Engine 4.0.0 release for FPC game developers

2013-02-04 Thread Michalis Kamburelis
Victor Matuzenko wrote: Hi, I have tried to compile it under Windows XP with «make all», and got the errors: [...] Compiling src\opengl\windows\castleglwindowsfonts.pas castleglwindowsfonts.pas(81,22) Error: Incompatible types: got LongWord expected TWinCharSet A bug slipped into the

[fpc-pascal] [Announcement] Castle Game Engine 4.0.0 release for FPC game developers

2013-01-26 Thread Michalis Kamburelis
Hi, I would like to announce a release of Castle Game Engine 4.0.0, an open-source cross-platform 3D game engine for Object Pascal (only FPC/Lazarus): http://castle-engine.sourceforge.net/news.php?id=release-4.0.0 I'm letting myself post an announcement to lazarus and fpc-pascal mailing

Re: [fpc-pascal] Brook 1.0 - A new framework for web was born

2012-12-17 Thread Michalis Kamburelis
michael.vancann...@wisa.be wrote: On Sun, 16 Dec 2012, Graeme Geldenhuys wrote: On 15/12/2012 21:22, Sven Barth wrote: Maybe because the authors prefered inline comments instead of fpdoc's XML files... A shame, because the more detailed the documentation, the more it obfuscates the code.

Re: [fpc-pascal] Brook 1.0 - A new framework for web was born

2012-12-15 Thread Michalis Kamburelis
luciano de souza wrote: Yes, there is a very nice tool. Its name is Pasdoc. Take a look here: http://sourceforge.net/projects/pasdoc/ For this project, the author has changed the source code of Pasdoc. Originally, it's compatible only with HTML 4, but the documentation was released in HTML 5.

Re: [fpc-pascal] header translation question, 64 bit problem

2012-06-17 Thread Michalis Kamburelis
Bernd wrote: (Almost) The only other small discontinuity was the PNG writer from fcl-image needs to be explicitly told Indexed:=False on 64 bit while on 32 bit this was not necessary. Indexed is false by default in FPC = 2.6.1, see BTW and notes in

Re: [fpc-pascal] Re: Playing sounds with standard components

2012-06-11 Thread Michalis Kamburelis
luciano de souza wrote: I took a look in Openal examples. I need to confess that I expected something easier. Perhaps, something like: PlaySound('file.wav', 0) You need to wrap OpenAL a little to get something so simple. In my Castle Game Engine (http://castle-engine.sourceforge.net/), I

Re: [fpc-pascal] Re: Playing sounds with standard components

2012-06-11 Thread Michalis Kamburelis
silvioprog wrote: Nice project. :) castle_game_engine-3.0.0-src.zip = +-70MB. Most of the size comes from the examples, they contain also example 3D data files (models, animations etc.). I prefer to give people full package :) For those who want to get parts, they can always check out

[fpc-pascal] FpProfiler patch to compile with fpmake

2012-05-12 Thread Michalis Kamburelis
Hi, I'm not sure if anyone is actively watching the Mantis issues for FpProfiler, so I thought I'll mention it here: I submitted a patch to fix the compilation with fpmake from command-line. It's on http://bugs.freepascal.org/view.php?id=21991 Regards, Michalis

[fpc-pascal] FPC + valgrind massif problems

2012-05-10 Thread Michalis Kamburelis
Hi, I wanted to debug where my program uses the most memory. (There are no memory leaks, but I want to optimize memory usage on some large inputs. As the code is quite large, simply guessing which part is responsible becomes quite hard :) In the past, I happily used valgrind's massif tool

Re: [fpc-pascal] Group arguments from overloaded functions in fpdoc

2012-01-05 Thread Michalis Kamburelis
dhkblas...@zeelandnet.nl wrote: When you have overloaded functions, fpdoc will group them on one page. The arguments however are listed in two separate arguments sections. It would be nice to have the arguments merged in one section. I do not know how to display the arguments though (no idea

[fpc-pascal] Patch to add GLX 1.4 support

2011-08-10 Thread Michalis Kamburelis
Hi, For people working with new OpenGL features: I just submitted a patch to upgrade our GLX unit to GLX 1.4, add some new GLX extensions, and add comfortable functions to check existence of a particular GLX extension/version. This allows you to easily use modern GLX FB config functions to

[fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Michalis Kamburelis
Hi, Consider the attached source code. I have a base interface (IA) and a descendant interface (IB). Class TB is declared as TB = class(TInterfacedObject, IB) end; Now I would expect that both Supports(TB, IA) Supports(TB, IB) return true. After all, TB is forced to implement methods of

Re: [fpc-pascal] Supports() only checks declared interfaces?

2011-01-06 Thread Michalis Kamburelis
Paul Ishenin wrote: 06.01.2011 20:14, Michalis Kamburelis wrote: return true. After all, TB is forced to implement methods of both IA and IB, as IB descends from IA. But to my surprise, Supports(TB, IA) returns false. This is expected behavior. It works the same way as in delphi. Thank

[fpc-pascal] Code to send message from Python script to FPC's TSimpleIPCServer

2010-12-11 Thread Michalis Kamburelis
Just sharing, in case someone will find the below information useful, or worthy to add to some wiki or docs anywhere: I have here a daemon written in FPC that communicates with clients by very nice TSimpleIPCServer class (in SimpleIPC unit). Of course it's trivial to send a message to such server

Re: [fpc-pascal] Looking for SDL_opengl header

2010-12-08 Thread Michalis Kamburelis
Darius Blaszyk wrote: Has anyone ever converted the SDL_opengl header to FPC? Couldn't find it in the repository, but perhaps someone knows if it is part of another project. SDL_opengl.h is just (one of the) cross-platform ways to include OpenGL stuff in C programs. We don't need it in FPC,

Re: [fpc-pascal] Detecting what is the linux distro

2010-10-11 Thread Michalis Kamburelis
Marco van de Voort wrote: If your distro complies with the LSB standards (most popular distros do), then you should have a /etc/lsb-release text file that you can parse. FC11, no such file, but there is a dir lsb-release.d with the contents You're not really supposed to be looking at

Re: [fpc-pascal] playing sound files (linux and windows)

2010-06-15 Thread Michalis Kamburelis
Graeme Geldenhuys wrote: I can't find an example for loading a .wav file. [...] Any hints or sample code. The sample included in FCL 2.4.1 loads MAD, A52, OGG and ModPlug only. Google revealed a tutorial using AlutLoadWavFile(), but that is in the unofficial utilities library, it's not part

[fpc-pascal] fcl-passrc example program, and a couple of bugreports

2010-04-25 Thread Michalis Kamburelis
All the talk about the Pascal parser in fcl-passrc got me interested recently. I did some experiments, and I thought I mention here: 1. I added a simplest example how to use fcl-passrc to the wiki: http://wiki.freepascal.org/fcl-passrc 2. And reported a couple of bugs found in fpdoc (tested on

Re: [fpc-pascal] some new features to delphi prisem

2010-02-21 Thread Michalis Kamburelis
ik wrote: On Sat, Feb 20, 2010 at 20:01, Jürgen Hestermann juergen.hesterm...@gmx.de mailto:juergen.hesterm...@gmx.de wrote: y := case Other of bla : 'hello'; foo : 'bye'; baz : 'adius'; end; What do you

Re: [fpc-pascal] some new features to delphi prisem

2010-02-21 Thread Michalis Kamburelis
Graeme Geldenhuys wrote: On 21 February 2010 17:00, Michalis Kamburelis michalis.ka...@gmail.com wrote: Which also means less chance of mistake. For example, if you decide later to change y to y1, you only have to change the code in one place, not three. Unfortunately you are wrong

Re: [fpc-pascal] Assigning class method to procedure of object via class name in delphi mode

2010-01-25 Thread Michalis Kamburelis
cobines wrote: everything is ok. But I can also assign it using class name: CM.Callback := TContextMenu.ContextMenuSelect; This is the way it's supposed to work in delphi mode, as far as I remember Delphi allows it (disclaimer: I don't have Delphi now to check, but it used to be so around

Re: [fpc-pascal] [OT] which editor - emacs?

2010-01-10 Thread Michalis Kamburelis
Hans-Peter Suter wrote: PS: thanks also to the other suggestions! And if somebody uses Emacs I am still interested to hear about how it goes. Thanks again! I use Emacs most of the time to edit my Pascal (and all other :) ) code. But it has it's learning curve. And, although there are various

Re: [fpc-pascal] OpenCL

2009-12-21 Thread Michalis Kamburelis
Lourival Mendes wrote: FPC/Lazarus. Is there a project on it? Is there some thing working on Parallel programming on FPC? There are OpenCL bindings submitted to mantis, http://mantis.freepascal.org/view.php?id=15297, by Dmitry Boyarintsev. I didn't test them, as I don't have capable GPU (yet)

Re: [fpc-pascal] Re: Link libglx library.

2009-05-14 Thread Michalis Kamburelis
Guillermo Martínez Jiménez wrote: Jonas Maebe wrote: -klglx (note the extra l). I tried that: fpc -02 -Sh -FUlib/ -klglx /exbasic.pp -oexbasic But it returns that error: /usr/bin/ld: lglx: No such file: No such file or directory I look for a dev package for GLX

Re: [fpc-pascal] Re: Link libglx library.

2009-05-14 Thread Michalis Kamburelis
I wrote: Note also your error message: ./exbasic: symbol lookup error: /usr/local/lib/libagl.so: undefined symbol: glXQueryExtension This says something strange, the linker for some reason is looking for glXQueryExtension inside libagl.so. Actually, re-reading this error message, it

Re: [fpc-pascal] How to use OpenGL 2.0 features

2009-05-10 Thread Michalis Kamburelis
Lord Satan wrote: Nonetheless, I don't understand why the ARB version does not work. AFAIK it has the same entry points as the core functionality and OpenGL versions are required to support the ARB version of functions even if the non ARB version is in the core now. No. OpenGL doesn't

Re: [fpc-pascal] How to use OpenGL 2.0 features

2009-05-10 Thread Michalis Kamburelis
Lord Satan wrote: On Sun, 10 May 2009 18:46:26 +0400 dmitry boyarintsev skalogryz.li...@gmail.com wrote: So it looks like I have to init all OpenGL versions from 1.2 to 2.0 to make sure that all OpenGL 2.0 core functions are initialized. Is this true? Judging from glext, it's true. This

Re: [fpc-pascal] How to use OpenGL 2.0 features

2009-05-10 Thread Michalis Kamburelis
Lord Satan wrote: On Sun, 10 May 2009 23:47:07 +0200 Lord Satan reimg...@web.de wrote: I uploaded the patch to the bug tracker as issue #0013687 Looking quickly at the patch, it doesn't seem to set Result values correctly. For example, all Load_GL_version_xxx will always return true, if

[fpc-pascal] Workaround for #0011837 (FPC = 2.2.2 with GTK = 2.13)

2009-01-18 Thread Michalis Kamburelis
In case someone wonders how to workaround this bug http://mantis.freepascal.org/view.php?id=11837 (occurs with GTK = 2.13.4, e.g. on Ubuntu 8.10 we have GTK 2.14): I found that the quick workaround that works is to pass --noinhibit-exec to ld, that is -k--noinhibit-exec to FPC command-line. The

Re: [fpc-pascal] regex unit doesn't find matches???

2008-12-01 Thread Michalis Kamburelis
Graeme Geldenhuys wrote: Hi, I'm using the following regular expression: 'foob.*r' Calling MatchString() against each of the items in the stringlist, I expected it to match 3 items. Instead it only matches the first item and fails all the rest. Why??? --[ source code

Re: [fpc-pascal] number of cpu cores

2008-11-29 Thread Michalis Kamburelis
Florian Klaempfl wrote: Mattias Gaertner schrieb: I need a default value of the number of maximum threads. Is there already some RTL function that can be used for that? For example if the program runs on a 2 x quad core it would be nice to get 8. Hyperthreading multipliers should be

[fpc-pascal] Unable to authenticate to update entry in contributed units

2008-09-13 Thread Michalis Kamburelis
Hi, I just added an entry to contributed units (Kambi VRML game engine). Of course, two seconds later I wanted to correct it. But I can't --- looks like I cannot authenticate. And it seems it's a bug, not my bad memory. When I input my current (both now and at the time of submitting the

Re: [fpc-pascal] Save image into BMP or JPEG using Free Pascal (Save screenshot of OpenGL scene)

2008-02-20 Thread Michalis Kamburelis
Marco van de Voort wrote: Jakub Marian wrote: The image format in the memory is clearly specified, as the main use of this unit is to cooperate with OpenGL (for loading images, textures, saving screenshots etc.). See TImage class comments, basically RawPixels is simply a pointer to an array

Re: [fpc-pascal] GLext in Free Pascal does not work?

2008-02-20 Thread Michalis Kamburelis
Jakub Marian wrote: Hello, I've been trying to solve the problem with the unit GLext for some time and I am getting mad. I need to use vertex shaders written in GLSL, but I am a novice in that field so I may be doing domething wrong. I have glext in my uses. I tried just to call

Re: [fpc-pascal] GLext in Free Pascal does not work?

2008-02-20 Thread Michalis Kamburelis
Jakub Marian wrote: Well, glext_LoadExtension('GL_version_1_4') was just an example, of course that I tried Load_GL_version_2_0 and some other functions. But I get access violation when I try to call ANY function from glext. I would understand it if I got just false as a return value of a

  1   2   >