SDL
SDL copied to clipboard
HarmonyOS/OpenHarmony Port
Description
SDL support for harmonyos
Existing Issue(s)
#9837
@slouken Request for review
@madebr @sezero Request for review
Can you please rebase on top of current master and remove all commits which you did not author?
git fetch https://github.com/libsdl-org/SDL main
git rebase -i FETCH_HEAD
<remove all commits which you did not author. In vim, "dd" removes the current line, "<ESC>:wq" saves and exits)>
git push [email protected]:Jack253-png/SDL HEAD:OpenMinecraft-Dev -f
Seeing you implemented vulkan support, does SDL_gpu work? Do the SDL_gpu_examples work?
Seeing you implemented vulkan support, does SDL_gpu work? Do the SDL_gpu_examples work?
I will test later, because I don't have test platform, I need to find other people to do this.
Seeing you implemented vulkan support, does SDL_gpu work? Do the SDL_gpu_examples work?
@StarcloudSea here is the owner of the test platform
Do you need the dynapi functionality of SDL? If you don't, insert a similar disabler for ohos around here.
To clarify, I'm not a developer, I was just called to test because the computer has good performance, and I don't know about HarmonyOS development. 😅
Do you need the dynapi functionality of SDL? If you don't, insert a similar disabler for ohos around here.
Maybe I need it, is this PR ready for merging?
@madebr request for review, I have tested the egl & vulkan surface creation, and it works. I also finished the touch & keyboard event.
@madebr @sezero Request for review, the video subsystem is nearly complete (except the clipboard)
@madebr Finish
Nice work you did here!
Do all unit tests work? (
ctesttests with a dummy video driver). Does runningtest/testautomation --video dummysucceed? Does runningtest/testautomation --video ohoswork? Doestest/testsprite --renderer openglwork? Doestest/testsprite --renderer vulkanwork? Doestest/testsprite --renderer gpuwork? Doestest/testfilework? Doestest/testfilesystemwork?Do you also intend to add support for other subsystems? I looked a bit through the sparse English documentation, and it looks like ohos also has camera support.
I need to buy a test platform, I may hang this PR for about 2 weeks, and it is able to create vulkan/egl surface for now (I borrowed another developer's PC and runs the emulator, and it's unavailable for now)
Nice work you did here!
Do all unit tests work? (
ctesttests with a dummy video driver). Does runningtest/testautomation --video dummysucceed? Does runningtest/testautomation --video ohoswork? Doestest/testsprite --renderer openglwork? Doestest/testsprite --renderer vulkanwork? Doestest/testsprite --renderer gpuwork? Doestest/testfilework? Doestest/testfilesystemwork?Do you also intend to add support for other subsystems? I looked a bit through the sparse English documentation, and it looks like ohos also has camera support.
I will try to implement the locale, audio subsystem, and locale api implementation is inside the ets part.
It would also be useful to write some documentation for the docs directory.
Since openharmony is a relatively new os, documentation about how to package a SDL app would be useful. I hope it's not a mess like Android ;)
It would also be useful to write some documentation for the
docsdirectory.Since openharmony is a relatively new os, documentation about how to package a SDL app would be useful. I hope it's not a mess like Android ;)
I have already written a sample harmony/openharmony app at https://github.com/OpenMinecraft-Dev/sdl-ohos-shell, I will try to put it inside
Does it work? I changed the commit message
Does it work? I changed the commit message
Hmph. It still seems to run all the workflows. @madebr: Is the filtering correct?
Does it work? I changed the commit message
Hmph. It still seems to run all the workflows. @madebr: Is the filtering correct?
I'm using ${{ github.event.head_commit.message }} to get the commit message.
It looks like this works for the run in Jack's fork, but does not for this PR.
Does it work? I changed the commit message
Hmph. It still seems to run all the workflows. @madebr: Is the filtering correct?
I'm using
${{ github.event.head_commit.message }}to get the commit message. It looks like this works for the run in Jack's fork, but does not for this PR.
Do you find the problem? Why it works in my repo?
On pushes, github.event is a push object, which has a .head_commit.message` property.
On pull requests, github.event is a pull_request (synchronize) object. This objects does not have .head_commit.message property. Through github.event.pull_request.commits_url, we can find out the commit message.
This url returns paged data with a maximum of 100 items. We need the last item, so it'd require to iterate the list.
The event has github.event.pull_request.merge_commit_sha, but does not return the sha of the head commit of the pr. Doing something like git log -n -1 HEAD~1 does not reliably return the correct commit (remember, we test merge commits in pull requests, not the actual head commit)
On pushes,
github.eventis a push object, which has a.head_commit.message` property.On pull requests,
github.eventis apull_request (synchronize)object. This objects does not have.head_commit.messageproperty. Throughgithub.event.pull_request.commits_url, we can find out the commit message. This url returns paged data with a maximum of 100 items. We need the last item, so it'd require to iterate the list. The event hasgithub.event.pull_request.merge_commit_sha, but does not return the sha of the head commit of the pr. Doing something likegit log -n -1 HEAD~1does not reliably return the correct commit (remember, we test merge commits in pull requests, not the actual head commit)
It is an existing bug in SDL GitHub workflow?!
It is an existing bug in SDL GitHub workflow?!
Yes and no. Yes because parsing commit messages do not work. No because pull requests creators cannot sneakily disable a workflow.
So yes, the problem was already present.
. No because pull requests creators cannot sneakily disable a workflow.
So yes, the problem was already present.
Actually that's a good thing and not a problem. A patch causing problems elsewhere would go undetected otherwise.
@icculus @sezero opengles2 tested, works (but the renderer doesn't work due to the shader problem, I wrote a demo by myself), after solving the multi threading problem, I will put the ohos project into this pr. It is near to the merge
@madebr @sezero request for review
@madebr review
This looks very great. I've got some questions.
- This adds support for OpenHarmony 5. What compatibility promise does OpenHarmony make? Do apps built for older SDK's run on newer versions?
- Can you document how to package a SDL3 app and create an OpenHarmony app?
This looks very great. I've got some questions.
- This adds support for OpenHarmony 5. What compatibility promise does OpenHarmony make? Do apps built for older SDK's run on newer versions?
- Can you document how to package a SDL3 app and create an OpenHarmony app?
For now the port works on any OpenHarmony/HarmonyOS 5.x/6.x systems (I have tested in the emulators), 4.x (older versions is end-of-life)
Now the building of the app requires DevEco Studio, which is very hard to acquire except in China, but I am trying to put the sdl-ohos-shell project into this repo, and I planned to write the document after the audio subsystem porting
@madebr review