Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-11

Freepascal newbie

11 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gustavo Galembeck

Hello to all,

I'm new to Freepascal, and I have many doubts
regarding Turbo/Borland Pascal portability of DOS
progs to Win32 and Linux, hope I can get some help on this in the future. My current priority is to start developing cross-platform applications.
As my inicial question in the list, I'd like to know the best way of developing a Win32 / Linux 2D game using Freepascal. Is the PTCPas unit a good choice? Could such a game developed under WinXP be compiled directlly under Linux?

Thanks to all,
Gustavo

__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail

Nikolay Nikolov
to Gustavo Galembeck
Gustavo Galembeck wrote 5 lines
As my inicial question in the list, I'd like to know the best way of developing a Win32 / Linux 2D game using Freepascal. Is the PTCPas unit a good choice?

I translated it from C++ in 2001 and it's good enough for me. :-) It provides graphics output, keyboard input (key presses and releases) and high res timers. If that's what you want - then it may do the job :) However it doesn't do mouse input (yet) and sound output (there are some sound libraries that can be used, of course).
Oh, and people tend to use SDL, so you may want to try that, too. (it's written in C, but there are pascal bindings) I've never used it, though.

Could such a game developed under WinXP be compiled directlly under Linux?

Yes. Actually I develop on Linux and when it's ready I compile in Windows and it works :)

Gustavo Galembeck
to Nikolay Nikolov
Yes. Actually I develop on Linux and when it's ready I compile in Windows and it works :)

Thanks, Nicolay!

I cant't wait to install and mess a little with it. I thought I could go through the whole installation proccess without asking something too stupid, but
unfortunately... I still couldn't figure out how to use the fpcmake. :(
Freepascal itself is working perfectly, I compiled my older code pratically free of problems (the only ones ocurred with the asm blocks - I'll take a closer look at them later). But when I try to use "fpcmake -r" in some of the Makefile.fpc files (including the PTCPas one) I get the following error:

Error: Target "win32", package "rtl" not found

This error also occurs when I try to fpcmake the
demos/Makefile.fpc file, but strangely the
demos/[anydirectory]/Makefile.fpc ones work fine:

win32-i386 requires: rtl
Writing Makefile

After all, why sometimes the rtl package is found
and others it isn't? :(

Thanks,
Gustavo

__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com

Ron Weidner
to Nikolay Nikolov: I translated it from C++ in 2001 and it's good enough for me. :-) It provides graphics…
Show quoted text 14 lines
I translated it from C++ in 2001 and it's good enough for me. :-) It provides graphics output, keyboard input (key presses and releases) and high res timers. If that's what you want - then it may do the job :) However it doesn't do mouse input (yet) and sound output (there are some sound libraries that can be used, of course). Oh, and people tend to use SDL, so you may want to try that, too. (it's written in C, but there are pascal bindings) I've never used it, though.

Nikolay,
Why did you translate openPTC instead of some
of the other available choices? What advantages
does openPTC offer over SDL or Allegro? Do you
have any (Linux) demos/games written with openPTC
that I can take a look at? What do you think about tinyPTC?

Ron_W

__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail

Nikolay Nikolov
to Ron Weidner
Ron Weidner wrote 8 lines
Nikolay, Why did you translate openPTC instead of some of the other available choices? What advantages does openPTC offer over SDL or Allegro? Do you have any (Linux) demos/games written with openPTC that I can take a look at? What do you think about tinyPTC?

No serious reason, I just didn't know OOP and I wanted to learn that :) Another reason is at the time I was interested only in windows and this worked pretty well. I didn't want 3D-acceleration (I didn't have a good graphics card) and I wanted compatibility with all windows versions, including winNT4.0 (which features DirectX 3) and win95 and all kinds of video cards (I had a card that supported 24bpp, but no 32bpp, and I had another one that supported 32bpp but no 24bpp, so you get the idea :) ) Later I discovered the wonders of multiplatform programming - I ported the X11 code later and it worked. Unfortunately it wasn't as up to date as SDL. (must be updated to use dga2 instead of the old dga, and also support mode switching/fullscreen graphics without being root) About tinyptc - there's a delphi port somewhere on the net. But it's a very simple library and it doesn't do keyboard input and timers, so it's not very good for games, only demos. And then you still need timers :)

