nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Fix for Android
[nit.git]
/
lib
/
mnit_linux
/
linux_opengles1.nit
diff --git
a/lib/mnit_linux/linux_opengles1.nit
b/lib/mnit_linux/linux_opengles1.nit
index
b88f450
..
084abcc
100644
(file)
--- a/
lib/mnit_linux/linux_opengles1.nit
+++ b/
lib/mnit_linux/linux_opengles1.nit
@@
-14,26
+14,12
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# 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
import sdl
-in "C Header" `{
- #define LOGW(...) ((void)fprintf(stderr, "# warn: %s", __VA_ARGS__))
- #ifdef DEBUG
- #define LOGI(...) ((void)fprintf(stderr, "# info: %s", __VA_ARGS__))
- #else
- #define LOGI(...) (void)0
- #endif
-`}
-
in "C" `{
NativeWindowType mnit_window;
EGLNativeDisplayType mnit_native_display;
in "C" `{
NativeWindowType mnit_window;
EGLNativeDisplayType mnit_native_display;
@@
-46,7
+32,7
@@
redef class Display
fun wanted_height: Int do return 600
end
fun wanted_height: Int do return 600
end
-redef class Opengles1Display # in "C" `{struct mnit_opengles_Texture *`}
+redef class Opengles1Display
# display managing the window, events, fonts? and image loading?
var sdl_display: SDLDisplay
# display managing the window, events, fonts? and image loading?
var sdl_display: SDLDisplay
@@
-90,9
+76,11
@@
redef class Opengles1Display # in "C" `{struct mnit_opengles_Texture *`}
end
end
end
end
-redef extern Opengles1Image
+redef extern class Opengles1Image
new from_sdl_image( sdl_image: SDLImage ) is extern `{
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 );
+ 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
`}
# using sdl
@@
-102,10
+90,12
@@
redef extern Opengles1Image
sdl_image = IMG_Load( String_to_cstring( path ) );
if ( !sdl_image ) {
sdl_image = IMG_Load( String_to_cstring( path ) );
if ( !sdl_image ) {
- LOGW( "SDL failed to load image <%s>: %s\n", String_to_cstring( path ), IMG_GetError() );
+ fprintf(stderr, "SDL failed to load image <%s>: %s\n", String_to_cstring(path), IMG_GetError());
return NULL;
} else {
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;
}
SDL_FreeSurface(sdl_image);
return opengles_image;
}