X-Git-Url: http://nitlanguage.org diff --git a/lib/mnit_linux/linux_opengles1.nit b/lib/mnit_linux/linux_opengles1.nit index 00a037f..f94a0e0 100644 --- a/lib/mnit_linux/linux_opengles1.nit +++ b/lib/mnit_linux/linux_opengles1.nit @@ -14,14 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -module linux_opengles1 is - pkgconfig("glesv1_cm", "x11", "egl") - c_compiler_option(exec("sdl-config", "--cflags")) - c_linker_option(exec("sdl-config", "--libs"), "-lSDL_image -lSDL_ttf") -end +module linux_opengles1 is pkgconfig("x11") -import mnit # for -# import opengles1 +import mnit::opengles1 import sdl @@ -48,7 +43,7 @@ redef class Opengles1Display return super end - fun init_from_sdl( sdl_display: SDLDisplay ): Bool is extern `{ + fun init_from_sdl( sdl_display: SDLDisplay ): Bool `{ mnit_sdl_surface = sdl_display; mnit_window = (NativeWindowType)XOpenDisplay(NULL); @@ -81,13 +76,15 @@ redef class Opengles1Display end end -redef extern Opengles1Image - new from_sdl_image( sdl_image: SDLImage ) is extern `{ - return mnit_opengles_load_image( sdl_image->pixels, sdl_image->w, sdl_image->h, sdl_image->format->Amask ); +redef extern class Opengles1Image + new from_sdl_image( sdl_image: SDLImage ) `{ + return mnit_opengles_load_image( sdl_image->pixels, + sdl_image->w, sdl_image->h, + sdl_image->w, sdl_image->h, sdl_image->format->Amask ); `} # using sdl - new from_file( path: String ) is extern import String.to_cstring `{ + new from_file( path: String ) import String.to_cstring `{ SDL_Surface *sdl_image; struct mnit_opengles_Texture *opengles_image; @@ -96,7 +93,9 @@ redef extern Opengles1Image fprintf(stderr, "SDL failed to load image <%s>: %s\n", String_to_cstring(path), IMG_GetError()); return NULL; } else { - opengles_image = mnit_opengles_load_image( sdl_image->pixels, sdl_image->w, sdl_image->h, sdl_image->format->Amask ); + opengles_image = mnit_opengles_load_image( sdl_image->pixels, + sdl_image->w, sdl_image->h, + sdl_image->w, sdl_image->h, sdl_image->format->Amask ); SDL_FreeSurface(sdl_image); return opengles_image; }