About games/demos - here's a small tetris clone I was just planning to release (btw I couldn't think of a better name than 'tetris' so any suggestions are welcome). What's makes it somewhat special is that it has very smooth movements of everything (with subpixel accuracy and motion blur!) Note that these aren't features of openptc/ptcpas - I'm doing everything myself pixel by pixel :)
Here's the source:
http://debian.fmi.uni-sofia.bg/~nickysn/tetris/
compiles with fpc 1.0.10 or 1.9.4+ (and uses http://ptcpas.sf.net/)

Ron Weidner
to Nikolay Nikolov
> No serious reason, I just didn't know OOP and I wanted to learn that :)

Thanks for the info ... BTW just to learn something new is as good a reason as any to do anything in my book. :)

Later I discovered the wonders of multiplatform programming - I ported the X11 code later and it worked. Unfortunately it wasn't as up to date as SDL.

The openPTC website states that there is currently no X11 code maintainer for openPTC. Kind of a bummer if you ask me because it seems like a nice lib.

Although, I wish the Pascal Community had more
interest in Allegro. For that matter, I wish that a band of Pascal programmers would rally to the cause of building new games in Pascal.

Show quoted text 6 lines
About tinyptc - there's a delphi port somewhere on the net. But it's a very simple library and it doesn't do keyboard input and timers, so it's not very good for games, only demos. And then you still need timers :)

Ahh.. code like the old days of Unix... make your code small, make it do exactly one thing very well.

Show quoted text 8 lines
About games/demos - here's a small tetris clone I was just planning to release (btw I couldn't think of a better name than 'tetris' so any suggestions are welcome). What's makes it somewhat special is that it has very smooth movements of everything (with subpixel accuracy and motion blur!) Note that these aren't features of openptc/ptcpas - I'm doing everything myself pixel by pixel :)

Nice game. It ran very smoothly as you said it would. As for a name idea, how about `stack 'n crumble` :)

Ron_W

__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail

Ron Weidner
to Ron Weidner

If there is enough interest, I'm thinking of
creating/hosting a web site devoted to the development of cross-platform games using FreePascal. This site would host game downloads, tutorial, forums, libs, community projects, and code contributed by FreePascal Gaming Community (you).

If you have something to offer to this proposed
project, I would like to hear from you.(art,
FreePascal code, game downloads, etc)

Ron_W

__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail

Lee Bowyer
to Ron Weidner

Yes, that would be good...

