mirror of
https://github.com/libretro/RetroArch
synced 2025-02-25 21:41:03 +00:00
(Blackberry) Move libscreen initialization to Blackberry graphics
context driver
This commit is contained in:
parent
8c1b9a5346
commit
fefb65b84a
@ -19,42 +19,13 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <screen/screen.h>
|
|
||||||
#include <bps/navigator.h>
|
|
||||||
#include <bps/screen.h>
|
|
||||||
#include <bps/bps.h>
|
#include <bps/bps.h>
|
||||||
#include <bps/event.h>
|
|
||||||
|
|
||||||
screen_context_t screen_ctx;
|
|
||||||
|
|
||||||
int rarch_main(int argc, char *argv[])
|
int rarch_main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
//Initialize bps
|
//Initialize bps
|
||||||
bps_initialize();
|
bps_initialize();
|
||||||
|
|
||||||
RARCH_LOG("Initializing screen context\n");
|
|
||||||
|
|
||||||
// Create a screen context that will be used to create an EGL surface to receive libscreen events
|
|
||||||
screen_create_context(&screen_ctx, 0);
|
|
||||||
|
|
||||||
if (screen_request_events(screen_ctx) != BPS_SUCCESS)
|
|
||||||
{
|
|
||||||
RARCH_ERR("screen_request_events failed.\n");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navigator_request_events(0) != BPS_SUCCESS)
|
|
||||||
{
|
|
||||||
RARCH_ERR("navigator_request_events failed.\n");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navigator_rotation_lock(false) != BPS_SUCCESS)
|
|
||||||
{
|
|
||||||
RARCH_ERR("navigator_location_lock failed.\n");
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
rarch_main_clear_state();
|
rarch_main_clear_state();
|
||||||
|
|
||||||
g_extern.verbose = true;
|
g_extern.verbose = true;
|
||||||
@ -83,7 +54,6 @@ int rarch_main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
error:
|
error:
|
||||||
screen_stop_events(screen_ctx);
|
|
||||||
bps_shutdown();
|
bps_shutdown();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#include <bps/screen.h>
|
#include <bps/screen.h>
|
||||||
#include <bps/navigator.h>
|
#include <bps/navigator.h>
|
||||||
|
#include <bps/event.h>
|
||||||
#include <screen/screen.h>
|
#include <screen/screen.h>
|
||||||
#include <sys/platform.h>
|
#include <sys/platform.h>
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
@ -43,7 +44,7 @@ static EGLDisplay g_egl_dpy;
|
|||||||
static EGLConfig egl_config;
|
static EGLConfig egl_config;
|
||||||
static bool g_resize;
|
static bool g_resize;
|
||||||
|
|
||||||
extern screen_context_t screen_ctx;
|
static screen_context_t screen_ctx;
|
||||||
static screen_window_t screen_win;
|
static screen_window_t screen_win;
|
||||||
static screen_display_t screen_disp;
|
static screen_display_t screen_disp;
|
||||||
|
|
||||||
@ -94,6 +95,30 @@ static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
|||||||
|
|
||||||
static bool gfx_ctx_init(void)
|
static bool gfx_ctx_init(void)
|
||||||
{
|
{
|
||||||
|
/* Create a screen context that will be used to
|
||||||
|
* create an EGL surface to receive libscreen events */
|
||||||
|
|
||||||
|
RARCH_LOG("Initializing screen context...\n");
|
||||||
|
screen_create_context(&screen_ctx, 0);
|
||||||
|
|
||||||
|
if (screen_request_events(screen_ctx) != BPS_SUCCESS)
|
||||||
|
{
|
||||||
|
RARCH_ERR("screen_request_events failed.\n");
|
||||||
|
goto screen_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (navigator_request_events(0) != BPS_SUCCESS)
|
||||||
|
{
|
||||||
|
RARCH_ERR("navigator_request_events failed.\n");
|
||||||
|
goto screen_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (navigator_rotation_lock(false) != BPS_SUCCESS)
|
||||||
|
{
|
||||||
|
RARCH_ERR("navigator_location_lock failed.\n");
|
||||||
|
goto screen_error;
|
||||||
|
}
|
||||||
|
|
||||||
const EGLint attribs[] = {
|
const EGLint attribs[] = {
|
||||||
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
||||||
@ -250,6 +275,8 @@ static bool gfx_ctx_init(void)
|
|||||||
error:
|
error:
|
||||||
RARCH_ERR("EGL error: %d.\n", eglGetError());
|
RARCH_ERR("EGL error: %d.\n", eglGetError());
|
||||||
gfx_ctx_destroy();
|
gfx_ctx_destroy();
|
||||||
|
screen_error:
|
||||||
|
screen_stop_events(screen_ctx);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user