-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot access all event attributes via sfRenderWindow_pollEvent #2
Comments
Since there is no one-to-one correspondence between Julia struct and C union, you need to use pointer arithmetic or some packages like Blobs.jl. |
|
Ok, thanks for the tips. I'm still wondering though... When julia creates |
Good question. I guess this might due to an old bug in Clang.jl, now it generates:
which is the largest field in the union. However, it is quite annoying for end-users when querying data from such a union. I'm going to overload |
Hi @EimantasLedinauskas, it should work now, you could give the example in the master branch a try. BTW, would you like me to tag a new release for this change? My current plan is to wait CEnum.jl's overhaul which will break everything that depends on it and then I'll regenerate the whole C bindings using Clang.jl. But if you're urgent, I'll tag the new release tomorrow. |
Nice, thanks! It's not urgent, I can wait for the planned release :) |
sfRenderWindow_pollEvent
function works only withsfEvent
type. How can I access event attributes other than event type (like mouse position or pressed key code) when using this function? These attributes are declared in other types like e.g.sfMouseButtonEvent
and it looks to me that these are not accessible viasfRenderWindow_pollEvent
function.If I understand correctly, in CSFML
sfEvent
type should be union of more concrete event types likesfKeyEvent
.The text was updated successfully, but these errors were encountered: