Drawnode issue on Android 4.2.x
- adxe version: 1
- devices test on: Asus ME173X (Android 4.2.2)
- developing environments
- NDK version: r19c
- Xcode version: 12.4
- VS/msvctools version: Visual Studio 2019(16.11)/14.29.30133
- cmake version: 3.23.0-rc1 Steps to Reproduce:
- Copy paste this code in HelloWorld
- Test under iOS or Mac
- See the difference on Android 4.2.x (nothing is drawn)
// testDrawNode
void HelloWorld::testDrawNode()
{
//
log(" - works on MacOs 11+ but not on Android 4.2.2");
log(" - should trace some drawings in the scene");
//
auto size = Director::getInstance()->getVisibleSize();
auto origin = Director::getInstance()->getVisibleOrigin();
float scaleFactor = Director::getInstance()->getContentScaleFactor();
log(" - size: %.0fx%.0fpx", size.width, size.height);
log(" - scaleFactor: %.2f", scaleFactor);
//
float pad = 40.0f;
auto pointBL = Vec2(pad, pad);
auto pointTR = Vec2(size.width-pad, size.height-pad);
auto pointA = Vec2(pad, size.height-2*pad);
auto pointB = Vec2(2*pad, size.height-2*pad);
auto pointC = Vec2(2*pad, size.height-pad);
auto pointD = Vec2(pad, size.height-pad);
auto draw = DrawNode::create();
draw->setContentSize(size);
draw->setPosition(origin);
// draw a rectangle
draw->drawSolidRect(pointBL, pointTR, Color4F(1.0f,1.0f,1.0f,0.20f));
// draw a rectangle
draw->drawSolidRect(pointA, pointC, Color4F(1.0f,1.0f,1.0f,1.0f));
// drawQuadBezier
draw->drawQuadBezier(pointA, pointB, pointC, 10, Color4F(1.0f,1.0f,1.0f,1.0f));
// draw polygons
Vec2 points[] = { pointA, pointB, pointC, pointD };
draw->drawPolygon(points, sizeof(points)/sizeof(points[0]), Color4F(1.0f,0.3f,0.0f,1.0f), 4, Color4F(0.0f,1.0f,1.0f,0.3f));
// draw segment
draw->drawSegment(pointA, pointC, 10, Color4F(0.0f, 1.0f, 0.0f, 1.0f));
addChild(draw, 50);
}
I have no android 4.2.2 device, does the virtual device also have this issue?
No, the emulator is working fine under Jelly Bean 4.2 API 17. Note that is also working on Cocos v3.17.2 on physical devices.
Does other android physical devices with different Android version have the issue, It is difficult to diag the problem reason, because I have no Android 4.2.2 physical device. And does there have any avaiable logcat for this issue?
I think everything under SDK 17 - include - is having the issue. Min SDK is already 17 in adxe, if I test under SDK 15, I also have the issue. Nothing relevant in logcat. Can't test SDK 18. SDK 19 is fine.
Note: under cocos v3 last version, I'm able to have Min SDK 14 without any known issue.
I tried out of pure free time on my old galaxy note 3 (which I didn't update and it's still on 4.2.2) And yes it has the issue surprisingly! It also happens with the godot engine when drawing lines except that they stutter (some frames they show and sometimes they don't, sometimes they show artifacts) I'm starting to suspect that it's an OpenGL ES issue Kinda weird that godot has the same issue lol
It's very rare that anyone still uses these devices cuz they're OLD AS TIME
Yes, the min sdk have maybe to be raised up. Anyway, I've notified this DrawNode issue, I will notify some others.
I will notify one here as it also concern the same versions of Android:
ScrollView issue on Android SDK 17-
- adxe version: 1
- devices test on: Asus ME173X (Android 4.2.2)
- developing environments
- NDK version: r19c
- Xcode version: 12.4
- VS/msvctools version: Visual Studio 2019(16.11)/14.29.30133
- cmake version: 3.23.0-rc1
Steps to Reproduce:
- Copy paste this code in HelloWorld
- Test under iOS or Mac or Android > SDK 19
- See the difference on Android 4.2.x (nothing is drawn)
//
float pad = 20.0f;
//
auto origin = Director::getInstance()->getVisibleOrigin();
//
auto size = Director::getInstance()->getVisibleSize();
auto sizeScroll = Size(size.width*0.33f, size.height-2*pad);
auto sizeVeryHigh = Size(size.width*0.33f, size.height*4.0f);
// Create the scrollview by vertical
//ui::ScrollView* scrollView = ui::ScrollView::create();
ScrollView* scrollView = ScrollView::create();
scrollView->setContentSize(sizeScroll);
scrollView->setInnerContainerSize(sizeVeryHigh);
scrollView->setScrollBarWidth(4);
scrollView->setScrollBarPositionFromCorner(Vec2(2, 2));
scrollView->setScrollBarColor(Color3B::WHITE);
scrollView->setGlobalZOrder(200);
addChild(scrollView, 10);
//
scrollView->setPosition(Vec2(size.width*0.66f - pad, pad) + origin);
//
LayerColor *layerColor = LayerColor::create(Color4B(155, 255, 255, 255));
layerColor->setContentSize(sizeVeryHigh);
layerColor->setPosition(sizeVeryHigh/2.0f);
scrollView->addChild(layerColor, 10);
for (int i=0; i<12; i++) {
Sprite* sprite = Sprite::create("HelloWorld.png");
sprite->setPosition(Vec2(sprite->getContentSize().width/2, sizeVeryHigh.height - (i+0.7f) * sprite->getContentSize().height));
scrollView->addChild(sprite, 2);
}
Yes, the min sdk have maybe to be raised up. Anyway, I've notified this DrawNode issue, I will notify some others.
@appakabar Have you the same behavior using cocos2d-x 4.0?
@appakabar Another question:
Can you see any other stuff if you put it on the center of the screen?
@aismann
Have you the same behavior using cocos2d-x 4.0?
Yes.
Can you see any other stuff if you put it on the center of the screen?
If you mean a DrawNode, no those are not drawn at all. For the ScrollView issue I think my test is already in the center of the screen.
So nothing is drawing? Do you think this is really a axys/cocos2dx 4.0 issue? I think your device is too old.
So nothing is drawing? -> for the Drawnode, yes nothing is drawn. Pretty sure that the other issue (Scrollview) is related.
Do you think this is really a axys/cocos2dx 4.0 issue? -> yes, 100% sure. Related to the changes on the renderer engine I think.
I think your device is too old. -> yes, those are (I've 2 or 3 like that), it's something like 1 or 2% of Android users I think. So not a big issue at all. But If the issue is not fixed, the min SDK have to be raised for a better engine quality.
Bigger issue I have with axys/cocos2dx 4.0 is the fact that third libs are not precompiled for Mac OS Silicon/Mx chip series... Do you think I should open a ticket about this or some guy is already working on it? (I've already work a bit on it but I'm not good a that).. Thank you!
Bigger issue I have with axys/cocos2dx 4.0 is the fact that third libs are not precompiled for Mac OS Silicon/Mx chip series... Do you think I should open a ticket about this or some guy is already working on it?
-> Thats the sense of an issue. Write one and hope it will answered or better send the fix with a PR from you.
The Apple M1 already supported, see also: https://github.com/axys1/axys/issues/803
Do you think this is really a axys/cocos2dx 4.0 issue? -> yes, 100% sure. Related to the changes on the renderer engine I think.
@appakabar Use cocos2dx 3.1x for this device plz. Can we close this issue?
Use cocos2dx 3.1x for this device plz.
ok noted
Can we close this issue?
Yes for sure. Thank you for all.
@halx99 plz close