Skip to content

Commit

Permalink
Moved gl_device out
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Feb 24, 2015
1 parent bb652dd commit 1d4cc94
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 2,737 deletions.
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

[package]
name = "gfx"
version = "0.1.7"
version = "0.2.0"
description = "A high-performance, bindless graphics API"
homepage = "https://github.com/gfx/gfx-rs"
repository = "https://github.com/gfx/gfx-rs"
homepage = "https://github.com/gfx-rs/gfx-rs"
repository = "https://github.com/gfx-rs/gfx-rs"
keywords = ["graphics", "gamedev"]
license = "Apache-2.0"
authors = ["The Gfx-rs Developers"]
Expand All @@ -27,22 +27,22 @@ name = "gfx"
path = "src/gfx/lib.rs"

[dependencies]
bitflags = "*"
log = "*"

[dependencies.gfx_macros]
path = "src/gfx_macros"
plugin = true
version = "0.1.6"

[dependencies.gfx_device_gl]
path = "src/device"
version = "0.1.3"
[dev_dependencies.gfx_device_gl]
git = "https://github.com/gfx-rs/gfx_device_gl"
version = "0.2.0"

[dev_dependencies]
glfw = "*"
cgmath = "*"
genmesh = "*"
gfx_gl = "*"
noise = "*"
time = "*"
rand = "*"
Expand Down
34 changes: 0 additions & 34 deletions src/device/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion src/device/attrib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#![allow(missing_docs)]

use shade::BaseType;
use super::shade::BaseType;

/// Number of elements per attribute, only 1 to 4 are supported
pub type Count = u8;
Expand Down
38 changes: 22 additions & 16 deletions src/device/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@

//! Command Buffer device interface
use attrib;
use shade;
use target;
use tex;
use Resources;
use super::{attrib, shade, target, tex, Resources};

type Offset = u32;
type Size = u32;
Expand Down Expand Up @@ -74,6 +70,9 @@ impl DataBuffer {
}
}

/// Optional instance parameters
pub type InstanceOption = Option<(super::InstanceCount, super::VertexCount)>;

/// An interface of the abstract command buffer. It collects commands in an
/// efficient API-specific manner, to be ready for execution on the device.
pub trait CommandBuffer {
Expand All @@ -88,25 +87,31 @@ pub trait CommandBuffer {
/// Bind an array buffer object
fn bind_array_buffer(&mut self, <Self::Resources as Resources>::ArrayBuffer);
/// Bind a vertex attribute
fn bind_attribute(&mut self, ::AttributeSlot, <Self::Resources as Resources>::Buffer, attrib::Format);
fn bind_attribute(&mut self, super::AttributeSlot,
<Self::Resources as Resources>::Buffer, attrib::Format);
/// Bind an index buffer
fn bind_index(&mut self, <Self::Resources as Resources>::Buffer);
/// Bind a frame buffer object
fn bind_frame_buffer(&mut self, target::Access, <Self::Resources as Resources>::FrameBuffer);
fn bind_frame_buffer(&mut self, target::Access,
<Self::Resources as Resources>::FrameBuffer);
/// Unbind any surface from the specified target slot
fn unbind_target(&mut self, target::Access, target::Target);
/// Bind a surface to the specified target slot
fn bind_target_surface(&mut self, target::Access, target::Target, <Self::Resources as Resources>::Surface);
fn bind_target_surface(&mut self, target::Access, target::Target,
<Self::Resources as Resources>::Surface);
/// Bind a level of the texture to the specified target slot
fn bind_target_texture(&mut self, target::Access, target::Target, <Self::Resources as Resources>::Texture,
fn bind_target_texture(&mut self, target::Access, target::Target,
<Self::Resources as Resources>::Texture,
target::Level, Option<target::Layer>);
/// Bind a uniform block
fn bind_uniform_block(&mut self, <Self::Resources as Resources>::Program, ::UniformBufferSlot,
::UniformBlockIndex, <Self::Resources as Resources>::Buffer);
fn bind_uniform_block(&mut self, <Self::Resources as Resources>::Program,
super::UniformBufferSlot, super::UniformBlockIndex,
<Self::Resources as Resources>::Buffer);
/// Bind a single uniform in the default block
fn bind_uniform(&mut self, shade::Location, shade::UniformValue);
/// Bind a texture
fn bind_texture(&mut self, ::TextureSlot, tex::TextureKind, <Self::Resources as Resources>::Texture,
fn bind_texture(&mut self, super::TextureSlot, tex::TextureKind,
<Self::Resources as Resources>::Texture,
Option<::SamplerHandle<Self::Resources>>);
/// Select, which color buffers are going to be targetted by the shader
fn set_draw_color_buffers(&mut self, usize);
Expand All @@ -133,11 +138,12 @@ pub trait CommandBuffer {
/// Clear target surfaces
fn call_clear(&mut self, target::ClearData, target::Mask);
/// Draw a primitive
fn call_draw(&mut self, ::PrimitiveType, ::VertexCount, ::VertexCount,
Option<(::InstanceCount, ::VertexCount)>);
fn call_draw(&mut self, super::PrimitiveType, super::VertexCount,
super::VertexCount, InstanceOption);
/// Draw a primitive with index buffer
fn call_draw_indexed(&mut self, ::PrimitiveType, ::IndexType, ::VertexCount,
::VertexCount, ::VertexCount, Option<(::InstanceCount, ::VertexCount)>);
fn call_draw_indexed(&mut self, super::PrimitiveType, super::IndexType,
super::VertexCount, super::VertexCount,
super::VertexCount, InstanceOption);
/// Blit from one target to another
fn call_blit(&mut self, target::Rect, target::Rect, target::Mirror, target::Mask);
}
Expand Down
188 changes: 0 additions & 188 deletions src/device/gl_device/draw.rs

This file was deleted.

Loading

0 comments on commit 1d4cc94

Please sign in to comment.