Recent

Author Topic: AggPas and BGRABitmap comparison  (Read 17841 times)

circular

  • Hero Member
  • *****
  • Posts: 3665
    • Personal webpage
Re: AggPas and BGRABitmap comparison
« Reply #30 on: July 19, 2016, 12:11:06 pm »
This thread is the continuation of a previous conversation so I would like to copy here some elements that I find relevant in the discussion.

Here is the comparison on how to do the same thing with BGRABitmap and AggPas.

Drawing joined shapes:
https://github.com/bgrabitmap/lazpaint/blob/master/bgraaggtest/gouraud_main.pas (BGRABitmap)
https://github.com/CWBudde/AggPasMod/blob/master/Examples/Simple/Gouraud.dpr (modernized AggPas)
https://github.com/graemeg/fpGUI/blob/maint/src/corelib/render/software/agg-demos/gouraud.dpr (classic AggPas)
http://antigrain.com/demo/gouraud.png (screenshot)

Doing a custom gradient and applying a mask to it:
https://github.com/bgrabitmap/lazpaint/blob/master/bgraaggtest/alpha_gradient_main.pas (BGRABitmap)
https://github.com/CWBudde/AggPasMod/blob/master/Examples/Simple/AlphaGradient.dpr (modernized AggPas)
https://github.com/graemeg/fpGUI/blob/maint/src/corelib/render/software/agg-demos/alpha_gradient.dpr (classic AggPas)
http://antigrain.com/demo/alpha_gradient.png (approximate screenshot but you can see a bit the shapes and mask)
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 3665
    • Personal webpage
Re: AggPas and BGRABitmap comparison
« Reply #31 on: July 19, 2016, 12:21:55 pm »
I'm to old to keep spoon feeding every new developer that comes round. If they can't bother working through some tutorials, then I can't bother to help them. I work on a lot of open source projects and trying to scale down because I'm very busy at work and other personal interests. So my statement about working through some tutorials apply not just to AggPas, but to other components or frameworks too. eg: tiOPF, FPTest, DCPCrypt, OnGuard, fpGUI etc.
Is it that you would like to help new developers however you have the impression you need to do a lot for each and that it is not doable?

Quote
The problem being, such methods were introduced, and now used by others. So you can't just remove them to clean up the crappy API. You first have to deprecate them for a release or two - that's if you are willing to break somebody's code.
I thought about this. It is possible to keep the existing method, but that internally it would call the new API, like creating the CSV reader.

Quote
Always, and again that doesn't just apply to AggPas, but to other frameworks too. It is well knows that if you have a 1000 line procedure it is prone to bugs and hard to fix - compared to many smaller and to-the-point procedures. The latter is infinitely easier to debug, unit test etc.
I would agree in general with that. That's why I am trying to trim classes in my project as I have the time to do so.

Quote
It is a crappy design. Somebody wanted to populate a StringGrid from a CSV file and created a method in TStringGrid to do that. Scratch your own itch.
Well at some point someone does the things that are done, no?

Quote
No thought about good design. They were too lazy to come up with a better and more flexible solution. The person that introduced that method should start reading books about Design Patterns.
I am not comfortable calling people lazy. We have only a certain amount of spare time.
Conscience is the debugger of the mind

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: AggPas and BGRABitmap comparison
« Reply #32 on: July 19, 2016, 01:28:14 pm »
Is it that you would like to help new developers however you have the impression you need to do a lot for each and that it is not doable?
Correct. I enjoy helping others (time permitting), but as long as I see they actually tried themselves too.  Too many new developers want everything done for them with exact step-by-step instructions given (or even the complete solution). Nobody will learn that way. I started programming because I like the challenge of solving a problem, coming up with a good design and learning new things (better myself).
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

lainz

  • Hero Member
  • *****
  • Posts: 3957
  • Leandro Diaz
Re: AggPas and BGRABitmap comparison
« Reply #33 on: July 22, 2016, 11:15:08 pm »
Well I never will develop a graphics library like bgrabitmap and a widgetset like fpGUI, hopefully you and circular are here

Who is the best library depends on the user. I never used AggPas so I can't say.

I started using the default Canvas (PaintBox).

Then I used bgrabitmap to have transparency.

Of course I can program things by myself, to many years trying! But when something is already done I can use it to save time, like the whole Lazarus.

The things are programmed in the way the programmer things, I encountered software that I can't read and software readable, software easy to use and software impossible to understand for me. So if it's somewhat in the middle of easy and hard I can learn how to use it.
https://lainz.github.io/ - My Website :)
https://lazpaint.github.io/ -  Download LazPaint

 

TinyPortal © 2005-2018