From e6303c9615fa02b9605dbd8863e807a97b0ffb3e Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Mon, 10 Sep 2012 02:00:06 +0200 Subject: [PATCH] Add null_ctx.c and use this for Android for now --- android/jni/Android.mk | 2 +- console/griffin/griffin.c | 2 + gfx/context/null_ctx.c | 125 ++++++++++++++++++++++++++++++++++++++ gfx/context/null_ctx.h | 34 +++++++++++ 4 files changed, 162 insertions(+), 1 deletion(-) create mode 100644 gfx/context/null_ctx.c create mode 100644 gfx/context/null_ctx.h diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 3e94ee248e..c0c9ef6957 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -7,7 +7,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := retroarch LOCAL_SRC_FILES = ../../console/griffin/griffin.c ../../console/rzlib/rzlib.c -LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_ZLIB -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 +LOCAL_CFLAGS = -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_VID_CONTEXT -DHAVE_ZLIB -DINLINE=inline -DRARCH_CONSOLE -DLSB_FIRST -D__LIBRETRO__ -DHAVE_CONFIGFILE=1 -DHAVE_GRIFFIN=1 -DPACKAGE_VERSION=\"$(RARCH_VERSION)\" -Dmain=rarch_main -std=gnu99 LOCAL_LDLIBS := -lGLESv2 -llog diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index fdd512be03..faf3d4aaf7 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -91,6 +91,8 @@ VIDEO CONTEXT #include "../../gfx/context/ps3_ctx.c" #elif defined(_XBOX) #include "../../gfx/context/xdk_ctx.c" +#else +#include "../../gfx/context/null_ctx.c" #endif #endif diff --git a/gfx/context/null_ctx.c b/gfx/context/null_ctx.c new file mode 100644 index 0000000000..4a8eab4e2d --- /dev/null +++ b/gfx/context/null_ctx.c @@ -0,0 +1,125 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include "../../driver.h" + +#include + +#include "../gl_common.h" + +#include "null_ctx.h" + +int gfx_ctx_check_resolution(unsigned resolution_id) +{ + return 0; +} + +unsigned gfx_ctx_get_resolution_width(unsigned resolution_id) +{ + return 0; +} + +unsigned gfx_ctx_get_resolution_height(unsigned resolution_id) +{ + return 0; +} + +float gfx_ctx_get_aspect_ratio(void) +{ + return 4.0f/3.0f; +} + +void gfx_ctx_get_available_resolutions (void) +{ +} + +void gfx_ctx_set_swap_interval(unsigned interval, bool inited) +{ + (void)inited; + (void)interval; +} + +void gfx_ctx_check_window(bool *quit, + bool *resize, unsigned *width, unsigned *height, unsigned frame_count) +{ +} + +void gfx_ctx_swap_buffers(void) +{ +} + +void gfx_ctx_clear(void) +{ +} + +void gfx_ctx_set_blend(bool enable) +{ +} + +void gfx_ctx_set_resize(unsigned width, unsigned height) { } + + +bool gfx_ctx_menu_init(void) +{ +} + +void gfx_ctx_update_window_title(bool reset) { } + +void gfx_ctx_get_video_size(unsigned *width, unsigned *height) +{ +} + +bool gfx_ctx_init(void) +{ + return true; +} + +bool gfx_ctx_set_video_mode( + unsigned width, unsigned height, + unsigned bits, bool fullscreen) +{ + return true; +} + +void gfx_ctx_destroy(void) +{ +} + +void gfx_ctx_input_driver(const input_driver_t **input, void **input_data) { } + +void gfx_ctx_set_filtering(unsigned index, bool set_smooth) +{ +} + +void gfx_ctx_set_fbo(bool enable) +{ +} + +void gfx_ctx_apply_fbo_state_changes(unsigned mode) +{ +} + +void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_rotate) +{ +} + +void gfx_ctx_set_aspect_ratio(void *data, unsigned aspectratio_index) +{ +} + +void gfx_ctx_set_overscan(void) +{ +} diff --git a/gfx/context/null_ctx.h b/gfx/context/null_ctx.h new file mode 100644 index 0000000000..0bc3704f3b --- /dev/null +++ b/gfx/context/null_ctx.h @@ -0,0 +1,34 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * Copyright (C) 2011-2012 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#ifndef _NULL_CTX_H +#define _NULL_CTX_H + +#include "../gl_common.h" + +void gfx_ctx_get_available_resolutions (void); +int gfx_ctx_check_resolution(unsigned resolution_id); +float gfx_ctx_get_aspect_ratio(void); +unsigned gfx_ctx_get_resolution_width(unsigned resolution_id); +unsigned gfx_ctx_get_resolution_height(unsigned resolution_id); +void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_rotate); +void gfx_ctx_set_aspect_ratio(void *data, unsigned aspectratio_index); +void gfx_ctx_set_overscan(void); +void gfx_ctx_set_fbo(bool enable); +void gfx_ctx_clear(void); +void gfx_ctx_set_blend(bool enable); + +#endif