Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 08 09:55
    ZhouYuChen opened #118
  • Sep 05 23:17
    abu-irrational opened #117
  • Aug 17 18:16

    kobalicek on master

    [Bug] Fixed invalid A8 to PRGB3… (compare)

  • Jul 20 05:51
    dongyado commented #113
  • Jul 19 21:07
    LostVector closed #116
  • Jul 19 01:07
    LostVector commented #116
  • Jul 18 21:19
    kobalicek commented #116
  • Jul 18 21:18
    kobalicek commented #116
  • Jul 18 19:55
    LostVector opened #116
  • Jul 17 02:47
    bizehao commented #114
  • Jul 14 23:42
    kobalicek commented #113
  • Jul 14 23:42
    kobalicek commented #114
  • Jul 14 23:41
    kobalicek commented #114
  • Jul 14 23:39
    kobalicek closed #115
  • Jul 14 23:39
    kobalicek commented #115
  • Jul 14 23:38

    kobalicek on master

    [Bug] Don't refuse to stroke ge… (compare)

  • Jul 14 08:56
    kobalicek commented #115
  • Jul 14 08:53
    kobalicek commented #115
  • Jul 14 08:22
    yzrmn commented #115
  • Jul 14 07:45
    LostVector opened #115
Petr Kobalicek
@kobalicek
I would like to add Blend2D to Conan Center - then using the lib should be really trivial on any platform
Pierre Joye
@pierrejoye
cmake accepts PR too, could add findBlend2D with options
Petr Kobalicek
@kobalicek
That would not be that great - if something changes in Blend2D that makes that find buggy, it would cause more harm than good.
I think Conan is much better in this regard as you can update the recipe on Conan Center so changes could be reflected there
But I know only Conan well, not other C/C++ package managers
On the other hand I like Conan - I was able to build Qt demos on Windows with Conan, which built Qt5 for me
So building Blend2D and all demos could be pretty user friendly with it
Blend2D is not a problem alone - it's worse when you want more dependencies
Pierre Joye
@pierrejoye
also I use vcpkg all the time now, and help to update their registry
very very handy on windows
gh ci uses it too, cross builds for win arm as well
with vc, it is supposed to work on mingw or Linux but I never tried
Petr Kobalicek
@kobalicek
I checked that out, but since it didn't support versions of libraries, I kinda concluded that it's not the right tool
Pierre Joye
@pierrejoye
it does
since earlier this year, the vcpkg.json now can have many versions, each referring to different src
Petr Kobalicek
@kobalicek
BTW how can you specify multiple versions? I checked again, but I can see only ports all having a specific version
the problem of single-version approach is that if a dependency is updated, and the update breaks API, then all dependents break too
rspeir
@rspeir
just to be clear -- I used CMAKE with the BLEND2D_STATIC option enabled to generate project files that then built the .lib files
my problem is when I try to use those .lib files in another project
I'm trying to use MSVC to link in those libs, so no CMAKE in this case
rspeir
@rspeir
even though the static libraries have already been generated, do I still have to define BLEND2D_STATIC in my project that uses them?
rspeir
@rspeir
I followed this same process to successfully build wxWidgets static libraries that work just fine when I try to use them in other projects:
  1. run the included CMAKE script with appropriate options selected to generate MSVC project files that will emit static libraries when built
  2. open the CMAKE-generated MSVC project and build a debug or release ".lib" file depending on what build target I select
  3. create new MSVC project; add path to wxWidgets header files in the compiler options; add path to library files in linker options
  4. write a basic hello world program that includes the wxWidgets headers and uses wxWidgets functionality -- MSVC links in the appropriate symbols and the resulting program works