I may have some SDL stuff... (I don't know how 'good' it is or indeed what state the code is in...)

Ron Weidner wrote 25 lines
If there is enough interest, I'm thinking of creating/hosting a web site devoted to the development of cross-platform games using FreePascal. This site would host game downloads, tutorial, forums, libs, community projects, and code contributed by FreePascal Gaming Community (you). If you have something to offer to this proposed project, I would like to hear from you.(art, FreePascal code, game downloads, etc) Ron_W __________________________________ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Joseph Hewitt
to Ron Weidner: If there is enough interest, I'm thinking of creating/hosting a web site devoted to the…
Show quoted text 6 lines
If there is enough interest, I'm thinking of creating/hosting a web site devoted to the development of cross-platform games using FreePascal. This site would host game downloads, tutorial, forums, libs, community projects, and code contributed by FreePascal Gaming Community (you).

I've written several games in FreePascal, all of which are open source. Here's a link to my current project, GearHead:

http://www.geocities.com/pyrrho12/programming/gearhead/index.html

GearHead compiles for both Windows and Linux. I expect that it could compile on other platforms, but so far nobody has volunteered to test this.

I'd certainly be interested in learning about other FPC game developers. Let me know when your site is up and I'll include a link to it on the GearHead page.

- JH.

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Michalis Kamburelis
to Joseph Hewitt

Hi!

I'm working on a 3D game in FPC since 2 years. There are still many things to do, but also many things are already done and working. I have units to
- deal with OpenGL (including GLWindow, my own glut-replacement in ObjectPascal, able to work on top of GTK or XLib or WinAPI),
- load and process VRML 1.0 and 3DS files,
- convert from 3DS to VRML 1.0,
- render VRML 1.0 files using OpenGL or using raytracing (to images),
- create octree on VRML 1.0 files (for collision detection and raytracing),
- load and save 2d images (bmp, ppm, png (using libpng), jpg (using pasjpeg), rgbe (Greg Ward's Red+Green+Blue+Exponent format)),
- deal with OpenAL (including OpenAL library bindings and some utilities to comfortably work with OpenAL),
- deal with fonts (like rendering OpenGL and bitmap fonts in OpenGL, also converting TTF fonts to Pascal-code (so you can easily "embed" free fonts in your programs; although conversion program still needs to be rewritten using FreeType)),
- process and render in OpenGL 3d curves (rational Bezier curves, smooth interpolated curves).

There are also many generally-useful units under the hood (like
- ParsingPars, unit to parse command-line options, or
- VectorMath, unit with many vector-and-matrix operations, mainly for 3d graphics,
- MathExpr, parsing and evaluating mathematical expressions,
- TDynXxxArray classes, something like richer dynamic arrays, done like "simulated" C++ templates,
and some more...).

Of course the biggest things are units to deal with VRML. I consider VRML 1.0 handling almost complete (complete as for correctness; OpenGL rendering still could be, and should be, and will be, optimized).

It's everything pure ObjectPascal, sources GNU GPLed. Compiles and works under Linux, Win32, and FreeBSD. Basically should compile under any UNIX-like system (with FPC's Unix, BaseUnix units), since code used on FreeBSD actually does not have any "$ifdef FREEBSD", it's only generic UNIX code. i386 only for now, although someone was (is?) trying to port this to MacOS X + PowerPC, as most code is not architecture-dependent.

All demo programs and sources are available on my page http://www.camelot.homedns.org/~michalis/

There are some small games (e.g. lets_take_a_walk, using all that VRML and OpenGL stuff and OpenAL sounds) and some utility programs (most important view3dscene, quite usable VRML 1.0 and 3DS viewer).

I want to move my development to sourceforge.net (as www.camelot.homedns.org is slow, so please be patient) and of course I'm going to submit my units to FPC's "Contributed units" page. But I still want to translate more documentation to English (because almost everything is documented in my units, but some large parts are still in Polish), and generate sensible HTML version of docs with pasdoc.

Since September, development stopped a little (I'm working on some commercial db program in Delphi for Windows... bleeeh...) but things will surely start to grow fast in next year.

OK, enough self-promotion :) I will be happy if some of my units will be useful to someone else.

Michalis Ron Weidner wrote: > If there is enough interest, I'm thinking of > creating/hosting a web site devoted to the development > of cross-platform games using FreePascal. This site > would host game downloads, tutorial, forums, libs, > community projects, and code contributed by FreePascal > Gaming Community (you). > > If you have something to offer to this proposed > project, I would like to hear from you.(art, > FreePascal code, game downloads, etc) > > > Ron_W >
Dominique Louis

Saw you post on on the FreePascal site and thought I would mention that there already is a site that is geared towards Pascal Game Development it is called http://www.DelphiGamer.com ( soon to be renamed www.pgd.org ) and has recently been re-launched due to a merger and covers all aspects of game development using Pascal, from Win32 to Solaris and also hand held devices. The site used to be Delphi specific, but we now report and talk about all Pascal compilers and using them to write games.
There are even some guys working on providing an SDK for GBA development using FreePascal ( early stages ). Even Florian has been seen lurking on our forums.

Please join us as we are always looking out for other Pascal game developers and trying to share out knowledge.

PS. I noticed that you have projects which I had not found previously, I hope I can post a news item about it on http://www.DelphiGamer.com.

Keep up the excellent work!!!

PPS. Tell other like minded game developers about our site.

Dominique
http://www.DelphiGamer.com := go on, write a game instead;