Draw Pixels (Native Extension)


#1



Draw Pixels.apk.zip (2.3 MB) - apk for performance testing

Defold engine native extension for drawing pixels and simple geometry into texture buffer.
Thanks @britzl and @Mathias_Westerdahl for help.

(Like a result of this polling)

Feel free to contribute!

If you want to contribute and don’t know what you can do, look into next list:

  • Draw rectangle by two corner dots
  • Draw line with thickness parameter
  • Anti aliasing
  • (Done!!! thanks @thekrasnikoff) Bézier curves
  • (Done!!! thanks @britzl )Draw line

Materials
http://members.chello.at/~easyfilter/bresenham.html
http://www.sunshine2k.de/coding/java/TriangleRasterization/TriangleRasterization.html


#2

Great! Is this to be used for debugging, or fast enough to be used in games?


#3

It depend of your game, but I have plans to use it in one of my game, yes.
I added into main post apk for performance testing.


#4

NE was updated with new parameter “angle” for filled rectangle


#5

Draw pixels NE has a lot of changes after my last post here. Small status update for people who don’t follow repository on github.

First of all huge THANKS to all contributors: @britzl, @d954mas, @thekrasnikoff ! Thank you guys!

New methods:
drawpixels.pixel(buffer, x, y, r, g, b, a) to draw a pixel to the buffer
drawpixels.color(buffer, x, y) to read color from buffer
drawpixels.line(buffer_info, x0, y0, x1, y1, red, green, blue, alpha) to draw a line to the buffer
drawpixels.bezier(buffer_info, x0, y0, xc, yc, x1, y1, red, green, blue, alpha) draw a bezier line between two points and one control point

Moreover:
Refactoring and code clearing
Performance optimisation!!!
Bug fixing

Release notes for every release avaliable on this page: https://github.com/AGulev/drawpixels/releases