Struct ggez::graphics::GlBackendSpec [−][src]
pub struct GlBackendSpec { /* fields omitted */ }
Expand description
A backend specification for OpenGL.
This is different from Backend
because this needs to be its own struct to implement traits
upon, and because there may need to be a layer of translation
between what the user asks for in the config, and what the
graphics backend code actually gets from the driver.
You shouldn’t normally need to fiddle with this directly
but it has to be public because generic types like
Shader
depend on it.
Trait Implementations
type CommandBuffer = CommandBuffer
type CommandBuffer = CommandBuffer
gfx command buffer type
Returns the version of the backend, (major, minor)
. Read more
Returns the text of the vertex and fragment shader files to create default shaders for this backend. Read more
fn init<'a>(
&self,
window_builder: WindowBuilder,
gl_builder: ContextBuilder<'a, NotCurrent>,
events_loop: &EventLoop<()>,
color_format: Format,
depth_format: Format
) -> Result<(WindowedContext<PossiblyCurrent>, Self::Device, Self::Factory, RawRenderTargetView<Self::Resources>, RawDepthStencilView<Self::Resources>), CreationError>
fn init<'a>(
&self,
window_builder: WindowBuilder,
gl_builder: ContextBuilder<'a, NotCurrent>,
events_loop: &EventLoop<()>,
color_format: Format,
depth_format: Format
) -> Result<(WindowedContext<PossiblyCurrent>, Self::Device, Self::Factory, RawRenderTargetView<Self::Resources>, RawDepthStencilView<Self::Resources>), CreationError>
Creates the window.
Returns a string containing some backend-dependent info.
Create an Encoder for the backend.
fn resize_viewport(
&self,
color_view: &RawRenderTargetView<Self::Resources>,
depth_view: &RawDepthStencilView<Self::Resources>,
color_format: Format,
depth_format: Format,
window: &WindowedContext<PossiblyCurrent>
) -> Option<(RawRenderTargetView<Self::Resources>, RawDepthStencilView<Self::Resources>)>
fn resize_viewport(
&self,
color_view: &RawRenderTargetView<Self::Resources>,
depth_view: &RawDepthStencilView<Self::Resources>,
color_format: Format,
depth_format: Format,
window: &WindowedContext<PossiblyCurrent>
) -> Option<(RawRenderTargetView<Self::Resources>, RawDepthStencilView<Self::Resources>)>
Resizes the viewport for the backend. (right now assumes a Glutin window…)
fn raw_to_typed_shader_resource(
&self,
texture_view: RawShaderResourceView<Self::Resources>
) -> ShaderResourceView<<Self as BackendSpec>::Resources, [f32; 4]>
fn raw_to_typed_shader_resource(
&self,
texture_view: RawShaderResourceView<Self::Resources>
) -> ShaderResourceView<<Self as BackendSpec>::Resources, [f32; 4]>
A helper function to take a RawShaderResourceView and turn it into a typed one based on
the surface type defined in a BackendSpec
. Read more
fn raw_to_typed_texture(
&self,
texture_view: RawTexture<Self::Resources>
) -> Texture<<Self as BackendSpec>::Resources, <Srgba8 as Formatted>::Surface>
fn raw_to_typed_texture(
&self,
texture_view: RawTexture<Self::Resources>
) -> Texture<<Self as BackendSpec>::Resources, <Srgba8 as Formatted>::Surface>
Helper function that turns a raw to typed texture.
A bit hacky since we can’t really specify surface formats as part
of this that well, alas. There’s some functions, like
gfx::Encoder::update_texture()
, that don’t seem to have a _raw()
counterpart, so we need this, so we need BuggoSurfaceFormat
to
keep fixed at compile time what texture format we’re actually using.
Oh well! Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for GlBackendSpec
impl Send for GlBackendSpec
impl Sync for GlBackendSpec
impl Unpin for GlBackendSpec
impl UnwindSafe for GlBackendSpec
Blanket Implementations
Mutably borrows from an owned value. Read more