Skip to content

Instantly share code, notes, and snippets.

View bvssvni's full-sized avatar

Sven Nilsen bvssvni

View GitHub Profile
static VERTEX_SHADER_330: &'static str = r"
#version 330
uniform mat4 projection, view;
in vec2 tex_coord;
in vec3 color;
in vec3 position;
out vec2 v_tex_coord;
$ glxinfo
name of display: /tmp/launch-zi4Hzs/org.macosforge.xquartz:0
display: /tmp/launch-zi4Hzs/org.macosforge.xquartz:0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_SGIX_fbconfig, GLX_SGIS_multisample, GLX_ARB_multisample,
GLX_EXT_visual_info, GLX_EXT_import_context
client glx vendor string: Mesa Project and SGI
#![feature(globs)]
#![feature(default_type_params)]
extern crate debug;
extern crate graphics;
extern crate piston;
extern crate sdl2_game_window;
extern crate opengl_graphics;
use Window = sdl2_game_window::GameWindowSDL2;
$ RUST_BACKTRACE=1 ./examples/line_app
task '<main>' failed at 'index out of bounds: the len is 2 but the index is 2', examples/line_app.rs:1
stack backtrace:
1: 0x10343ee50 - rt::backtrace::imp::write::h6c359fe14955957dFfq
2: 0x103442451 - failure::on_fail::h5b364bef631ee448Yvq
3: 0x1034497b9 - unwind::begin_unwind_inner::hc444ac215ae53372AXd
4: 0x103449329 - unwind::begin_unwind_fmt::hd7ab0995d98f02223Ud
5: 0x103449131 - rust_begin_unwind
6: 0x10346b02e - failure::begin_unwind::h948981b6474164f3Ksj
7: 0x10346b509 - failure::fail_bounds_check::h4841fda35ea669a6Wqj
@bvssvni
bvssvni / error
Last active August 29, 2015 14:03
src/main.rs:108:17: 108:18 error: `d` does not live long enough
src/main.rs:108 let d = d.trans(10.0, 10.0);
^
src/main.rs:104:11: 117:2 note: reference must be valid for the block at 104:10...
src/main.rs:104 fn main() {
src/main.rs:105 let c = Context::new();
src/main.rs:106 {
src/main.rs:107 let d = c.trans(20.0, 40.0);
src/main.rs:108 let d = d.trans(10.0, 10.0);
src/main.rs:109 let transform = d.transform.get();
#version 330
in vec4 a_v4Position;
in vec4 a_v4FillColor;
in vec2 a_v2TexCoord;
uniform sampler2D s_texture;
out vec2 v_v2TexCoord;
out vec4 v_v4FillColor;
pub struct Per<A, B>(f64);
impl<T> Per<u8, T> {
pub fn bytes(num: f64) -> Per<u8, T> {
Per(num)
}
pub fn kibi_bytes(num: f64) -> Per<u8, T> {
Per(num * 1024.0)
}
$ make examples COMPILER_FLAGS="-O --cfg port_audio"
--- Type 'make test' to test library
error: linking with `cc` failed: exit code: 1
note: cc '-m64' '-L' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'examples/audio' 'examples/audio.o' '-lmorestack' '-nodefaultlibs' '-Wl,-dead_strip' '/Users/sven/Desktop/piston/target/x86_64-apple-darwin/lib/libpiston-a1b791b5-0.0.rlib' '/Users/sven/Desktop/opensource/gl-rs/target/x86_64-apple-darwin/lib/libgl-8febb75e-0.1.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libtime-4bb3739b-0.11.0-pre.rlib' '/Users/sven/Desktop/opensource/glfw-rs/target/x86_64-apple-darwin/lib/libglfw-38369174-0.1.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libsemver-e49a2dee-0.11.0-pre.rlib' '/Users/sven/Desktop/opensource/rust-portaudio/lib/libportaudio-896aa06e-0.1.rlib' '/Users/sven/Desktop/rust-graphics/target/x86_64-apple-darwin/lib/libgraphics-587c2edd-0.0.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libnative-1fb5e2c0-0.11.0-pre.rlib' '/usr/local/lib/ru
#!/bin/sh
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
src/gl/lib.rs:1939:57: 1939:66 error: cannot transmute to a type that contains type parameters
src/gl/lib.rs:1939 std::option::Some(p) => FnPtr { f: unsafe { transmute(p) }, is_loaded: true },
^~~~~~~~~