Giter Site home page Giter Site logo

Comments (2)

kobalicek avatar kobalicek commented on May 25, 2024

The object must be initialized otherwise it's undefined what would happen. It's very similar to passing null FILE* pointer to fwrite(), for example, etc... Blend2D instances must be initialized by Init() before use and destroyed by Reset() after they go out of scope. C++ API does it by design, C API doesn't.

If you pass a null pointer to C API or some object's impl is null it means that the passed instance was not properly initialized as Blend2D never uses nulls for impls (instead a built-in none instance is used, which is still valid impl).

from blend2d.

Wiladams avatar Wiladams commented on May 25, 2024

Yah, I figured as much. The 'C' interface is essentially "no guard rails", which is fine as for my own LuaJIT wrapper, I'm doing what the C++ interface does (init, reset). It might just be worthwhile documenting the fact that the C interface is more "raw". I know it's already documented that you SHOULD do the Init/Reset thing, but maybe more explicit?

This wasn't actually a problem for me, I ran into by accident.

So far so good overall.

from blend2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.