Author Topic: Freebasic Practicalities  (Read 3272 times)

0 Members and 2 Guests are viewing this topic.

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Freebasic Practicalities
« on: July 02, 2008 »
I'm curious...

I've always avoided programming things for PCs because of the chaos and unknown factors of the target platform.  Which OS is running, how much memory, what sort of processor, graphics card, etc etc.

Now I've had a play with freebasic and I'm essentially treating it as a pixel canvas, I'm toying with the idea of coding up one of my long term projects.  Before I get started, I'd appreciate people's views on the practicalities of such an exercise.

I get the impression that Windows Vista can't run pure DOS Exe's without doing something special and I'm concerned that if I think about using OpenGL or DirectX (2D and 3D) that there will be portability issues there as well.

Is this something I should be overly concerned about?  Or are there known methods to deal with this?

The project I have in mind can be done in either 2D or 3D, 3D being arguably the more interesting.  If I stay in 2D, I can just use the pixel canvas and do everything by hand, but if I jump to 3D it makes sense to start learning about existing libraries to do the grunt work for me.


Challenge Trophies Won:

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Freebasic Practicalities
« Reply #1 on: July 02, 2008 »
I am not used to freebasic - but in general:

What about using abstraction libs that do care about most os-specific
stuff and gives you lot of useful functions on the top. A lot of problems
are already solved - so more time to focus on the creative part instead
of dealing with technical issues like certain OS.

There are several libs/projects around - a lot of solid and good ones -
but you need to check it for yourself against what you require from them.

I can think of:

http://www.libsdl.org/

http://hge.relishgames.com/
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Freebasic Practicalities
« Reply #2 on: July 02, 2008 »
hi xalthorn if you want to aim your stuff between vista and xp opengl or directx, in a win32 framework is definitly the way to go. in general most win32 stuff will work between the two platforms.

the only time you might encounter compatibilty issuses with ogl are when you start to use extensions which are supported for one card and not the other. extensions are there for when something that the basic opengl cant do which most of the time is sufficent enough.

although these problems can be taken care of with a bit of carefull coding.

onto the 3d/2d thing with ogl you can do both. for 2d pixel pushing you need to use a texture like a front buffer and alocate some space for a backbuffer in memory then you can push your data over each frame and display it maping it to a quad. ive tried this and its really quick just as quick as ptc i would say.

the only problem is that the texture has to be to the power of 2 so if you wanted a 640,480 screen you could create a buffer 512,512 and scale the texture up through the vertices of the quad.

i have working code laying around so if you need to look at anything just ask.

« Last Edit: July 02, 2008 by ninogenio »
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Freebasic Practicalities
« Reply #3 on: July 02, 2008 »
As Nino says, Opengl is a safe bet as long as you stick to power of 2 textures, np2 textures run really badly on ATI cards.

Stick some delta timing into what you do though and it should run nice on just about anything.

The same goes if you decide to stick to 2D programming, I suspect that you'd have a lot of fun writing it in 2D actually.. You can make things look quite wonderful with software rendering, opengl is the one to go for if you want to throw a lot of geometry around.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Freebasic Practicalities
« Reply #4 on: July 03, 2008 »
fbc only makes Windows EXEs, so no problem with Vista.

Jim
Challenge Trophies Won:

Offline Xalthorn

  • Amiga 1200
  • ****
  • Posts: 331
  • Karma: 100
    • View Profile
Re: Freebasic Practicalities
« Reply #5 on: July 03, 2008 »
Okay, sounds fairly safe.  One thing that concerns me though is libraries.  It reminds me of the huge minefield of choices when considering assorted 3D engines, not to mention you have to learn how to use the libraries.  I rifled through the forums looking for OpenGL stuff and have realised that I have to learn a whole bunch of new commands.  This is fair enough as it seems that OpenGL is 'simply' a rendering pipeline where you throw states and polys into the pipeline, flushing occasionally and letting the thing do its job.

I suspect I'm falling foul of library issues with FB already.  I've had comments on my demos that I should upgrade to the latest version, but then I'm wondering what would happen to the existing 'forum specific' library that I use to do the demos in the first place.

As an aside, this delta timing thing.  Unless I'm on the wrong track, isn't this the theory of moving things around the scene based on the amount of actual time that has passed?  If so, surely a slower machine would look jerky as things jumped to their calculated position rather than just running slower?  Although I suppose it can be used to modify the detail/quantity of things on the screen to keep the rate up.
Challenge Trophies Won: