Rename Renderer to GraphicsBackend

This commit is contained in:
Drakulix 2017-03-18 17:27:38 +01:00
parent 4c2e0f889f
commit 55e56ffc6d
3 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@ use nix::c_void;
use std::rc::Rc; use std::rc::Rc;
use backend::NewIdType; use backend::NewIdType;
use backend::graphics::opengl::{Api, OpenglRenderer, PixelFormat, SwapBuffersError}; use backend::graphics::opengl::{Api, OpenglGraphicsBackend, PixelFormat, SwapBuffersError};
use backend::input::{InputBackend, InputHandler, Seat, KeyState, MouseButton, MouseButtonState, Axis, AxisSource, TouchEvent, TouchSlot}; use backend::input::{InputBackend, InputHandler, Seat, KeyState, MouseButton, MouseButtonState, Axis, AxisSource, TouchEvent, TouchSlot};
/// Create a new `GlutinHeadlessRenderer` which implements the `OpenglRenderer` graphics /// Create a new `GlutinHeadlessRenderer` which implements the `OpenglRenderer` graphics
@ -63,7 +63,7 @@ pub fn init_windowed_from_builder(builder: WindowBuilder) -> Result<(GlutinWindo
)) ))
} }
/// Headless Opengl Context created by `glutin`. Implements the `OpenglRenderer` graphics /// Headless Opengl Context created by `glutin`. Implements the `OpenglGraphicsBackend` graphics
/// backend trait. /// backend trait.
pub struct GlutinHeadlessRenderer pub struct GlutinHeadlessRenderer
{ {
@ -83,7 +83,7 @@ impl GlutinHeadlessRenderer
} }
} }
impl OpenglRenderer for GlutinHeadlessRenderer impl OpenglGraphicsBackend for GlutinHeadlessRenderer
{ {
#[inline] #[inline]
fn swap_buffers(&self) -> Result<(), SwapBuffersError> { fn swap_buffers(&self) -> Result<(), SwapBuffersError> {
@ -124,7 +124,7 @@ impl OpenglRenderer for GlutinHeadlessRenderer
} }
/// Window with an active Opengl Context created by `glutin`. Implements the /// Window with an active Opengl Context created by `glutin`. Implements the
/// `OpenglRenderer` graphics backend trait. /// `OpenglGraphicsBackend` graphics backend trait.
pub struct GlutinWindowedRenderer pub struct GlutinWindowedRenderer
{ {
window: Rc<Window> window: Rc<Window>
@ -139,7 +139,7 @@ impl GlutinWindowedRenderer
} }
} }
impl OpenglRenderer for GlutinWindowedRenderer impl OpenglGraphicsBackend for GlutinWindowedRenderer
{ {
#[inline] #[inline]
fn swap_buffers(&self) -> Result<(), SwapBuffersError> { fn swap_buffers(&self) -> Result<(), SwapBuffersError> {

View File

@ -61,7 +61,7 @@ pub struct PixelFormat {
/// Trait that describes objects that have an OpenGl context /// Trait that describes objects that have an OpenGl context
/// and can be used to render upon /// and can be used to render upon
pub trait OpenglRenderer pub trait OpenglGraphicsBackend
{ {
/// Swaps buffers at the end of a frame. /// Swaps buffers at the end of a frame.
fn swap_buffers(&self) -> Result<(), SwapBuffersError>; fn swap_buffers(&self) -> Result<(), SwapBuffersError>;

View File

@ -4,7 +4,7 @@ use wayland_server::protocol::wl_shm::Format;
use std::error::Error; use std::error::Error;
/// Trait that describes objects providing a software rendering implementation /// Trait that describes objects providing a software rendering implementation
pub trait CpuRender<E: Error> { pub trait CpuGraphicsBackend<E: Error> {
/// Render a given buffer of a given format at a specified place in the framebuffer /// Render a given buffer of a given format at a specified place in the framebuffer
/// ///
/// # Error /// # Error