-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug texture drawing. #217
Comments
I just tried it and I see two rust logos - it works as expected here. |
Hmm, perhaps its broken only for me. |
Do you have some local override for gfx-rs? Perhaps, you could provide an |
@Potpourri which platform are you on? |
@bvssvni I'm on Linux with OpenGL 2.1(of course I always change OpenGL over to 2.1). |
|
And this example works too fine: extern crate piston;
extern crate graphics;
extern crate piston_window;
extern crate sdl2_window;
extern crate gfx_device_gl;
extern crate gfx_graphics;
use std::cell::RefCell;
use std::rc::Rc;
use std::path::Path;
use piston::window::WindowSettings;
use piston_window::*;
use gfx_graphics::{ Texture, TextureSettings };
use sdl2_window::{ Sdl2Window, OpenGL };
fn main() {
let window = Rc::new(RefCell::new(
Sdl2Window::new(
OpenGL::_3_2,
WindowSettings::new(
"gfx_graphics: image_test",
[300, 300]
)
.exit_on_esc(true)
)
));
let events = PistonWindow::new(window, empty_app());
let rust_logo = Texture::from_path(&mut events.canvas.borrow_mut().factory,
&Path::new("./assets/rust.png"),
&TextureSettings::new()).unwrap();
let image_2 = Texture::from_path(&mut events.canvas.borrow_mut().factory,
&Path::new("./assets/image2.png"),
&TextureSettings::new()).unwrap();
for e in events {
use graphics::*;
e.draw_2d(|c, g| {
clear([1.0; 4], g);
image(&rust_logo, c.transform, g);
image(&image_2, c.transform.trans(150.0, 0.0), g);
image(&rust_logo, c.transform.trans(150.0, 150.0), g);
image(&image_2, c.transform.trans(0.0, 150.0), g);
});
}
} |
Could someone else also verify that it works (or it doesn't)? It'd be strange if this thing only worked for GL-3.2 |
@Potpourri when I moved shaders to the shaders repo I changed the order of one |
When I try drawing the same texture two or more times, texture will be drawn only first time.
Example:
/cc @kvark
The text was updated successfully, but these errors were encountered: