0

I was looking at this library https://github.com/blend2d/blend2d .It does not use gl , glut of glfw.How is it rendering?

DMGregory
  • 134,153
  • 22
  • 242
  • 357
  • Are you sure it is rendering to a window buffer? Perhaps it renders to some in memory buffer your provide. – Emil Oct 09 '20 at 07:07
  • You can't. It is impossible to draw pixels without any library. – user253751 Oct 09 '20 at 10:53
  • 2
    Please do not edit answered questions in a way that renders the existing answers irrelevant to the new question. The thing to do in that case is to ask a new question, after you've checked the [help] to be sure it's on-topic for this site, or asked on Meta or in [chat] for help refining your question to something we can constructively help with in the format we use here. Try digging to the root of why you're interested in CPU rasterization - what problem do you think it solves for you? Ask about that problem, after doing your research into it. – DMGregory Oct 09 '20 at 13:19

2 Answers2

1

From the project's website:

It was written from scratch with the goal to achieve the best possible software-based acceleration of 2D rendering.

The answer is therefore: no library - it uses it's own custom software renderer.

Maximus Minimus
  • 20,144
  • 2
  • 38
  • 66
  • Can you please link to one refference of how one can implement graphics by themselves.(I know this is not completely related to gamedev but still). – goodlifetobesavecompenthusiast Oct 09 '20 at 05:55
  • 1
    @compenthusiast did you consider searching the web for a cpu rasterizer? – Vaillancourt Oct 09 '20 at 10:52
  • @compenthusiast - this would fall under "it takes an entire book to answer" - you want one reference, but here's two; firstly an old one: https://www.amazon.co.uk/Graphics-Programming-Black-Special-CD-ROM/dp/1576101746 and secondly a more recent one: https://trenki2.github.io/blog/2017/06/06/developing-a-software-renderer-part1/ – Maximus Minimus Oct 09 '20 at 14:02
-2

One rule of thumb , if it is cross compilable (meaning can be deployed multiple different devices) , over linux,windows etc then its opengl or vulkan . Glut ,glfw are wrappers that handle the Windowing context and provide some added tools over the core OpenGl Api spec.

The windowing is done by tools like Direct3D in windows and X11 in Linux that the os has provided and uses for its own window context generation.

The GPU vendor extends out functionality of there GPU by coupling it with the modern Rendering Apis that it would support. Getting access to these extensions and functionality directly is a tall order with a capital T and i highly doubt they would have done that.

Having said that you can develop a rasterizer on the CPU as well, but it would be far from performant. The idea is to have a set of nxn(where n is the resolution) 2D grid of pixels and populate it with bit information at least 30-60 times per sec for it to be considered real-time.

Hopefully with this info you can deduce something out.

  • So at the end of the day , you think they have built or anyone can build something called a rasterizer if someone does not want to use any library. – goodlifetobesavecompenthusiast Oct 09 '20 at 06:30
  • Well yes the purpose of the GPU to begin with is to solve the hardware architectural drawbacks of rasterising or rendering with little parallelism. 4-8 big cores vs hundred if not thousands of small ones on mordern GPUs. To do this on the CPU wold mean that they have a lot of static info that does not need Updating to frequently so probably they made it work for there use case. Look at this video for a intuitive reference https://www.youtube.com/watch?v=-P28LKWTzrI – Aditya Mattoo Oct 09 '20 at 06:36
  • Although this answer is giving a broader context and information which may be relevant to the OP, it lacks the answer to the actual question asked. – Vaillancourt Oct 09 '20 at 14:07
  • ok makes sense , just trying to help , were both new here – Aditya Mattoo Oct 10 '20 at 04:22