-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1417: Move examples to explicit gfx_support crate/module. Also move to virtual cargo workspace. r=kvark I noticed [this issue about gfx_app](#922) has pretty much stopped, when I was just looking, and realized the exact same thing had been confusing me trying to learn gfx. In the thread, it was brought up maybe it was a good idea to move gfx_app to it's own module, to help users with learning the API (whom are reading the example code). Since progress has slowed down in [the PR for cargo workspaces](#1250) I thought I would submit this as *some* progress. I thought it was good timing since the last commit to the gfx repository just accepted a [pull-request doing a similar rename](d1e99ce), it seems smart to do another rename pull-request like this (since others maintaining branches will already need to rebase). I could be wrong about this, but the alternative would for me to sit back and wait until another point in the future to do this. I think renaming gfx_app to gfx_support, and more importantly moving the code out of gfx's root (and under examples/) will help users understand what is "gfx library code" vs "gfx support library code". The distinction is subtle but important, I believe. It certainty wasn't clear to me until quite a while of digging by myself. I have a few things I'd like to discuss moving forward, this pull request certainly isn't ready as is. 1. I'd like to gather consensus that this is the right direction to move gfx. Are there any objections to the direction of this pull-request? 2. Is gfx_project a good name for the "root project"? 3. I'm not sure that duplicating the Cargo.toml file is the right way to express what I'm intending. Right now I'm duplicating the dependencies section in both Cargo.toml files. Apart from going through each dependency one-by-one, and seeing whether examples/ or gfx/ requires the dependency, is there a way to not duplicate the dependencies your aware of? Is duplicating them a problem? 4. In the other thread glium was brought up as an example, in glium's example code, the helper code lives in the [examples/support/](https://github.com/glium/glium/tree/master/examples/support) directory, causing all examples to have to add [explicitly mod support it](https://github.com/glium/glium/blob/master/examples/deferred.rs#L10). I tried emulating the same setup, but I wasn't able to get it to compile. I would need to spend more time comparing with the glium project to emulate that setup. 5. I need to try using the support code from another package, to make sure it's visible the way I think it should be. This is a TODO. Anyways, I stole this list from the other thread. Here is what is working: cargo build cargo run --example (they all seem to work) What is not working: cargo test -- this isn't working for me on master/, not completely sure abouit this one. cargo build --all (error: native frameworks are only available on macOS targets) cargo test --all (error: Could not compile `core-foundation-sys`) Pretty tired now when writing this up, so posting this looking to get some direction/guidance to move forward with this change. edit: Resolves: * #1248 * #1424
- Loading branch information
Showing
261 changed files
with
762 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,158 +1,24 @@ | ||
[package] | ||
name = "gfx_app" | ||
version = "0.7.0" | ||
description = "GFX example application framework" | ||
homepage = "https://github.com/gfx-rs/gfx" | ||
keywords = ["graphics", "gamedev"] | ||
license = "Apache-2.0" | ||
authors = ["The Gfx-rs Developers"] | ||
documentation = "https://docs.rs/gfx_app" | ||
exclude = ["bors.toml", ".travis.yml"] | ||
|
||
[features] | ||
default = ["gl"] | ||
mint = ["gfx/mint", "gfx_core/mint"] | ||
metal = ["gfx_device_metal", "gfx_window_metal", "gfx_device_metalll"] | ||
metal_argument_buffer = ["gfx_device_metalll/argument_buffer"] | ||
gl = ["gfx_device_gl", "gfx_window_glutin"] | ||
dx11 = ["gfx_device_dx11", "gfx_window_dxgi"] | ||
dx12 = ["gfx_device_dx12", "gfx_window_dxgi"] | ||
vulkan = ["gfx_device_vulkan", "gfx_device_vulkanll", "gfx_window_vulkan"] | ||
sdl = ["gfx_window_sdl"] | ||
serialize = ["gfx/serialize", "gfx_core/serialize"] | ||
headless = ["gfx_window_glutin/headless"] | ||
unstable = [] | ||
|
||
[lib] | ||
name = "gfx_app" | ||
|
||
[dependencies] | ||
log = "0.3" | ||
env_logger = "0.4" | ||
glutin = "0.9" | ||
winit = "0.7" | ||
gfx_core = { path = "src/core", version = "0.7.1" } | ||
gfx_corell = { path = "src/corell", version = "0.1" } | ||
gfx = { path = "src/render", version = "0.16" } | ||
gfx_macros = { path = "src/macros", version = "0.2" } | ||
|
||
gfx_device_gl = { path = "src/backend/gl", version = "0.14", optional = true } | ||
gfx_window_glutin = { path = "src/window/glutin", version = "0.17", optional = true } | ||
|
||
[dependencies.gfx_device_vulkan] | ||
path = "src/backend/vulkan" | ||
version = "0.2" | ||
optional = true | ||
|
||
[dependencies.gfx_device_vulkanll] | ||
path = "src/backend/vulkanll" | ||
version = "0.1" | ||
optional = true | ||
|
||
[dependencies.gfx_window_vulkan] | ||
path = "src/window/vulkan" | ||
version = "0.3" | ||
optional = true | ||
|
||
[dependencies.gfx_device_metal] | ||
path = "src/backend/metal" | ||
version = "0.3" | ||
optional = true | ||
|
||
[dependencies.gfx_window_metal] | ||
path = "src/window/metal" | ||
version = "0.4" | ||
optional = true | ||
|
||
[dependencies.gfx_device_metalll] | ||
path = "src/backend/metalll" | ||
version = "0.2" | ||
optional = true | ||
#features = ["native_fence"] | ||
|
||
[dependencies.gfx_window_sdl] | ||
path = "src/window/sdl" | ||
version = "0.7" | ||
optional = true | ||
|
||
[target.'cfg(unix)'.dependencies] | ||
gfx_window_glfw = { path = "src/window/glfw", version = "0.15" } | ||
gfx_window_sdl = { path = "src/window/sdl", version = "0.7" } | ||
|
||
[target.'cfg(windows)'.dependencies] | ||
gfx_device_dx11 = { path = "src/backend/dx11", version = "0.6", optional = true } | ||
gfx_device_dx12 = { path = "src/backend/dx12", version = "0.1", optional = true } | ||
gfx_window_dxgi = { path = "src/window/dxgi", version = "0.9", optional = true } | ||
gfx_device_dx12ll = { path = "src/backend/dx12ll", version = "0.1" } | ||
|
||
[[example]] | ||
name = "blend" | ||
path = "examples/blend/main.rs" | ||
|
||
[[example]] | ||
name = "cube" | ||
path = "examples/cube/main.rs" | ||
|
||
[[example]] | ||
name = "deferred" | ||
path = "examples/deferred/main.rs" | ||
|
||
[[example]] | ||
name = "flowmap" | ||
path = "examples/flowmap/main.rs" | ||
|
||
[[example]] | ||
name = "gamma" | ||
path = "examples/gamma/main.rs" | ||
|
||
[[example]] | ||
name = "performance" | ||
path = "examples/performance/main.rs" | ||
|
||
[[example]] | ||
name = "shadow" | ||
path = "examples/shadow/main.rs" | ||
|
||
[[example]] | ||
name = "skybox" | ||
path = "examples/skybox/main.rs" | ||
|
||
[[example]] | ||
name = "terrain" | ||
path = "examples/terrain/main.rs" | ||
|
||
[[example]] | ||
name = "terrain_tessellated" | ||
path = "examples/terrain_tessellated/main.rs" | ||
|
||
[[example]] | ||
name = "triangle" | ||
path = "examples/triangle/main.rs" | ||
|
||
[[example]] | ||
name = "instancing" | ||
path = "examples/instancing/main.rs" | ||
|
||
[[example]] | ||
name = "ubo_tilemap" | ||
path = "examples/ubo_tilemap/main.rs" | ||
|
||
[[example]] | ||
name = "mipmap" | ||
path = "examples/mipmap/main.rs" | ||
|
||
[[example]] | ||
name = "particle" | ||
path = "examples/particle/main.rs" | ||
|
||
[[example]] | ||
name = "trianglell" | ||
path = "examples/trianglell/main.rs" | ||
|
||
[dev-dependencies] | ||
cgmath = "0.15" | ||
gfx_gl = "0.3" | ||
rand = "0.3" | ||
genmesh = "0.5" | ||
noise = "0.4" | ||
image = "0.15" | ||
[workspace] | ||
|
||
members = [ | ||
"src/backend/dx11", | ||
"src/backend/dx12", | ||
"src/backend/dx12ll", | ||
"src/backend/gl", | ||
"src/backend/metal", | ||
"src/backend/metalll", | ||
"src/backend/vulkan", | ||
"src/backend/vulkanll", | ||
"src/core", | ||
"src/corell", | ||
"src/macros", | ||
"src/render", | ||
"src/support", | ||
"src/window/dxgi", | ||
"src/window/glfw", | ||
"src/window/glutin", | ||
"src/window/metal", | ||
"src/window/sdl", | ||
"src/window/vulkan", | ||
"examples" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.