agulev / drawpixels Goto Github PK
View Code? Open in Web Editor NEWDefold engine native extension for drawing pixels into texture buffer.
License: MIT License
Defold engine native extension for drawing pixels into texture buffer.
License: MIT License
Hello,
when I try to run the example project I get a lot of build errors:
/drawpixels/src/drawpixels.cpp
Line 5: "DLIB_LOG_DOMAIN" redefined
#define DLIB_LOG_DOMAIN LIB_NAME
/drawpixels/src/drawpixels.cpp
Line 5: this is the location of the previous definition
/drawpixels/src/drawpixels.cpp
Line 44: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
static int *points = nullptr;
/drawpixels/src/drawpixels.cpp
Line 44: ‘nullptr’ was not declared in this scope
static int points = nullptr;
/drawpixels/src/drawpixels.cpp
Line 48: ‘nullptr’ was not declared in this scope
if (points != nullptr)
/drawpixels/src/drawpixels.cpp
Line 248: unused variable ‘size’ [-Wunused-variable]
int size = 10;
/drawpixels/src/drawpixels.cpp
Line 285: ‘bool is_new(int, int, int, int)’ defined but not used [-Wunused-function]
static bool is_new(int i, int r, int g, int b)
/drawpixels/src/drawpixels.cpp
Line 1117: unused variable ‘fx’ [-Wunused-variable]
float fx = radius * cos(from);
/drawpixels/src/drawpixels.cpp
Line 1118: unused variable ‘fy’ [-Wunused-variable]
float fy = radius * sin(from);
/drawpixels/src/drawpixels.cpp
Line 1227: unused variable ‘last_iiy2’ [-Wunused-variable]
int last_iiy2 = 0;
/drawpixels/src/drawpixels.cpp
Line 1332: ‘int draw_triangle_lua(lua_State)’ defined but not used [-Wunused-function]
static int draw_triangle_lua(lua_State *L)
/drawpixels/src/drawpixels.cpp
Line 1675: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int i = 0; i < buffer_info.src_size; i += line_size)
/drawpixels/src/drawpixels.cpp
Line 1762: unused variable ‘newposx’ [-Wunused-variable]
int newposx = 0;
/drawpixels/ext.manifest
upload/drawpixels/src/drawpixels.cpp: At global scope:
Any ideas? Otherwise Defold is working fine AFAICS.
Hi
I'm not sure if it is a bug of Defold Editor or drawpixels
With one image everything is fine and drawpixels
works very well
but when I try to draw on two image for example when they are next to each other
only one of them shows its content at a time, and sometimes they show duplicate content. It's very weird and annoying.
When I test it on Browser or Android its working fine.
I've made a very simple project to show you what I mean. You can play it in editor and move the player to right direction to see the issue.
Thanks
trail-test.zip
drawpixels.pixel(self.buffer_info, self.touch_pos.x, self.touch_pos.y, 0, 0, 0, 0)
doesn't work
Would be great to improve example by adding one more layer for interactive elements like line and bezier.
When user move cursor we redraw this interactive elements on this extra layer, and put them to the main layer when user release cursor.
Of course we can use fill() for clearning "extra texture", but would be greate to save previous drawing (coordinates) every frame and before drawing new line, redraw old one with alpha (smaller fillrate and better performans than using fill() method)
https://github.com/koorva/drawpixels/blob/ec2fcd29e30502f48a23a16d18f21619631c4a4f/drawpixels/src/drawpixels.cpp#L26-L36
https://github.com/koorva/drawpixels/blob/ec2fcd29e30502f48a23a16d18f21619631c4a4f/drawpixels/src/drawpixels.cpp#L467-L475
#7 I am not sure that its right. Maybe we should replace Point by FloatPoint?
Fill rect or any drawing for that matter doesn't work. Just fill works. Waste of time.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.