Skip to content
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

Macros return! #725

Merged
merged 6 commits into from May 10, 2015

Conversation

@kvark
Copy link
Member

commented May 10, 2015

Closes #676
Examples: https://github.com/gfx-rs/gfx_examples/pull/23 (work on rust-beta)
Macros: gfx-rs/gfx_macros#18 (the bye-bye patch)

The change finalizes the port of gfx-rs to rust-beta. Users are advised to use the new macros syntax (check examples PR) and compile on rust beta/stable.

Notes

Practically deprecates gfx_macros. I've lost a lot of blood writing these syntax extensions, but I'd better have a cleaner (and smaller) code base to deal with, so my vote is to let gfx_macros rest in peace.

Current problems (non-critical):

  • I had to add pub to all the generated structs and members, which prevents these to be declared inside functions
  • We have _r: PhantomData<R> in each shader parameter structure

@kvark kvark changed the title Macros return! [WIP] Macros return! May 10, 2015

@kvark kvark changed the title [WIP] Macros return! Macros return! May 10, 2015

@ghost

This comment has been minimized.

Copy link

commented May 10, 2015

Looks good to me. I would like a 3rd to look over it.

@cmr

This comment has been minimized.

Copy link
Contributor

commented May 10, 2015

I'm impressed that the macro is almost as nice to use as the original syntax extension. LGTM.

@bvssvni

This comment has been minimized.

Copy link
Contributor

commented May 10, 2015

Looks good. I noticed the examples uses underscore in front for the shader parameter x@ _x. Don't know if this is required, but needs some documentation.

@kvark

This comment has been minimized.

Copy link
Member Author

commented May 10, 2015

Thanks everyone! I'm merging then?

@bvssvni about underscores. 1) they are in tests, not examples. and 2) they are not required, the variables are just unused, so I put an underscore.

@kvark

This comment has been minimized.

Copy link
Member Author

commented May 10, 2015

I've updated gfx_macros (the bye-bye patch), to avoid forcing everyone to use the new macros just yet. Merging.

kvark added a commit that referenced this pull request May 10, 2015

@kvark kvark merged commit 6957ff8 into gfx-rs:master May 10, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@kvark kvark removed the status: working label May 10, 2015

@kvark kvark deleted the kvark:stable branch May 10, 2015

@kvark

This comment has been minimized.

Copy link
Member Author

commented May 10, 2015

Did no one really notice the X-Com reference with gfx::attrib::Floater? 🌍

@ghost

This comment has been minimized.

Copy link

commented May 10, 2015

I was wondering where you got the name from. Shamefully, I have never actually played xcom.

Kagami added a commit to PistonDevelopers/gfx_text that referenced this pull request May 12, 2015

Use simple macroses instead of gfx_macros
See: gfx-rs/gfx#725
Should work on Rust beta now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.