For some reason, when I follow these same steps for Blend2d, MSVC complains about missing symbols. I'm just trying to understand why
Pierre Joye
@pierrejoye
@kobalicek yeah, the support is basic. Far from what we can have with other. But it is wide spread lately and sort a lot of windows users compilation issues for them lately. I am trying to reach out with my old colleagues at the vc team and see what's their roadmap. Not much missing :)
@rspeir did you check if BLEND2D_STATIC is set correctly?
Pierre Joye
@pierrejoye
as @kobalicek mentioned yesterday
rspeir
@rspeir
Ok, when I set BL_STATIC in the preprocessor definitions, it compiles and runs
I wasn't clear whether that had to be set for projects that USE the libraries or if it was just for generating the libraries
Thank you for your help!
Pierre Joye
@pierrejoye
:)) have fun with blend2d
voodoomotion
@voodoomotion
Hi, i've tried this code in fiddler and it outputs the desired result, but in Visual Studio 2019 the second gradient is solid red. However if I increase the gradient alpha slightly to gradientB.addStop(0.5, BLRgba32(0x01FF0000)) the transparency works. Is there any reason why VS won't work with zero alpha? Not sure if it's a bug
BLImage render(const BLContextCreateInfo& cci) {
  BLImage img(400, 400, BL_FORMAT_PRGB32);
  BLContext ctx(img, cci);

  BLPath path;

  path.moveTo(100,100);
  path.lineTo(300,100);
  path.lineTo(300,300);
  path.lineTo(100,300);

  ctx.clearAll();

  ctx.setCompOp(BL_COMP_OP_SRC_OVER);

  BLGradient gradient(BLRadialGradientValues(200, 200, 200, 200, 100));
  gradient.addStop(0.0, BLRgba32(0xFFFFFFFF));
  gradient.addStop(1.0, BLRgba32(0xFF2F5FDF));

  ctx.setFillStyle(gradient);
  ctx.fillPath(path);

  BLGradient gradientB(BLRadialGradientValues(200, 200, 200, 200, 100));
  gradientB.addStop(0.5, BLRgba32(0x00FF0000));
  gradientB.addStop(1.0, BLRgba32(0xFFFF0000));

  ctx.setFillStyle(gradientB);
  ctx.fillPath(path);

  return img;
}
Petr Kobalicek
@kobalicek
Can you share the image you are getting, which is wrong?
Are you on master or beta release?
voodoomotion
@voodoomotion
Hi Petr, it should be the master that I downloaded from github today, unless I accidentally built beta16. I noticed this back in beta9 but assumed I was doing something wrong, until it worked in fiddler today. So I updated the lib and tried again before reporting it. I can't easily show the same code because i'm using classes/functions etc but i'm definitely using the same hex value and i'm not converting another value to hex,, the hex value is entered directly into the BLRgba32(). What I find is alpha 0x00FF0000 renders the same as 0xFFFF0000, but everything between 0x01FF0000 and 0xFFFF0000 works fine. Hope this makes sense, would you like me to test both beta16 and master?
Petr Kobalicek
@kobalicek
thanks, no testing master is OK
voodoomotion
@voodoomotion
also, not sure if this makes any difference, in CMake i'm enabling STATIC
voodoomotion
@voodoomotion
I think my project is still using the old lib. I'm deleting all existence of beta9 now and will confirm asap
Petr Kobalicek
@kobalicek
That would be great, because the fiddler uses Blend2D master + PNG encoder (not public atm, but will be soon as it's all part of my dev branch now)
voodoomotion
@voodoomotion
Ok, i'm downloading from here: https://github.com/blend2d/blend2d and will test using only that. When I deleted all the old versions earlier, the project wouldn't compile, it was somehow finding the old lib. I'll let you know soon, i'm working late tonight
voodoomotion
@voodoomotion
I've downloaded the master, and used asmjit from beta16. CMake worked fine but there were a few warnings when I build the static lib using VS19. Will test the gradient with this build
voodoomotion
@voodoomotion
It's perfect now! :D .. I removed all versions and made sure the project uses the new master lib and src folder. 0x00FF0000 now renders completely transparent, 0 alpha
Petr Kobalicek
@kobalicek
Yeah so it was a bug in the old beta you were using, there were few like those I suppose
voodoomotion
@voodoomotion
Sorry Petr. I'm more confident with CMake and building the lib now, so I'll make an effort to update regularly from now on ;) Hope you're well and finding time to relax!?
Petr Kobalicek
@kobalicek
I'm good thanks, no time to relax though :-D
voodoomotion
@voodoomotion
hahaha no rest for the wicked! I'm juggling 3 large animation projects at the moment and still developing tools for them along the way. Can only concentrate during the night because I need peace and quiet to code anything
Per-Arne Andersen
@perara
Hi, again! I was wondering: Which approach would you recommend to create a static grid in a scene? Essentially like the grid here: https://github.com/cair/deep-line-wars-2/raw/master/docs/images/showcase_1.png . SFML has some nifty grid features, but I'm looking to porting the rendering to blend2d :)
Robert M. Münch
@Robert-M-Muench
Petr Kobalicek
@kobalicek
Definitely array that you would view as a grid - Width x Height
abu-irrational
@abu-irrational
Hi Petr, I wonder if the wrong behavior as documented in bug #117 is related to bug (fixed) #74
Petr Kobalicek
@kobalicek
I would say no - I'm sorry I haven't fixed this one yet