Skip to content

Conversation

@andelf
Copy link
Contributor

@andelf andelf commented Apr 15, 2014

This fixes #10 .

  • also add SDL_version support

@andelf
Copy link
Contributor Author

andelf commented Apr 15, 2014

partially fixes #64

@andelf
Copy link
Contributor Author

andelf commented Apr 15, 2014

I use CVec<u8> as the underlying pixels format. A better implementation might use type parameters. like:

pub trait Pixel {... } // stands for a single pixel
pub struct PixelRGBA8888 { r: u8, g: u8, b: u8, a: u8 }; // same size as underlying bytes
impl Pixel for PixelRGBA8888 {... }

let tex = renderer.create_texture::<PixelRGBA8888>(...) // got Texture<PixelRGBA8888>
tex.lock(None) // got CVec<PixelRGBA8888>

@AngryLawyer
Copy link
Member

Excellent! Thanks :)

AngryLawyer added a commit that referenced this pull request Apr 16, 2014
Implement Renderer::read_pixels, Texture::lock, Texture::unlock.
@AngryLawyer AngryLawyer merged commit 1fc2ae8 into Rust-SDL2:master Apr 16, 2014
jagprog5 pushed a commit to jagprog5/rust-sdl2 that referenced this pull request Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement SDL_RenderReadPixels, SDL_LockTexture, and SDL_UnlockTexture in render.rs

2 participants