diff --git a/lib.rs b/lib.rs index 5e40451..0200e5d 100755 --- a/lib.rs +++ b/lib.rs @@ -14,6 +14,9 @@ #[feature(managed_boxes)]; +#[feature(phase)]; +#[phase(syntax, link)] extern crate log; + extern crate geom; extern crate opengles; extern crate std; diff --git a/platform/android/surface.rs b/platform/android/surface.rs index 72e240a..3c9ab3e 100644 --- a/platform/android/surface.rs +++ b/platform/android/surface.rs @@ -19,7 +19,7 @@ use egl::eglext::{EGLImageKHR, DestroyImageKHR}; use std::cast; use std::mem; use std::ptr; -use std::vec; +use std::slice; use std::libc::c_void; /// FIXME(Aydin Kim) :Currently, native surface is consist of 2 types of hybrid image buffer. EGLImageKHR is used to GPU rendering and vector is used to CPU rendering. EGL extension seems not provide simple way to accessing its bitmap directly. In the future, we need to find out the way to integrate them. @@ -81,7 +81,7 @@ impl NativeSurfaceMethods for NativeSurface { fn new(_native_context: &NativePaintingGraphicsContext, size: Size2D, _stride: i32) -> NativeSurface { unsafe { let len = size.width * size.height * 4; - let bitmap = vec::from_elem::(len as uint, 0); + let bitmap = slice::from_elem::(len as uint, 0); NativeSurface { image: None, diff --git a/rendergl.rs b/rendergl.rs index 573e3f7..21fbe79 100755 --- a/rendergl.rs +++ b/rendergl.rs @@ -18,7 +18,7 @@ use geom::size::Size2D; use geom::rect::Rect; use opengles::gl2::{ARRAY_BUFFER, BLEND, COLOR_BUFFER_BIT, COMPILE_STATUS, FRAGMENT_SHADER}; use opengles::gl2::{LINK_STATUS, NO_ERROR, ONE_MINUS_SRC_ALPHA, SCISSOR_BOX, SCISSOR_TEST}; -use opengles::gl2::{SRC_ALPHA, STATIC_DRAW, TEXTURE_2D, TEXTURE_RECTANGLE_ARB, TEXTURE0}; +use opengles::gl2::{SRC_ALPHA, STATIC_DRAW, TEXTURE_2D, TEXTURE0}; use opengles::gl2::{TRIANGLE_STRIP, VERTEX_SHADER, VIEWPORT, GLenum, GLfloat, GLint, GLsizei}; use opengles::gl2::{GLuint, active_texture, attach_shader, bind_buffer, bind_texture, blend_func}; use opengles::gl2::{buffer_data, create_program, clear, clear_color, compile_shader}; @@ -231,6 +231,8 @@ pub fn init_program(vertex_shader: GLuint, fragment_shader: GLuint) -> GLuint { #[cfg(target_os="linux")] #[cfg(target_os="macos")] pub fn init_render_context() -> RenderContext { + use opengles::gl2::TEXTURE_RECTANGLE_ARB; + let vertex_2d_shader = load_shader(VERTEX_SHADER_SOURCE, VERTEX_SHADER); let fragment_2d_shader = load_shader(FRAGMENT_2D_SHADER_SOURCE, FRAGMENT_SHADER); let program_2d = init_program(vertex_2d_shader, fragment_2d_shader);