Recent

Author Topic: Pascal headers for SDL_bgi?  (Read 3245 times)

palazzol

  • Newbie
  • Posts: 3
Pascal headers for SDL_bgi?
« on: January 28, 2017, 06:49:49 pm »
Just wondering if anyone has created headers already for SDL_bgi, before I give it a go...

http://libxbgi.sourceforge.net/

I am looking at porting a large codebase from Turbo Pascal for DOS to SDL...and this would make life easier.

Thanks

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Pascal headers for SDL_bgi?
« Reply #1 on: January 28, 2017, 09:03:03 pm »
FPC's graph is not bgi based. It would be more logical to make a SDL version for graph then to mess with libxbgi.

palazzol

  • Newbie
  • Posts: 3
Re: Pascal headers for SDL_bgi?
« Reply #2 on: January 28, 2017, 09:55:46 pm »
Hi marcov,

Not sure I understand...  when you say "make a SDL version for Graph", do you mean reimplement all the drawing primitives?  These functions already exist in SDL_bgi, and the function calls are the same from what I can see.  So why wouldn't I want to just wrap and use them?

I'm comparing...
http://www.freepascal.org/docs-html/current/rtl/graph/index-5.html
with
http://www.cs.colorado.edu/~main/cs1300/doc/bgi/

 (Incidentally, for my needs I don't care about the mouse and keyboard calls - I'd go straight to SDL for those.  Maybe I don't even need to wrap them)


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Pascal headers for SDL_bgi?
« Reply #3 on: January 28, 2017, 10:25:12 pm »
Well, you'd be porting away from graph then. Fine for a one off of course.

I was just thinking that porting the relevant parts of those old 2004 sources makes it all pascal (except for maintained libraries like SDL), and has the ability to be e.g. SDL less on Windows etc.

Anyway, no, I'm not aware of any headers. But there is a sdlgraph part of the FPC distribution, which might already have done this.
« Last Edit: January 28, 2017, 10:31:36 pm by marcov »

palazzol

  • Newbie
  • Posts: 3
Re: Pascal headers for SDL_bgi?
« Reply #4 on: January 29, 2017, 04:52:12 am »
Thanks for the explanation - that makes sense.  I'll look into that approach as well.

I'm not 100% sure but I think the sdlgraph stuff is based on the old SDL1.2, which I'd rather avoid. 
But the code is interesting and worth looking at I think.

 

TinyPortal © 2005-2018